MAPCHAN(M) XENIX System V MAPCHAN(M)
Name
mapchan - Configure tty device mapping.
Syntax
mapchan [-ans] [ -f mapfile ] [ channels ... ]
mapchan [ [ -o ] [ -d ] ] [ channel ]
trchan [-c] mapfile
Description
mapchan configures the mapping of information input and
output of . The mapchan utility is intended for users of
vertical applications that employ languages other than
English (non-7-bit-ASCII character sets).
mapchan interprets codes sent by peripheral devices, such as
terminals, to the internal character set used by the
system. mapchan can also map codes in the internal character
set to other codes, for output to peripheral devices (such
as terminals, printers, console screen, etc.). Note that
some PC keyboard configuration may also be accomplished
through the mapkey(M) utility.
mapchan has several uses: to map a channel (-a or -s); to
unmap a channel (-n and optionally -a); or to display the
map on a channel (optionally -o, -d, channels).
trchan performs mapping as a filter, using the same format
of mapfile as mapchan. This allows a file consisting of one
internal character set to be ``translated'' to another
internal character set. trchan reads standard input, maps
it, and writes to standard output. A mapfile must be given
on the command line. Errors cause trchan to stop processing
unless -c is specified.
mapchan with no options displays the map on the user's
channel. The map displayed is suitable as input for
mapchan.
The options are:
-a when used alone, sets all channels given in the default
file (/etc/default/mapchan) with the specified map.
When used with -n, it refers to all channels given in
the default file. Super-user maps or unmaps all
channels, other users map only channels they own. -a
can not be used with -d, -o, or -s.
-c causes errors to be echoed on stderr, and processing is
continued. Used with trchan only.
-d causes the mapping table currently in use on the given
device, channel, to be displayed in decimal instead of
Page 1 (printed 8/7/87)
MAPCHAN(M) XENIX System V MAPCHAN(M)
the default hexadecimal. An ASCII version is displayed
on standard output. This output is suitable as an input
file to mapchan for another channel. Mapped values are
displayed. Identical pairs are not output. -d can not
be used with -a, -f, -n, -o, or -s.
-f causes the current channel or list of channels to be
mapped with mapfile. -f can not be used with -d, -n,
-s, or -o.
-n causes null mapping to be performed. All codes are
input and output as received. Mapping is turned off
for the user's channel or for other channels, if given.
-a used with -n will turn mapping off on all channels
given in the default file. This is the default mapping
for all channels unless otherwise configured. -n can
not be used with -d, -f, -o, or -s.
-o causes the mapping table currently in use on the given
device, channel, to be displayed in octal instead of
the default hexadecimal. An ASCII version is displayed
on standard output. This output is suitable as an input
file to mapchan for another port. Mapped values are
displayed. Identical pairs are not output. -o can not
be used with -a, -d, -f, -n, or -s.
-s sets the user's current channel with the mapfile given
in the default file. -s can not be used with any other
option.
The user must own the channel in order to map it. The
super-user can map any channel. Read or write permission is
required to display the map on a channel.
Each tty device channel (display adapter and video monitor
on computer, parallel port, serial port, etc.) can have a
different map. When boots, mapping is off for all
channels.
mapchan is usually invoked in the /etc/rc file. This file is
executed when the system enters multi-user mode and sets up
the default mapping for the system. Users can invoke
mapchan when they log in by including a mapchan command line
in their .profile or .login file. In addition, users can
remap their channel at any time by invoking mapchan from the
command line. Channels not listed in the default file are
not automatically mapped. Channels tty02-06 are listed in
the default file as distributed, using stdrom as the
mapfile. channels are not changed on logout. Whatever
mapping was in place for the last user remains in effect for
the next user, unless they modify their .profile or .login
file.
Page 2 (printed 8/7/87)
MAPCHAN(M) XENIX System V MAPCHAN(M)
For example, the default file /etc/default/mapchan can
contain:
tty02 stdrom
tty1a
tty2a fra/terminal
lp ger/map78
The default directory containing mapfiles is
/usr/lib/mapchan. Subdirectories are lower case three
letter names that are language abbreviations. All the
mapfiles for a given language or country are conveniently
grouped. The default directory containing channel files is
/dev. Full pathnames may be used for channels or mapfiles.
If a channel has no entry, or the entry field is blank, no
mapping is enabled on that channel. Additional channels
added to the system, (for example, adding a serial or
parallel port) are not automatically entered in the mapchan
default file. If mapping is required, the system
administrator must make the entries.
The format of the mapfiles is documented in the mapchan(F)
manual page.
Using a Mapped channel
The input information is assumed to be 7- or 8-bit codes
sent by the peripheral device. The device may make use of
``dead'' or ``compose'' keys to produce the codes. If the
device does not have dead or compose keys, these keys can be
simulated using mapchan.
One to one mapped characters are displayed when the key is
pressed, and the mapped value is passed to the kernel.
Certain keys are designated as dead keys in the mapfile.
Dead key sequences are two keystrokes that produce a single
mapped value that is passed to the kernel. The dead key is
usually a diacritical character, the second key is usually
the letter being modified. For example, the sequence ' e
could be mapped to the ASCII value 0xE9, and display as e'.
One key is designated as the compose key in the mapfile.
Compose key sequences are composed of three keystrokes that
produce a single mapped value that is passed to the kernel.
The compose key is usually a seldom used character or ctrl-
letter combination. The second key is usually the letter
being modified. The third key may be another character
being combined, or a diacritical character. For example, if
`@' is the compose key, the sequence @ c O could be mapped
to the ASCII value 0xA9, and display as O.
Characters are not echoed to the screen during a dead or
Page 3 (printed 8/7/87)
MAPCHAN(M) XENIX System V MAPCHAN(M)
compose sequence. The mapped character is echoed and passed
to the kernel once the sequence is correctly completed.
Characters are always put through the input map, even when
part of dead or compose sequences. The character is then
checked for the internal value. The value may also be mapped
on output. This should be kept in mind when preparing map
files.
The following conditions will cause an error during input:
+ dead key followed by a dead key
+ non-recognized (not defined in the mapfile) dead or
compose sequence
+ restarting a compose sequence before completion by
pressing the compose key in the middle of a dead or
compose sequence. This is an error, but a new compose
sequence is initiated.
If the mapfile contains the keyword beep, a bell sounds when
any of the above conditions occurs. In either case, the
characters are not echoed to the screen, or passed to the
kernel.
Character Sets
The internal character set used by is defined by the
mapfiles used. By default, this is the 8-bit ASCII
character set which is also known as the dpANS X3.4.2 and
ISO/TC97/SC2 or ISO 8859 Level I character sets. It
supports most of the Latin alphabet and can represent most
European languages.
Several partial map files are provided as examples. They
must be modified for use with specific peripheral devices.
Consult your hardware manual for the codes needed to display
the desired characters. Input maps for each of the
following 7-bit national character sets are included:
Character Set Standard Designation
__________________________________________________________________
UK 7-bit Std (BS 4730)
French 7-bit Std (NFZ 62-101 1982)
German 7-bit Std (DIN 66003)
Canadian 7-bit English and French bilingual (CSA Z243.4-1973)
In addition, mapkey(C) and corresponding mapchan mapfiles
are provided for eight different countries, one file for
computers with standard PC character ROMs, and one file for
8859 ROMs. 8-bit terminals need little, if any, mapping as
long as the stty(C) settings are correct. The /etc/gettydefs
Page 4 (printed 8/7/87)
MAPCHAN(M) XENIX System V MAPCHAN(M)
file may require modification to allow logging in with the
correct settings.
US 7-bit ASCII (ANSI X3.4) is used if no mapping is enabled
on the channel.
Files
/etc/default/mapchan
/usr/lib/mapchan/map.stdrom
/usr/lib/mapchan/map.*
See Also
ascii(M), keyboard(HW), lp(C), lpadmin(C), mapchan(F),
mapkey(M), parallel(HW), screen(HW), serial(HW), setkey(M),
tty(M)
Notes
mapchan should be used with vertical applications only, as
there are several utilities, including the sh(C) shell,
which may not function as expected. 8-bit codes should not
be used in filenames.
Some foreign keyboards and display devices do not contain
characters commonly used by command shells and the C
programming language. It is not recommended that these
devices be used for system administration tasks.
Printers can be mapped, output only, and can either be sent
8-bit codes or one-to-many character strings using mapchan.
Line printer spooler interface scripts can be used (setuid
root) to change the output map on the printer when different
maps are required (as in changing print wheels to display a
different character set). See lp(C) and lpadmin(C) for
information on installing and administering interface
scripts.
Not all terminals or printers can display all the characters
that can be represented using this utility. Refer to the
device's hardware manual for information on the capabilities
of the peripheral device.
WARNING: Use of mapfiles that specify a different
``internal'' character set per-channel, or a set other than
the 8-bit ASCII set supplied by default can cause strange
side effects. It is especially important to retain the 7-bit
ASCII portion of the character set (see ascii(M)).
utilities and many applications assume these values.
Page 5 (printed 8/7/87)
MAPCHAN(M) XENIX System V MAPCHAN(M)
Media transported between machines with different internal
code set mappings may not be portable as no mapping is
performed on block devices, such as tape and floppy drives.
However, trchan with an appropriate mapfile can be used to
``translate'' from one internal character set to another.
Do not set ISTRIP (see stty(C)) when using mapchan. This
option causes the eighth bit to be stripped before mapping
occurs.
Page 6 (printed 8/7/87)