display(7) UNIX System V display(7)
NAME
display - system console display
DESCRIPTION
The system console (and user's terminal) is composed of two separate
pieces: the keyboard [see keyboard (7)] and the display. Because of
their complexity, and because there are three possible display interfaces
(monochrome, color graphics, and enhanced graphics adapters), they are
discussed in separate manual entries.
The display normally consists of 25 lines of 80 columns each; 40-column
lines are also supported by the color/graphics adapter, and 43 lines of
80-columns each are supported by the enhanced graphics adapter. Writing
characters to the console or one of its virtual screens (/dev/console or
/dev/vtxx) has an effect which depends on the characters. All characters
written to /dev/console are first processed by the terminal interface
[see termio (7)]. For example, mapping new-line characters to carriage
return plus new-line, and expanding tabs to spaces, will be done before
the following processing:
x Where x is not one of the following, displays x.
BEL Generates a bell (audible tone, no modulation).
CR Places the cursor at column 1 of the current line.
LF, VT Places the cursor at the same column of the next line
(scrolls if the the current line is line 25).
FF Clears the screen and places the cursor at line 1, column 1.
BS If the cursor is not at column 1, it is moved to the left one
position on the same line. If the cursor is at column 1 but
not line 1, it is moved to column 79 of the previous line.
Finally, if the cursor is at column 1, line 1, it is not
moved.
The display can be controlled by means of ANSI X3.64 escape sequences,
which are specific sequences of characters, preceded by the ASCII
character ESC. The escape sequences, which work on either the
monochrome, color graphics, or enhanced graphics adapter, are the
following:
ESC c Clears the screen and places the cursor at line 1, column 1.
ESC Q n 'string'
Defines the function key n with string. The string delimiter
' may be any character not in string. Function keys are
numbered 0 through 11 (F1 = 0, F2 = 1, etc.)
10/89 Page 1
display(7) UNIX System V display(7)
ESC[ n @ Insert character-inserts n blanks at the current cursor
position.
ESC[ n ` Horizontal Position Absolute-moves active position to column
given by n.
ESC[ n A Cursor up-moves the cursor up n lines (default: n=1).
ESC[ n a Horizontal Position Relative-moves active position n
characters to the right (default: n=1).
ESC[ n B Cursor down-moves the cursor down n lines (default: n=1).
ESC[ n C Cursor right-moves the cursor right n columns (default:
n=1).
ESC[ n c where n is 0 (underline cursor), 1(blockcursor), or 2(no
cursor). 0 is the default value for n.
ESC[ n D Cursor left-moves the cursor left n columns (default: n=1).
ESC[ n d Vertical Position Absolute-moves active position to line
given by n.
ESC[ n E Cursor next line-moves the cursor to column 1 of the next
line, then down n-1 lines (default: n=1).
ESC[ n e Vertical Position Relative-moves the active position down n
lines (default: n=1).
ESC[ n F Cursor previous line-moves the cursor to column 1 of the
current line, then up n lines (default: n=1).
ESC[ n G Cursor horizontal position-moves the cursor to column n of
the current line (default: n=1).
ESC[ n ; m H
Position cursor-moves the cursor to column m of line n
(default: n=1, m=1).
ESC[ n ; m f
Position cursor-moves the cursor to column m of line n
(default: n=1, m=1).
ESC[ n J Erase window-erases from the current cursor position to the
end of the window if n=0, from the beginning of the window to
the current cursor position if n=1, and the entire window if
n=2 (default: n=0).
ESC[ n K Erase line-erases from the current cursor position to the end
of the line if n=0, from the beginning of the line to the
current cursor position if n=1, and the entire line if n=2
Page 2 10/89
display(7) UNIX System V display(7)
(default: n=0).
ESC[ n L Insert line-inserts n lines at the current cursor position
(default: n=1).
ESC[ n M Delete line-deletes n lines starting at the current cursor
position (default: n=1).
ESC[ n P Delete character-deletes n characters from a line starting at
the current cursor position (default: n=1).
ESC[ n S Scroll up-scrolls the characters in the current window up n
lines. The bottom n lines are cleared to blanks (default:
n=1).
ESC[ n T Scroll down-scrolls the characters in the current window down
n lines. The top n lines are cleared to blanks (default:
n=1).
ESC[ n X Erase character-erases n character positions starting at the
current cursor position (default: n=1).
ESC[ n Z Cursor Backward Tabulation-moves active position back n tab
stops.
ESC[ 2 h Locks the keyboard and ignores keyboard input until unlocked.
Characters are not saved.
ESC[ 2 i Sends the screen to the host. The current screen display is
sent to the application.
ESC[ 2 l Unlocks the keyboard. Re-enables keyboard input.
ESC[ Ps ; Ps; m
Character attributes-each Ps is one of the following
characters; multiple characters are separated by semicolons.
These parameters apply to successive characters being
displayed, in an additive manner (e.g., both bold and
underscoring can be selected). Only the parameters through 7
apply to the monochrome adapter; all parameters apply to the
color/graphics adapter and the enhanced graphics adapter.
(Default: Ps=0).
10/89 Page 3
display(7) UNIX System V display(7)
______________________________________________________
| Ps Meaning |
|_____________________________________________________|
| 0 all attributes off (normal display) |
| (white foreground with black background) |
| 1 bold intensity |
| 4 underscore on |
| (white foreground with red background on color)|
| 5 blink on |
| 6 VGA only: if blink (5) is on, turn blink off |
| and background color to its light equivalent |
| (i.e. brown to yellow). |
| 7 reverse video |
| 30 black (gray) foreground|
| 31 red (light red) foreground|
| 32 green (light green) foreground|
| 33 brown (yellow) foreground|
| 34 blue (light blue) foreground|
| 35 magenta (light magenta) foreground|
| 36 cyan (light cyan) foreground|
| 37 white (bright white) foreground|
| 40 black (gray) background|
| 41 red (light red) background|
| 42 green (light green) background|
| 43 brown (yellow) background|
| 44 blue (light blue) background|
| 45 magenta (light magenta) background|
| 46 cyan (light cyan) background|
| 47 white (bright white) background|
|_____________________________________________________|
Note that for character attributes 30-37, the color selected
for foreground will depend on whether the bold intensity
attribute (1) is currently on. If not, the first color
listed will result; otherwise the second color listed will
result.
Similarly, for character attributes 40-47, the color selected
for background will depend on whether the blink attribute (5)
is currently on and bright background (6) has been turned on.
If blink is not turned on or bright background has not been
selected, the first listed color will result. Otherwise, the
second color listed will result.
ESC[ 8 m sets blank (non-display)
ESC[ 10 m selects the primary font
ESC[ 11 m selects the first alternate font; lets ASCII characters less
than 32 be displayed as ROM characters
Page 4 10/89
display(7) UNIX System V display(7)
ESC[ 12 m selects a second alternate font; toggles high bit of extended
ASCII code before displaying as ROM characters
ESC[ 38 m enables underline option; white foreground with white
underscore (see WARNINGS)
ESC[ 39 m disables underline option; see WARNINGS
The following non-ANSI X3.64 escape sequences are supplied:
ESC[= c A Sets overscan color.
ESC[= p ; d B
Sets bell parameters (where p is the pitch in Hz and d is the
duration in milliseconds)
ESC[= s ; e C
Sets cursor parameters (where s is the starting and e is the
ending scanlines of the cursor).
ESC[= x D Enables/disables intensity of background color (where x is 0
for enable and 1 for disable).
ESC[= x E Sets/clears blink vs. bold background (where x is 0 for set
and 1 for clear).
ESC[= c F Sets normal foreground color. See GIOATTR for the valid
values for c.
ESC[= c G Sets normal background color. See GIOATTR for the valid
values for c.
ESC[= n g Displays graphic character n.
ESC[= c H Sets reverse foreground color. See GIOATTR for the valid
values for c.
ESC[= c I Sets reverse background color. See GIOATTR for the valid
values for c.
ESC[= c J Sets graphic foreground color. See GIOATTR for the valid
values for c.
ESC[= c K Sets graphic background color. See GIOATTR for the valid
values for c.
ESC[ n z Makes virtual terminal number n active.
ESC 7 Saves cursor position.
10/89 Page 5
display(7) UNIX System V display(7)
ESC 8 Restores cursor position to saved value.
ESC[ 0 k Disables the key-click feature (the default).
ESC[ 1 k Enables the key-click feature. A tone is produced for each
key press.
ioctl Calls
The following ioctl calls may be used to change the display used for the
video monitor. If the virtual terminal has not been put in process mode
(see the VT_SETMODE ioctl), setting the display mode to a non-text mode
will turn off VT switching. VT switches will be re-enabled after the
display mode has been reset to a text mode.
Note: All of the following ioctls are performed on either a file
descriptor to the virtual terminals or to the special file /dev/video.
ioctls to /dev/video are indicated with an asterisk (*). For the ioctls
to /dev/video to work, the controlling tty for the process must be the
virtual terminal on which the operation is to be performed. If the tty
is not a virtual terminal, the return value will be -1 and errno will be
set to EINVAL.
SWAPMONO (*)
This call selects the monochrome adapter as the output device
for the system console.
SWAPCGA (*) This call selects the color/graphics adapter as the output
device for the system console.
SWAPEGA (*) This call selects the enhanced graphics adapter as the output
device for the system console.
SWAPVGA (*) This call selects the video graphics array as the output
device for the system console.
The following ioctl call may be used to obtain more information about the
display adapter currently attached to the video monitor:
CONSCURRENT (*)
This call returns the display adapter type currently attached
to the video monitor. The return value can be one of: MONO,
CGA, or EGA.
The following ioctl calls may be used to switch display modes on the
various video adapters:
SWB40x25 (*)
This call selects 40x25 (40 columns by 25 rows) black and
white text display mode. It is valid only for CGA and EGA
devices.
Page 6 10/89
display(7) UNIX System V display(7)
SWC40x25 (*)
This call selects 40x25 (40 columns by 25 rows) color text
display mode. It is valid only for CGA and EGA devices.
SWB80x25 (*)
This call selects 80x25 (80 columns by 25 rows) black and
white text display mode. It is valid only for CGA and EGA
devices.
SWC80x25 (*)
This call selects 80x25 (80 columns by 25 rows) color text
display mode. It is valid only for CGA and EGA devices.
SWBG320 (*)
This call selects 320x200 black and white graphics display
mode. It is valid only for CGA and EGA devices.
SWCG320 (*)
This call selects 320x200 color graphics display mode. It is
valid only for CGA and EGA devices.
SWBG640 (*)
This call selects 640x200 black and white graphics display
mode. It is valid only for CGA and EGA devices.
SWCG320D (*)
This call selects EGA support for 320x200 graphics display
mode (EGA mode D). It is valid only for EGA devices.
SWCG640E (*)
This call selects EGA support for 640x200 graphics display
mode (EGA mode E). It is valid only for EGA devices.
SWEGAMONOAPA (*)
This call selects EGA support for 640x350 graphics display
mode (EGA mode F). It is valid only for EGA devices.
SWENHMONOAPA2 (*)
This call selects EGA support for 640x350 graphics display
mode with extended memory (EGA mode F*). It is valid only
for EGA devices.
SWCG640x350 (*)
This call selects EGA support for 640x350 graphics display
mode (EGA mode 10). It is valid only for EGA devices.
SWENHCG640 (*)
This call selects EGA support for 640x350 graphics display
mode with extended memory (EGA mode 10*). It is valid only
for EGA devices.
10/89 Page 7
display(7) UNIX System V display(7)
SWEGAMONO80x25 (*)
This call selects EGA monochrome text display mode (EGA mode
7), which emulates support provided by the monochrome
adapter. It is valid only for EGA devices.
SWENHB40x25 (*)
This call selects enhanced 40x25 black and white text display
mode. It is valid only for EGA devices.
SWENHC40x25 (*)
This call selects enhanced 40x25 color text display mode. It
is valid only for EGA devices.
SWENHB80x25 (*)
This call selects enhanced 80x25 black and white display
mode. It is valid only for EGA devices.
SWENHC80x25 (*)
This call selects enhanced 80x25 color text display mode. It
is valid only for EGA devices.
SWENHB80x43 (*)
This call selects enhanced 80x43 black and white text display
mode. It is valid only for EGA devices.
SWENHC80x43 (*)
This call selects enhanced 80x43 color text display mode. It
is valid only for EGA devices.
SWMCAMODE (*)
This call reinitializes the monochrome adapter. It is valid
only for monochrome adapters.
SWATT640 (*)
This call selects 640x400 16 colormode, when an AT&T Super-Vu
video controller is attached.
Switching to an invalid display mode for a display device will result in
an error.
The following ioctls may be used to obtain information about the current
display modes:
CONSGET (*)
This call returns the current display mode setting for
whatever display adapter is being used. Possible return
values include:
M_B40x25 (0), black and white 40 columns. CGA and EGA only.
Page 8 10/89
display(7) UNIX System V display(7)
M_C40x25 (1), color 40 columns. CGA and EGA only.
M_B80x25 (2), black and white 80 columns. CGA and EGA only.
M_C80x25 (3), color 80 columns. CGA and EGA only.
M_BG320 (4), black and white graphics 320 by 200. CGA and
EGA only.
M_CG320 (5), color graphics 320 by 200. CGA and EGA only.
M_BG640 (6), black and white graphics 640 by 200 high-
resolution. CGA and EGA only.
M_EGAMONO80x25 (7), EGA-mono 80 by 25. EGA only.
M_CG320_D (13), EGA mode D.
M_CG640_E (14), EGA mode E.
M_EFAMONOAPA (15), EGA mode F.
M_CG640x350 (16), EGA mode 10.
M_ENHMONOAPA2 (17), EGA mode F with extended memory.
M_ENH_CG640 (18), EGA mode 10*.
M_ENH_B40x25 (19), EGA enhanced black and white 40 columns.
M_ENH_C40x25 (20), EGA enhanced color 40 columns.
M_ENH_B80x25 (21), EGA enhanced black and white 80 columns.
M_ENH_C80x25 (22), EGA enhanced color 80 columns.
M_ENH_B80x43 (0x70), EGA black and white 80 by 43.
M_ENH_C80x43 (0x71), EGA color 80 by 43.
M_MCA_MODE (0xff), monochrome adapter mode.
MCAGET (*) This call returns the current display mode setting of the
monochrome adapter. See CONS_GET for a list of return
values. If the monochrome adapter is not installed, the call
will fail and errno will be set to 22 (EINVAL).
CGAGET (*) This call returns the current display mode setting of the
color/graphics adapter. See CONSGET for a list of return
values. If the color graphics adapter is not installed, the
call will fail and errno will be set to 22 (EINVAL).
10/89 Page 9
display(7) UNIX System V display(7)
EGAGET (*) This call returns the current display mode setting of the
enhanced graphics adapter. See CONSGET for a list of return
values. If the enhanced graphics adapter is not installed,
the call will fail and errno will be set to 22 (EINVAL).
The following ioctl calls may be used to map the video adapter's memory
into the user's data space.
MAPCONS (*) This call maps the display memory of the adapter currently
being used into the user's data space.
MAPMONO (*) This call maps the monochrome adapter's display memory into
the user's data space.
MAPCGA (*) This call maps the color/graphics adapter's display memory
into the user's data space.
MAPEGA (*) This call maps the enhanced graphics adapter's display memory
into the user's data space.
MAPVGA (*) This call maps the video graphics array's display memory into
the user's data space.
You can use ioctl calls to input a byte from the graphics adapter port or
to output a byte to the graphics adapter port. The argument to the ioctl
uses the port_io_arg data structure:
struct portioarg {
struct portiostrucargs[4];
};
As shown in the previous example, the port_io_arg structure points to an
array of four port_io_struc data structures. The port_io_struc has the
following format:
struc portiostruc {
char dir; /*direction flag (in vs. out)*/
unsigned short port;/*port address*/
char data;/*byte of data*/
};
You can specify one, two, three, or four of the port_io_struc structures
in the array for one ioctl call. The value of dir can be either
IN_ON_PORT (to specify a byte being input from the graphics adapter port)
or OUT_ON_PORT (to specify a byte being output to the graphics adapter
port). Port is an integer specifying the port address of the desired
graphics adapter port. Data is the byte of data being input or output as
specified by the call. If you are not using any of the port_io_struc
structures, load the port with 0, and leave the unused structures at the
end of the array. Refer to your hardware manuals for port addresses and
functions for the various adapters.
Page 10 10/89
display(7) UNIX System V display(7)
The following ioctl calls may be used to input or output bytes on the
graphics adapter port:
MCAIO (*) This call inputs or outputs a byte on the monochrome adapter
port as specified.
CGAIO (*) This call inputs or outputs a byte on the color/graphics
adapter port as specified.
EGAIO (*) This call inputs or outputs a byte on the enhanced graphics
adapter port as specified.
VGAIO (*) This call inputs or outputs a byte on the video graphics
array port as specified.
To input a byte on any of the graphics adapter ports, load dir with
IN_ON_PORT and load port with the port address of the graphics adapter.
The byte input from the graphics adapter port will be returned in data.
To output a byte, load dir with OUT_ON_PORT, load port with the port
address of the graphics adapter, and load data with the byte you want to
output to the graphics adapter port.
The following ioctls may be used with either the monochrome, color
graphics, or enhanced graphics adapters:
GIOFONT8x8 (*)
This call gets the current 8x8 font in use.
GIOFONT8x14 (*)
This call gets the current 8x14 font in use.
GIOFONT8x16 (*)
This call gets the current 8x16 font in use.
KDDISPTYPE (*)
This call returns display information to the user. The
argument expected is the buffer address of a structure of
type kd_disparam into which display information is returned
to the user. The kd_disparam structure is defined as
follows:
struct kddisparam {
long type; /*display type*/
char *addr; /*display memory address*/
ushort ioaddr[MKDIOADDR];/*valid I/O addresses*/
}
Possible values for the type field include:
10/89 Page 11
display(7) UNIX System V display(7)
KD_MONO (0x01), for the IBM monochrome display adapter.
KD_HERCULES (0x02), for the Hercules monochrome graphics
adapter.
KD_CGA (0x03), for the IBM color graphics adapter.
KD_EGA (0x04), for the IBM enhanced graphics adapter.
KIOCSOUND (*)
Start sound generation. Turn on sound. The "arg" is the
frequency desired. A frequency of 0 turns off the sound.
KDGETLED Get keyboard LED status. The argument is a pointer to a
character. The character will be filled with a boolean
combination of the following values:
LED_SCR 0x01 ( flag bit for scroll lock )
LED_CAP 0x04 ( flag bit for caps lock )
LED_NUM 0x02 ( flag bit for num lock )
KDSETLED Set keyboard LED status. The argument is a character whose
value is the boolean combination of the values listed under
KDGETLED.
KDMKTONE (*)
Generate a fixed length tone. The argument is a 32 bit
value, with the lower 16 bits set to the frequency and the
upper 16 bits set to the duration (in milliseconds).
KDGKBTYPE Get keyboard type. The argument is a pointer to a character
type. The character will be returned with one of the
following values:
KB_84 0x01 ( 84 key keyboard )
KB_101 0x02 ( 101 key keyboard )
KB_OTHER 0x03
KDADDIO (*)
Add I/O port address to list of valid video adaptor
addresses. Argument is an unsigned short type which should
contain a valid port address for the installed video adaptor.
KDDELIO (*) Delete I/O port address from list of valid video adaptor
addresses. Argument is an unsigned short type which should
contain a valid port address for the installed video adaptor.
KDENABIO (*)
Enable in's and out's to video adaptor ports. No argument.
KDDISABIO (*)
Disable in's and out's to video adaptor ports. No argument.
Page 12 10/89
display(7) UNIX System V display(7)
KDQUEMODE (*)
Enable/Disable special queue mode. Queue mode is used by
AT&T's X-Windows software to establish a shared queue for
access to keyboard and mouse event information. The argument
is a pointer to a structure "kd_quemode". If a NULL pointer
is sent as an argument, the queue will be closed and the mode
disabled. The structure "kd_quemode" is as follows:
struct kdquemode {
int qsize; /* desired # of elements in queue */
int signo; /* signal number to send when queue
goes non-empty */
char *qaddr; /* user virtual address of queue (set by
driver) */
};
KDSBORDER (*)
Set screen color border in EGA text mode. The argument is of
type character. Each bit position corresponds to a color
selection. From bit position 0 to bit position 6, the color
selections are respectively; blue, green, red, secondary
blue, secondary green, and secondary red. Setting the bit
position to a logic one will select the desired color or
colors. See WARNINGS below.
KDSETMODE (*)
Set console in text or graphics mode. The argument is of
type integer, which should contain one of the following
values:
KD_TEXT 0x00 ( sets console to text mode )
KD_GRAPHICS 0x01 ( sets console in graphics mode )
If the mode is set to KD_GRAPHICS and the Virtual Terminal is
not in process mode (see the VT_SETMODE ioctl), no virtual
terminal switches will be possible until the mode is reset to
KD_TEXT, KD_TEXT0, or KD_TEXT1.
Note, the user is responsible for programming the
color/graphics adaptor registers for the appropriate
graphical state.
KDGETMODE (*)
Get current mode of console. Returns integer argument
containing either KDTEXT or KDGRAPHICS as defined in the
KDSETMODE ioctl description.
KDMAPDISP (*)
Maps display memory into user process address space.
Argument is a pointer to structure type "kd_memloc".
Structure definition is as follows:
struct kdmemloc {
char *vaddr; /* virtual address to map to */
char *physaddr; /* physical address to map from */
long length; /* size in bytes to map */
10/89 Page 13
display(7) UNIX System V display(7)
long ioflg; /* enable i/o addresses if set */
}
KDUNMAPDISP (*)
Unmap display memory from user process address space. No
argument required.
KDVDCTYPE This call returns VDC controller/display information.
PIOFONT8x8 (*)
This call uses the user supplied 8x8 font.
PIOFONT8x14 (*)
This call uses the user supplied 8x14 font.
PIOFONT8x16 (*)
This call uses the user supplied 8x16 font.
VTOPENQRY Find an available virtual terminal. The argument is a
pointer to a long. The long will be filled with the number
of the first available "VT" that no other process has open or
-1 if none are available.
VTGETMODE (*)
Determine what mode the active virtual terminal is currently
in, either VTAUTO or VTPROCESS. The argument to the ioctl
is the address of the following type of structure:
struct vtmode {
char mode; /* VT mode */
char waitv; /* if set, hang on writes when not active */
short relsig; /* signal to use for release request */
short acqsig; /* signal to use for display acquired */
short frsig; /* not used set to 0 */
}
#define VTAUTO 0x00 /* automatic VT switching */
#define VTPROCESS 0x01 /* process controls switching */
The "vt_mode" structure will be filled in with the current
value for each field.
VTGETSTATE (*)
The VTGETSTATE ioctl returns global virtual terminal state
information. It returns the active virtual terminal in the
v_active field, and the number of active virtual terminals
and a bit mask of the global state in the vt_state field,
where bit x is the state of vt x (1 indicates that the
virtual terminal is open).
VTSETMODE (*)
Set the virtual terminal mode. The argument is a pointer to
a "vt_mode" structure, as defined above.
Page 14 10/89
display(7) UNIX System V display(7)
VTSENDSIG (*)
The VTSENDSIG ioctl specifies a signal (in vt_signal) to be
sent to a bit mask of virtual terminals (in vt_state).
The data structure used by the VTGETSTATE and VTSENDSIG ioctls is:
struct vtstat {
ushort vactive; /* active vt*/
ushort vsignal; /* signal to send (VTSENDSIG) */
ushort vstate; /* vt bit mask (VTSENDSIG and
VTGETSTATE)*/
};
and is defined in /usr/include/sys/vt.h.
VTRELDISP (*)
Used to tell the virtual terminal manager that the display has or has
not been released by the process. A non-zero argument indicates that
the
display has been released; a zero argument indicates refusal to
release the display.
VTACTIVATE (*)
Makes the virtual terminal number specified in the argument
the active "VT". The "VT" manager will cause a switch to
occur in the same manner as if a hotkey sequence had been
typed at the keyboard. If the specified "VT" is not open or
does not exist, the call will fail and errno will be set to
ENXIO.
KIOCINFO This call tells the user what the device is.
GIOSCRNMAP (*)
This call gets the screen mapping table from the kernel.
GIOATTR This call returns the current screen attribute. The bits are
interpreted as follows:
Bit 0 determines underlining for black and white monitors
(1=underlining on).
Bits 0-2, for color monitors only, select the foreground
color. The following list indicates what colors are selected
by the given value:
The value 0 selects black.
The value 1 selects red.
The value 2 selects green.
The value 3 selects brown.
The value 4 selects blue.
The value 5 selects magenta.
The value 6 selects cyan.
The value 7 selects white.
10/89 Page 15
display(7) UNIX System V display(7)
Bit 3 is the intensity bit ( 1=blink on).
Bits 4-6, for color monitors only, select the background
color. For a list of colors and their values, see the list
under foreground colors.
Bit 7 is the blink bit (1=blink on).
GIOCOLOR (*)
This call returns a non-zero value if the current display is
a color display, otherwise, it returns a zero.
PIOSCRNMAP This call puts the screen mapping table in the kernel.
The screen mapping table maps extended ASCII (8-bit) characters to ROM
characters. It is an array [256] of char (typedef scrnmap_t) and is
indexed by extended ASCII values. The value of the elements of the array
are the ROM character to display.
For example, the following will change the ASCII character `#' to be
displayed as an English pound sign.
#include <sys/console.h>
changepound() {
scrnmapt scrntab;
/*get screen mapping table of standard output*/
if (ioctl(0,GIOSCRNMAP, scrntab)==-1)
{
perror("screenmap read");
exit(-1);
}
/*156 is the ROM value of English pound sign and 30
is the ASCII value of `#'. */
scrntab[30] = 156;
if (ioctl(0, PIOSCRNMAP, scrntab) == -1)
{
perror("screenmap write");
exit(-1);
}
}
FILES
/dev/console
/dev/vt00-n
/dev/video
/usr/include/sys/kd.h
SEE ALSO
stty(1), console(7), keyboard(7), termio(7)
ioctl(2) in the Programmer's Reference Manual.
Page 16 10/89
display(7) UNIX System V display(7)
NOTES
Although it is possible to write character sequences which set arbitrary
bits on the screen in any of the three graphics modes, this mode of
operation is not currently supported.
Enable/disable of the underscore option using "ESC[38m" and "ESC[39m" are
operative only when the AT&T Rite-Vu color/graphics video adaptor is
installed, or else the underscore option is unsupported as the default
for all other color/graphics adaptors. Monochrome adaptors support
underscore option as the default. After "ESC[38m" has enabled underline
and until "ESC[39m" has disabled underline all characters with blue
attributes will appear as cyan.
It is currently not possible to access the 6845 start address registers.
Thus, it is impossible to determine the beginning of the color monitor's
screen memory.
The alternate/background color bit (bit 4) of the color select register
does not appear to affect background colors in alphanumeric modes.
KDSBORDER ioctl calls will not work with AT&T's Super-Vu enhanced
color/graphics video adaptor. It will however, work with the IBM EGA
card and other EGA compatible video adaptors.
The low-resolution graphics mode appears to be 80 across by 100 down.
10/89 Page 17