                RedHat install disk in CJK languages
                           technical report

                          Mizi Research Inc.


                               Abstract

    RedHat install disk already has some sort of multi-lingual
    facilities.  But the supported languages includes only the ones
    which use Latin (iso8859-*) character set, since the
    limit of Linux console does not provides any support for
    multi-byte languages such as CJK (Chinese, Japanese, and Korean)
    languages.

    In this report, we present how to add Korean Language into the
    current (5.2) RedHat bootdisk.  We implemented the Korean added
    version of the install disk, and released it under GNU General
    Public License.  This technique is not only for Korean languages,
    but it could be used also for Chinese and Japanese languages.


----------------------------------------------------------------------

  Trademarks

  * Debian is the trademark owned by Software in Public Interest, Inc.
  * Linux is the trademark owned by Linus Torvalds.
  * RedHat is the trademark owned by RedHat Software, Inc.

----------------------------------------------------------------------


Overview
********

The current i18n mechanism
==========================

RedHat install disk already has some sort of multi-lingual
facilities.  First, the installer will be requested to select one of
the available languages.  After the language selection, nearly all
install messages are in the selected language.  

But the supported languages includes only the ones which use Latin
(iso8859-*) character set.  None of Chinese, Japanese and Korean
language is not supported.

Why not CJK?
============

The problem is at Linux console.  Linux console (and maybe all Unix
text terminal) was not designed to support multi-byte languages.

A few of Korean VGAs have a text mode which can display Hangul.  But
the cards are almost unused in this time.  (These hardwares have been
popular because of a poor textmode-only OS, called DOS.)

We can think of a special Linux console driver to display these
languages.  But we don't know how long it take, nor even whether it'll
be available someday.


Ideas
*****

Using KON2 as its CJK display engine
====================================

KON means `Kanji On Linux'.  KON is initially made for Japanese, but
now it can display also Chinese (Big5 and GB encodings) and Korean
(EUC-KR encoding).

KON2 is a descent version of KON.  We will use this program to display
CJK-translated messages from install program.

This is not the first attempt to use KON2 in an install disk for CJK
users.  There have been already FreeBSD CJK boot disk, Debian-JP
Japanese boot disk, Debian-KR Korean boot disk.

CJK extension disk
==================

Unfortunately, we couldn't put KON2 into the install disk or the
supplement disk, since the both have no additional space in those 1.44
megabytes floppy disk limit.

So we made an additional "CJK extension" disk for CJK users.  Surely
this approach is a easy way, and is more acceptable to non-CJK users.
The CJK extension disk contains:

* KON2 executable
* CJK fonts (in BDF format) for KON.
* KON2 configuration files for Chinese, Japanese, or Korean languages.

The capacity for CJK extension disks is about 1.1 megabytes.  (about
700 kilobytes from that were filled with the CJK fonts.)  Of course if
a user want to load the CJK extension disk, the user should have more
memory than the Latin language users.


Implementation Details
**********************

Modifying KON2
==============

Make "install" execute in kon
-----------------------------

Because the "install" program,

  (1) depends on the argv[0], and
  (2) depends on the command line options,

we should modify KON2's option.

The "-e" option of the original KON2 (0.3.7) has the same purpose as
Xterm's "-e" option (executing the option argument as its shell).  But
KON2's "-e" option accepts only one arguments, which means we cannot
pass additional argument KON2's shell.

We modified KON2 so that KON2's "-e" syntax is exactly same as Xterm.
And, for convenience, we added "-ev" option.

  $ kon -ev /usr/sbin/install install-continue ...

The first argument of "-ev" is the program path, and the rest
arguments are argv[0], argv[1], ..., argv[argc-1].  We will use this
"-ev" option when we use KON2.

Make kon work in the limited environment
----------------------------------------

* utmp-logging routines were commented out.

* Kon was linked statically.

* `fld' has been modified to support gzipped font, using zlib.

  Kon uses system (2) to run its `StartUp' commands.  The commands are
  normally used for loading fonts to use with kon.  `fld' command
  loads any font files via shared memory.  But there is no shell so we
  can't use the system() function.

  To use gzipped fonts without shell and pipe, now fld has the gzipped
  font support.

Modifying install program
=========================

* Add Korean in the selectible language list.

* Translate the messages, in the ko.po file.

* If the language is one of the CJK,

  (1) Load the CJK extension disk.  Mount it and make symlinks.

  (2) Set up KON config file, so that KON properly display the
      language (Chinese, Japanese, or Korean).

  (3) Re-execute install program inside kon, using the "-ve" option.

  (4) In the new process, install runs `fld' command to load its font.

Modifying initrd
================

To make kon2 run properly, the following devices should be in the initrd.

* /dev/mem

* one of the /dev/tty[ps]*, and one of the /dev/pty[ps]*


Adding CJK disk update/make script
==================================

Along with updboot, mkboot, updresc, mkresc, updsupp, and mksupp
scripts, we added updcjk and mkcjk scripts in the `misc/src/trees'
directory.

There are kon2 packages out there.  But we modified kon2 a little.
For convenience, we provide modified kon source tree in misc/src
directory.  You can build kon2 by running `make config; make'.

misc/src/kon
misc/src/kon/fonts       -- Chinese, Japanese, and Korean fonts
misc/src/kon/cfgs        -- KON config files for Chinese, Japanese, and Korean
misc/src/kon/kon2-0.3.7  -- The original KON2 source tree


Future Works
************

Adding Chinese and Japanese
===========================

We make the complete Korean install disk, but this disk can support
Chinese or Japanese if someone could volunteer to translate the
messages.  

The CJK extension disk already contains a Chinese font (BIG5.HKU-0
encoding) and a Japanese font (JISX0208.1983-0 encoding).


Installing with bootable CDROM
==============================

It is not natural to insert CJK "floppy" disk, when the RH is
installed from bootable CD.  The CJK disk images also should go into
CD-ROM.  This problem is, that users should select the preferable
language "before" the media selection.

This problem should be discussed more.


References
**********

* The original RedHat install program source, 
  <ftp://www.redhat.com/pub/redhat/redhat-5.2/misc/src/>

* FreeBSD Multilingual Installer Boot-FD
  <http://wing-yee.ntc.keio.ac.jp/hosokawa/FreeBSD-boot/>

* Debian-JP Japanese install disk
  <ftp://ftp.debian.or.jp/debian-jp/dists/slink-jp/disks-i386>

* Debian-KR Korean install disk,
  <ftp://doit.ajou.ac.kr/debian-kr/dists/potato-kr/disks-i386>

