[Previous] [Contents] [Index] [Next]

devc-con, devc-tcon

Simple console and keyboard I/O manager (QNX Neutrino)


Note: You must be root to start this manager.

Syntax:

devc-con [options] &

devc-tcon [options] &

Runs on:

All supported platforms.

Options:

-C size
Specify the size of the canonical buffer in bytes (default 256).
-E
Start in raw mode.
-e
Start in edited mode (the default).
-I size
Specify the size of the interrupt input buffer in bytes (default 2048).
-k
(devc-con only) Disable keyboard (don't attach a keyboard interrupt handler).
-L [P][N][C][S]
Set the initial state of the keyboard and its LEDs (default all off):
-n num_ports
(devc-con only) The number of virtual console ports to create. The default is 4; the maximum is 9.
-O size
Specify the size of the interrupt output buffer in bytes (default 2048).
-r rate[,delay]
Specify the initial keyboard typematic rate (in Hz) and, optionally, the initial keyboard delay (in ms). The default values are 30 Hz and 500 ms.

The keyboard typematic rate is the number of times per second that a depressed key repeats. On a PC/AT-compatible system, this ranges from 2 - 30 characters per second. If the option -r 0 is specified, the keyboard typematic rate isn't set by the driver.

The keyboard delay is defined as the time from when a key is first pressed to when the start of the first repeated key is generated. On a PC/AT-compatible system, the keyboard delay can range from 250 - 1000 milliseconds.

Description:

The devc-con manager provides an interface to the console screen and keyboard. It's usually started as a system startup procedure (see diskboot). When devc-con starts, it creates and manages the devices /dev/con1, /dev/con2, and so on, up to the number of ports specified by the -n option.

The devc-tcon manager is a "tiny" implementation of devc-con that's intended for memory-constrained systems. It doesn't support special character editing (e.g. toggling insert mode, special erase characters). When devc-tcon starts, it creates and manages only the device /dev/con1.

The devc-con manager reads from /dev/console return characters typed on the keyboard and writes output to the screen.


Note: If your application uses /dev/console, you should create a link from it to one of /dev/con1, /dev/con2, ... by adding a line like this to the buildfile used by mkifs:
[type=link] /dev/console = /dev/con1

Both devc-con and devc-tcon emulate an 80*25 ANSI terminal. However, devc-tcon supports only a small subset of the full ANSI control codes.

Keyboard control

You can use the keyboard to switch between virtual consoles.

Each virtual console can run different applications that use the entire screen. The keyboard is attached to the virtual console that's currently visible. You can switch from one virtual console to another -- and thus from one application to another -- by entering the following keychords:

If you want to see: Press:
the next active console Ctrl-Alt-Enter or
Ctrl-Alt-+ (plus)
the previous active console Ctrl-Alt-- (minus)

Note: The + (plus) and - (minus) keys used in the console-switching keychords are those found on the numeric keypad.

You can also jump to a specific console by using the Ctrl-Alt-n, where n is a numeric digit that represents the console number of a virtual console. For instance:

If you want to see: Press:
/dev/con1 Ctrl-Alt-1
/dev/con2 (if available) Ctrl-Alt-2
... ...
/dev/con10 (if available) Ctrl-Alt-0

Character sets

The devc-con driver allows the character sets in use to be chosen from a "palette" of character sets, each of which is independently programmable to contain one of several builtin character sets.

The in-use range of characters is divided into four regions which span character numbers (in hexadecimal) 0x00 through 0xff. Two of these regions are fixed sets of control characters, while the other two are configurable to contain a choice of character sets:

Hex: Name: May be set to one of:
0x00-0x1f C0 (Control Zero) Not configurable
0x20-0x7f GL (Graphics Left) G0, G1, G2, G3
0x80-0x9f C1 (Control One) Not configurable
0xa0-0xff GR (Graphics Right) G1, G2, G3

You can set each of the GL and GR in-use character sets to a choice of several character sets from the G0, G1, G2 and G3 character sets.

The screen control codes to set GL and GR are as follows:

To set: To: Use:
GL G0 {LS0} = {SI} (0f)
GL G1 {LS1} = {SO} (0e)
GL G2 {LS2} = {ESC n} (1b 6e) or {SS2} (8e)
GL G3 {LS3} = {ESC o} (1b 6f) or {SS3} (8f)
GR G1 {LS1R}= {ESC ~} (1b 7e)
GR G2 {LS2R}= {ESC }} (1b 7d)
GR G3 {LS3R}= {ESC |} (1b 7c)

The {LS*} codes stand for "Locking Shift". When character sets are selected by these means, they remain in effect until another {LS*} code is sent.

The {SS*} codes stand for "Single Shift" and affect the next character only. After that character, the character set in effect reverts to its previous setting. There are only two {SS*} codes, {SS2} and {SS3} which maps G2 into GL and G3 into GL, respectively.

The G0 through G3 characters sets may each be set to any of the available builtin fonts. The control code to do this is:

   ESC g s

Where:

g: Sets:
( G0
) G1
* G2
+ G3

And:

s: Specifies:
B ASCII
0 Special (DEC Graphic)
< ISO-Latin1 Supplemental
U PC Character Set

Character set defaults

The in-use character sets are as follows:

In-use char set: Defaults to:
GR G2
GL G0

The character set codes are as follows:

Char set: Defaults to:
G0 ASCII charset
G1 Special charset (DEC Graphic)
G2 Supplemental charset (ISO-Latin 1)
G3 Special charset (DEC Graphic)

Character set example:

Set the GL in-service character set (0x20-0x7f) to the PC character set through G1, write some characters, then switch GL back to G0:

{ESC )U}  1e 29 55    (Set G1 to be the PC character set)
{SO}      0e          (Set GL to G1)
.
.                     (Write chars in PC graphics char set)
.
{SI}      0f          (Set GL to G0)

[PC character set 0x00-0x7f]


The PC character set 0x00-0x7f.



[PC character set 0x80-0xff]


The PC character set 0x80-0xff.


ANSI screen control codes


Note:

Note the following abbreviations used in the tables:

(220+)
A VT220 Level 2 function
(NA)
Not ANSI standard
(NI)
Not implemented
(NFI)
Not fully implemented

C0 control codes

The C0 control codes are as follows:

ASCII ANSI Mnemonic Hex Action
{NUL} 00 Null
{BEL} 07 Bell
{BS} 08 Back Space (VT100 defaults to no wrap from left margin)
{HT} 09 Horizontal Tab (VT100 defaults to no autowrap)
{LF} 0A Linefeed or Newline
{VT} 0B Same as LF
{FF} 0C Clears Screen (QNX Extension)
{CR} 0D Move cursor to left margin
{SO} {LS1} 0E GL is set to G1
{SI} {LS0} 0F GL is set to G0 (default)
{XON} {DC1} 11 XON
{XOFF} {DC0} 13 XOFF
{CAN} 18 Cancels ESC sequence
{SUB} 1A Cancels ESC sequence and prints ?
{ESC} 1B Start of ESC sequence
{DEL} 7F Ignored on output

ESC control sequences

The ESC control sequence codes are as follows:

String Hex Action
{ESC 7} 1B 37 Save cursor
{ESC 8} 1B 38 Restore cursor
{ESC =} 1B 3D Set application keypad mode
{ESC >} 1B 3E Set numeric keypad mode (default)
{ESC D} 1B 44 7-bit codes for {IND} (84)
{ESC E} 1B 45 7-bit codes for {NEL} (85)
{ESC H} 1B 48 7-bit codes for {HTS} (88)
{ESC M} 1B 4D 7-bit codes for {RI} (8D)
{ESC N} 1B 4E 7-bit codes for {SS2} (8E)
{ESC O} 1B 4F 7-bit codes for {SS3} (8F)
{ESC P} 1B 50 7-bit codes for {DCS} (90)
{ESC [} 1B 5B 7-bit codes for {CSI} (9B)
{ESC \} 1B 5C 7-bit codes for {ST} (9C)
{ESC ]} 1B 5D 7-bit codes for {OSC} (9D)
{ESC ^} 1B 5E 7-bit codes for {PM} (9E)
{ESC _} 1B 5F 7-bit codes for {APC} (9F)
{ESC Z} 1B 5A Identify terminal
{ESC c} 1B 63 Hard Reset (clears screen) (use {CSI ! P} for soft reset)
{ESC n} 1B 6E (LS2) GL is set to G2 (220+)
{ESC o} 1B 6F (LS3) GL is set to G3 (220+)
{ESC |} 1B 7C (LS3R) GR is set to G3 (220+)
{ESC }} 1B 7D (LS2R) GR is set to G2 (220+) (default)
{ESC ~} 1B 7E (LS1R) GR is set to G1
{ESC sp F} 1B 20 46 Keyboard generates 7-bit C1 codes (incl. CSI) (default)
{ESC sp G} 1B 20 47 keyboard generates 8-bit C1 codes (incl. CSI) (220+)
{ESC ( 0} 1B 28 30 Set G0 to special charset
{ESC ( <} 1B 28 3C Set G0 to supplemental charset
{ESC ( A} 1B 28 41 Set G0 to U.K. charset (Not implemented; same as ASCII)
{ESC ( B} 1B 28 42 Set G0 to ASCII charset (default)
{ESC ( U} 1B 28 55 Set G0 to PCterm graphics
{ESC ) 0} 1B 29 30 Set G1 to special charset (default)
{ESC ) <} 1B 29 3C Set G1 to supplemental charset
{ESC ) A} 1B 29 41 Set G1 to U.K. charset (NI; same as ASCII)
{ESC ) B} 1B 29 42 Set G1 to ASCII charset
{ESC ) U} 1B 29 55 Set G1 to PCterm graphics
{ESC * 0} 1B 2A 30 Set G2 to special charset (220+)
{ESC * <} 1B 2A 3C Set G2 to supplemental charset (220+) (default)
{ESC * B} 1B 2A 42 Set G2 to ASCII charset (220+)
{ESC * U} 1B 2A 55 Set G2 to PCterm graphics
{ESC + 0} 1B 2B 30 Set G3 to special charset (220+) (default)
{ESC + <} 1B 2B 3C Set G3 to supplemental charset (220+)
{ESC + B} 1B 2B 42 Set G3 to ASCII charset (220+)
{ESC + U} 1B 2B 55 Set G3 to PCterm graphics

C1 control characters (220+)


Note:

You can do any 8-bit C1 code with 7-bit ESC followed by the 8-bit code minus 0x40 hex. For instance, you can represent the CSI (control sequence introducer) in 8-bit mode as 0x9b, while in 7-bit mode you must express it as ESC [ (0x1b 0x5b).


The C1 control character codes are as follows:

ASCII Hex Action
{IND} 84 move cursor down with scroll
{NEL} 85 move to left margin on next line with scroll
{HTS} 88 Set horizontal tab
{RI} 8D move cursor up with scroll
{SS2} 8E GL is set to G2 for 1 character
{SS3} 8F GL is set to G3 for 1 character
{DCS} 90 Start of Device control string
{CSI} 9B Control sequence introducer
{ST} 9C End of Device control string
{OSC} 9D Operating System Command
{PM} 9E Privacy Message
{APC} 9F Application Program Command

CSI control sequences


Note:

In 7-bit mode, CSI is ESC [. In 8-bit mode, CSI is (hex)0x9B. Use the ANSI specification to represent the variable n, e.g. to print two spaces:

printf( "%c%c", 0x9b, 0x32 ) ;

The CSI control sequence codes are as follows:

ASCII Hex Action
{CSI [n] @} 9B [n] 40 Insert n spaces at cursor (default = 1 space)
{CSI [n] A} 9B [n] 41 Cursor up n rows, no wrap (default = 1 row)
{CSI [n] B} 9B [n] 42 Cursor down n rows, no wrap (default = 1 row)
{CSI [n] C} 9B [n] 43 Cursor right n columns, no wrap (default = 1 column)
{CSI [n] D} 9B [n] 44 Cursor left n columns, no wrap (default = 1 column)
{CSI [n] F} 9B [n] 46 Cursor up n rows, positioned in first column (default = 1 row)
{CSI [n] G} 9B [n] 47 Move cursor to column n (default = column 1)
{CSI [r[;c]] H} 9B [r [3B c]] 48 Cursor position (default = row 1; column 1)
{CSI [n] J} 9B [n] 4A Erase 0=cur-EOS 1=HOME-cur 2=screen (default = 0 (to end of screen))
{CSI [n] K} 9B [n] 4B Erase 0=cur-EOL 1=BOL-cur 2=line (default = 0 (to end of line))
{CSI [n] L} 9B [n] 4C Insert n lines (default = 1 line)
{CSI [n] M} 9B [n] 4D Delete n lines (default = 1 line)
{CSI [n] P} 9B [n] 50 Delete n chars (default = 1 char)
{CSI [n] S} 9B [n] 53 Scroll forward n lines (default = 1 line)
{CSI [n] T} 9B [n] 54 Scroll backward n lines (default = 1 line)
{CSI [n] X} 9B [n] 58 Erase cur for n-1 chars (default = 1 (0 chars))
{CSI Z} (9B 5A) Back tab
{c CSI [n] b} c 9B [n] 62 Repeat GR or GL character c, n times. c is the last displayable character; n defaults to 1 time.
{CSI 0 c} (9B 30 63) Primary device attrib request
{CSI [n] d} 9B [n] 64 Move cursor to line n (default = line 1)
{CSI [n] g} 9B [n] 67 Tab clear 0=cursor 2=all (default = 0)
{CSI [n[;n]...] h} 9B [n[3B n]...] 68 Standard Set mode (See modes table) (default=none)
{CSI ? [n[;n]...] h} 9B 3F [n[3B n]...] 68 Private Set mode (See modes table) (default=none)
{CSI [n[;n]...] l} 9B [n[3B n]...] 6C Standard Reset mode (See modes table) (default=none)
{CSI ? [n[;n]...] l} 9B 3F [n[3B n]...] 6C Private Reset mode (See modes table) (default=none)
{CSI [n[;n]...] m} 9B [n[3B n]...] 6D Select Graphic Rendition (See below) (default = 0)
{CSI n n} 9B n 6E Device status 5=status 6=cursor/pos
{CSI [r[;c]] r} 9B [r [3B c]] 72 Set scroll region and home cursor
{CSI r} 9B 72 Disable scroll region & home cursor
{CSI s} 9B 73 Save cursor
{CSI u} 9B 75 Restore cursor
{CSI ! p} 9B 21 70 Soft reset
{CSI [n[;n]] ]} 9B [n [3B n]...] 5D Set default 1=underline 2=half-intensity 8=colorset (default=none)
{CSI = [f [;d]] B} 9B 3D [f [3B d]] 46 Set frequency(Hz) and duration (ms) for bell (default=100Hz, 250ms)
{CSI = [n] F} 9B 3D [n] 46 Set and Save foreground color
{CSI = [n] G} 9B 3D [n] 47 Set and Save background color

Graphic rendition

The graphic rendition codes are as follows:

Number Meaning
0 All attributes off (except charset (10, 11, 12))
1 Bold
2 Half intensity (default to cyan on color screen)
4 Underline (default to red on color screen)
5 Blink
7 Reverse
9 Invisible
10 Exit alternate char set (GR & GL are restored)
11 Enter PC-lower char set (GR & GL are ASCII; C0 & C1 are PC_LO except for ESC)
12 Enter PC-higher char set (GR, C1 & GL, C0 are PC_HI except for ESC)
21 Normal intensity (un-Bold)
22 Normal intensity (un-Half intensity)
24 Disable underline
25 Disable blink
27 Disable reverse
29 Visible
30-37 Set foreground color (30+color_number, see below)
39 set foreground to saved
40-47 Set background color (40+color_number, see below)
49 set background to saved

Color numbers

The color codes are as follows:

color_number Description
0 Black
1 Red
2 Green
3 Brown
4 Blue
5 Violet
6 Cyan
7 White

Modes

Modes are as follows:

Mode string Description
?1h cursor key = Application
?1l cursor key = ANSI (default)
?3h 132 column (Not Implemented)
?3l 80 column (default)
?5h Reverse screen
?5l Not Reverse screen (default)
?6h Origin mode
?6l Absolute mode
?7h Auto wrap on
?7l Auto wrap off (default)
?25h Visible cursor (default)
?25l Invisible cursor
?45h Reverse wrap-around mode
?45l No reverse wrap-around
?66h keypad = Application
?66l keypad = ANSI
?67h Backspace key generates BS
?67l Backspace key generates DEL

Mapping from QNX keyboard to ANSI keys

The ANSI key mapping codes are as follows:

Key Normal Shift Ctrl Alt
Enter CR CR CR CR
Tab TAB CSI Z CSI z
BS BS RUB RUB BS
ESC ESC ESC ESC ESC
F1 SS3 P SS3 p CSI 1~ CSI 17~
F2 SS3 Q SS3 q CSI 2~ CSI 18~
F3 SS3 R SS3 r CSI 3~ CSI 19~
F4 SS3 S SS3 s CSI 4~ CSI 20~
F5 SS3 T SS3 t CSI 5~ CSI 21~
F6 SS3 U SS3 u CSI 6~ CSI 22~
F7 SS3 V SS3 v CSI 7~ CSI 23~
F8 SS3 W SS3 w CSI 8~ CSI 24~
F9 SS3 X SS3 x CSI 9~ CSI 25~
F10 SS3 Y SS3 y CSI 10~ CSI 26~
F11 SS3 Z SS3 z CSI 11~ CSI 27~
F12 SS3 A SS3 a CSI 12~ CSI 28~
Home CSI H CSI h CSI H
/\ CSI A CSI a CSI A
PgUp CSI V CSI v CSI V
Minus CSI S CSI s CSI S
<-- CSI D CSI d CSI D
kpd 5 CSI G CSI g CSI G
--> CSI C CSI c CSI C
Plus CSI T CSI t CSI T
End CSI Y CSI y CSI Y
\/ CSI B CSI b CSI B
PgDn CSI U CSI u CSI U
Ins CSI @ CSI ` CSI @
Del CSI P CSI p CSI P
Prt NOP NOP NOP NOP
SysRq NOP NOP NOP NOP
a a A SOH SS2 a
b b B STX SS2 b
c c C ETX SS2 c
d d D EOT SS2 d
e e E ENQ SS2 e
f f F ACK SS2 f
g g G BEL SS2 g
h h H BS SS2 h
i i I HT SS2 i
j j J LF SS2 j
k k K VT SS2 k
l l L FF SS2 l
m m M CR SS2 m
n n N SO SS2 n
o o O SI SS2 o
p p P DLE SS2 p
q q Q DC1 SS2 q
r r R DC2 SS2 r
s s S DC3 SS2 s
t t T DC4 SS2 t
u u U NAK SS2 u
v v V SYN SS2 v
w w W ETB SS2 w
x x X CAN SS2 x
y y Y EM SS2 y
z z Z SUB SS2 z

Examples:

Typical command line:

devc-con -n4

Files:

/dev/con1, /dev/con2, ...
console port devices
devc-con
the devc-con program is normally to be found in /sbin.

Errors:

If an error occurs in devc-con, the keyboard will not work in text mode.

See also:

Using the Command Line and Controlling How Neutrino Starts in the Neutrino User's Guide


[Previous] [Contents] [Index] [Next]