xref: /freebsd/share/man/man4/syscons.4 (revision 77a0943ded95b9e6438f7db70c4a28e4d93946d4)
1.\"
2.\" Copyright (c) 1999
3.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer as
11.\"    the first lines of this file unmodified.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd June 30, 1999
30.Dt SYSCONS 4
31.Os FreeBSD
32.Sh NAME
33.Nm syscons ,
34.Nm sc
35.Nd
36the console driver
37.Sh SYNOPSIS
38.Cd "options MAXCONS=N"
39.Cd "options SC_ALT_MOUSE_IMAGE"
40.Cd "options SC_DISABLE_DDBKEY"
41.Cd "options SC_DISABLE_REBOOT"
42.Cd "options SC_HISTORY_SIZE=N"
43.Cd "options SC_MOUSE_CHAR=C"
44.Cd "options SC_NO_CUTPASTE"
45.Cd "options SC_NO_FONT_LOADING"
46.Cd "options SC_NO_HISTORY"
47.Cd "options SC_NO_PALETTE_LOADING"
48.Cd "options SC_NO_SYSMOUSE"
49.Cd "options SC_PIXEL_MODE"
50.Cd "options SC_TWOBUTTON_MOUSE
51.Cd "options SC_NORM_ATTR=_attribute_"
52.Cd "options SC_NORM_REV_ATTR=_attribute_"
53.Cd "options SC_KERNEL_CONS_ATTR=_attribute_"
54.Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_"
55.Cd "options SC_DFLT_FONT"
56.Cd "makeoptions SC_DFLT_FONT=_font_name_"
57.Cd "device sc0 at isa?" Op flags Ar flags
58.Sh DESCRIPTION
59The
60.Nm
61driver provides multiple virtual terminals.
62It resembles the SCO color console driver.
63.Pp
64The
65.Nm
66driver is implemented on top of the keyboard driver
67.Pq Xr atkbd 4
68and the video card driver
69.Pq Xr vga 4
70and so requires both of them to be configured in the system.
71.Pp
72There can be only one
73.Nm
74device defined in the system.
75.Ss Virtual Terminals
76The
77.Nm
78driver provides multiple virtual terminals which appear as if they were
79separate terminals.
80One virtual terminal is considered current and exclusively
81occupies the screen and the keyboard; the other virtual terminals
82are placed in the background.
83.Pp
84In order to use virtual terminals, they must be individually
85marked ``on'' in
86.Pa /etc/ttys
87so that
88.Xr getty 8
89will recognize them to be active and run
90.Xr login 1
91to let the user to login to the system.
92By default, only the first eight virtual terminals are activated in
93.Pa /etc/ttys .
94.Pp
95You press the
96.Dv Alt
97key and a switch key to switch between
98virtual terminals.
99The following table summarizes the correspondence between the switch
100key and the virtual terminal.
101.Bd -literal -offset indent
102Alt-F1   ttyv0      Alt-F7   ttyv6      Shift-Alt-F1   ttyv10
103Alt-F2   ttyv1      Alt-F8   ttyv7      Shift-Alt-F2   ttyv11
104Alt-F3   ttyv2      Alt-F9   ttyv8      Shift-Alt-F3   ttyv12
105Alt-F4   ttyv3      Alt-F10  ttyv9      Shift-Alt-F4   ttyv13
106Alt-F5   ttyv4      Alt-F11  ttyv10     Shift-Alt-F5   ttyv14
107Alt-F6   ttyv5      Alt-F12  ttyv11     Shift-Alt-F6   ttyv15
108.Ed
109.Pp
110You can also use the ``nscr'' key (usually the
111.Dv PrintScreen
112key on the AT Enhanced keyboard) to cycle available virtual terminals.
113.Pp
114The default number of available virtual terminals is 16.
115This can be changed by the kernel configuration option
116.Dv MAXCONS
117(see below).
118.Pp
119Note that the X server usually requires a virtual terminal for display
120purposes, so at least one terminal must be left unused by
121.Xr getty 8
122so that it can be used by the X server.
123.Ss Key Definitions and Function Key Strings
124The
125.Nm
126driver, in conjunction with the keyboard driver, allows the user
127to change key definitions and function key strings.
128The
129.Xr kbdcontrol 1
130command will load a key definition file (known as ``keymap'' file),
131dump the current keymap, and assign a string to a function key.
132See
133.Xr keyboard 4
134and
135.Xr kbdmap 5
136for the keymap file.
137.Pp
138You may want to set the
139.Ar keymap
140variable in
141.Pa /etc/rc.conf.local
142to the desired keymap file so that it will be automatically loaded
143when the system starts up.
144.Ss Software Font
145For most modern video cards, e.g. VGA, the
146.Nm
147driver and the video card driver allow the user to change
148the font used on the screen.
149The
150.Xr vidcontrol 1
151command can be used to load a font file from
152.Pa /usr/share/syscons/fonts .
153.Pp
154The font comes in various sizes: 8x8, 8x14 and 8x16.
155The 8x16 font is typically used for the VGA card in the 80-column-
156by-25-line mode.
157Other video modes may require different size of font.
158It is better to always load these three sizes of the same font.
159.Pp
160You may set
161.Ar font8x8 ,
162.Ar font8x14
163and
164.Ar font8x16
165variables in
166.Pa /etc/rc.conf.local
167to the desired font files so that they will be automatically loaded
168when the system starts up.
169.Pp
170Optionally you can make a particular font file as the default font.
171See the
172.Dv SC_DFLT_FONT
173option below.
174.Ss Screen Map
175If your video card does not support software font, you may still be able
176to have similar effect by re-mapping font hard-wired in the video card.
177Use
178.Xr vidcontrol 1
179to load a screen map file which defines mapping between character codes.
180.Ss Mouse Support and Copy-and-Paste
181You can use your mouse to copy text on the screen and paste it as if
182it is typed by hand.
183You must be running the mouse daemon
184.Xr moused 8
185and enable the mouse cursor in the virtual terminal via
186.Xr vidcontrol 1 .
187.Pp
188Pressing the mouse button 1 (usually the left button) will start selection.
189Releasing the button 1 will end the selection process.
190The selected text will be marked by inverting foreground and
191background colors.
192You can press the button 3 (usually the right button) to extend
193the selected region.
194The selected text is placed in the copy buffer and can be pasted
195at the cursor position by your pressing the button 2 (usually the
196middle button) as many times as you like.
197.Pp
198If your mouse has only two buttons, you may want to use the
199.Dv SC_TWOBUTTON_MOUSE
200option below to make the right button to paste the text.
201Alternatively you can make the mouse daemon
202to emulate the middle button.
203See the man page for
204.Xr moused 8
205for more details.
206.Ss Back Scrolling
207The
208.Nm
209driver allows the user to browse the output which has ``scrolled off''
210from the top of the screen.
211.Pp
212Press the ``slock'' key (usually
213.Dv ScrllLock
214and/or
215.Dv Pause
216keys on many AT Enhanced keyboards) and the terminal is
217in the ``back scrolling'' mode.
218It is indicated by the
219.Dv Scroll Lock
220LED.
221Use arrow keys,
222.Dv Page Up/Down
223keys and
224.Dv Home/End
225keys to scroll buffered terminal output.
226Press the ``slock'' key again to get back to the normal terminal mode.
227.Pp
228The size of the back-scroll buffer can be set by the
229.Dv SC_HISTORY_SIZE
230option below.
231.Ss Screen Saver
232The
233.Nm
234driver can be made to put up the screen saver if the current
235virtual terminal is idle, that is, the user is not typing
236on the keyboard nor moving mouse.
237See
238.Xr splash 4
239and
240.Xr vidcontrol 1
241for more details.
242.Sh DRIVER CONFIGURATION
243.Ss Kernel Configuration Options
244The following kernel configuration options control the
245.Nm
246driver.
247.Bl -tag -width MOUSE
248.It Dv MAXCONS=N
249This option sets the number of virtual terminals to
250.Fa N .
251The default value is 16.
252.It Dv SC_ALT_MOUSE_IMAGE
253This option selects the alternative way of displaying the mouse cursor
254in the virtual terminal.
255It may be vastly costly for some video cards to draw the arrow-shaped
256cursor and you may want to try this option.
257However, the appearance of the alternative mouse cursor may not be
258very appealing.
259Note that if you use the
260.Dv SC_NO_FONT_LOADING
261option then you must also use this option if you wish to be able to use
262the mouse.
263.It Dv SC_DISABLE_DDBKEY
264This option disables the ``debug'' key (by default, it is
265.Dv Alt-Esc ,
266or
267.Dv Ctl-PrintScreen
268).
269It will prevent the user from
270entering the kernel debugger DDB by pressing the key combination.
271DDB will still be invoked when the kernel panics or hits a break point
272if it is included in the kernel.
273.It Dv SC_DISABLE_REBOOT
274This option disables the ``reboot'' key (by default, it is
275.Dv Ctl-Alt-Del
276), so that the casual user may not accidentally reboot the system.
277.It Dv SC_HISTORY_SIZE=N
278Sets the size of back scroll buffer to
279.Fa N
280lines.
281The default value is 100.
282.It Dv SC_MOUSE_CHAR=C
283Unless the
284.Dv SC_ALT_MOUSE_IMAGE
285option above is specified, the
286The
287.Nm
288driver reserves four consecutive character codes in order to display the
289mouse cursor in the virtual terminals in some systems.
290This option specifies the first character code to
291.Fa C
292to be used for this purpose.
293The default value is 0xd0.
294A good candidate is 0x03.
295.It Dv SC_PIXEL_MODE
296Adds support for pixel (raster) mode console.
297This mode is useful on some laptop computers, but less so on
298most other systems, and it adds substantial amount of code to syscons.
299If the this option is NOT defined, you can reduce the kernel size a lot.
300See the
301.Dv VESA800X600
302flag below.
303.It Dv SC_TWOBUTTON_MOUSE
304If you have a two button mouse, you may want to add this option
305to use the right button of the mouse to paste text.
306See
307.Sx Mouse Support and Copy-and-Paste
308above.
309.It Dv SC_NORM_ATTR=_attribute_
310.It Dv SC_NORM_REV_ATTR=_attribute_
311.It Dv SC_KERNEL_CONS_ATTR=_attribute_
312.It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
313These options will set the default colors.
314Available colors are defined in
315.Pa /usr/include/machine/pc/display.h .
316See
317.Sx EXAMPLES
318below.
319.It Dv SC_DFLT_FONT
320This option will specify the default font.
321Available fonts are: iso, iso2, koi8-r, cp437, cp850, cp865 and cp866.
32216-line, 14-line and 8-line font data will be compiled in.
323Without this option, the
324.Nm
325driver will use whatever font already loaded in the video card,
326unless you explicitly load software font at startup.
327See
328.Sx EXAMPLES
329below.
330.El
331.Pp
332The following options will remove some features from the
333.Nm
334driver and save kernel memory.
335.Bl -tag -width MOUSE
336.It Dv SC_NO_CUTPASTE
337This option disables ``copy and paste'' operation in virtual
338terminals.
339.It Dv SC_NO_FONT_LOADING
340The
341.Nm
342driver can load software font on some video cards.
343This option removes this feature.
344Note that if you still wish to use
345the mouse with this option then you must also use the
346.Dv SC_ALT_MOUSE_IMAGE
347option.
348.It Dv SC_NO_HISTORY
349This option disables back-scrolling in virtual terminals.
350.\".It Dv SC_NO_PALETTE_LOADING
351.It Dv SC_NO_SYSMOUSE
352This option removes mouse support in the
353.Nm
354driver.
355The mouse daemon
356.Xr moused 8
357will fail if this option is defined.
358This option implies the
359.Dv SC_NO_CUTPASTE
360option too.
361.El
362.Ss Driver Flags
363The following driver flags can be used to control the
364.Nm
365driver.
366They can be set either in the kernel configuration file
367.Pq see Xr config 8 ,
368or else in the User Configuration Menu at boot
369time
370.Pq see Xr boot 8 .
371.Bl -tag -width bit_0
372.\".It bit 0 (VISUAL_BELL)
373.\"Uses the ``visual'' bell.
374.\"The screen will blink instead of generating audible sound.
375.\".It bit 1,2 (CURSOR_TYPE)
376.\"This option specifies the cursor appearance.
377.\"Possible values are:
378.\".Bl -tag -width TYPE -compact
379.\".It Dv 0
380.\"normal block cursor
381.\".It Dv 2
382.\"blinking block cursor
383.\".It Dv 4
384.\"underline cursor
385.\".It Dv 6
386.\"blinking underline (aka destructive) cursor
387.\".El
388.\".It bit 6 (QUIET_BELL)
389.\"This option suppresses the bell, whether audible or visual,
390.\"if it is rung in a background virtual terminal.
391.It 0x0080 (VESA800X600)
392This option puts the video card in the VESA 800x600 dots, 16 color
393mode.
394It may be useful for laptop computers for which the 800x600 mode
395is otherwise unsupported by the X server.
396Note that in order for this flag to work, the kernel must be
397compiled with the
398.Dv SC_PIXEL_MODE
399option explained above.
400.\"Note also that the ``copy-and-paste'' function is not currently supported
401.\"in this mode and the mouse pointer will not be displayed.
402.It 0x0100 (AUTODETECT_KBD)
403This option instructs the syscons driver to periodically scan
404for a keyboard device if it is not currently attached to one.
405Otherwise, the driver only probes for a keyboard once during bootup.
406.El
407.Sh FILES
408.Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
409.It Pa /dev/console
410.It Pa /dev/consolectl
411.It Pa /dev/ttyv?
412virtual terminals
413.It Pa /etc/ttys
414terminal initialization information
415.It Pa /usr/share/syscons/fonts/*
416font files
417.It Pa /usr/share/syscons/keymaps/*
418key map files
419.It Pa /usr/share/syscons/scrmaps/*
420screen map files
421.El
422.Sh EXAMPLES
423As the
424.Nm
425driver requires the keyboard driver and the video card driver,
426the kernel configuration file should contain the following lines.
427.Pp
428.Bd -literal -offset indent
429device atkbdc0 at isa? port IO_KBD
430device atkbd0 at atkbdc? irq 1
431device vga0 at isa? conflicts
432device sc0 at isa?
433
434pseudo-device splash
435.Ed
436.Pp
437If you do not intend to load the splash image or use the screen saver,
438the last line is not necessary, and can be omitted.
439.Pp
440Note that the keyboard controller driver
441.Nm atkbdc
442is required by the keyboard driver
443.Nm atkbd .
444.Pp
445The following lines will set the default colors.
446The normal text will be green on black background.
447The reversed text will be yellow on green background.
448Note that you cannot put any white space inside the quoted string,
449because of the current implementation of
450.Xr config 8 .
451.Pp
452.Dl "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)
453.Dl "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)
454.Pp
455The following lines will set the default colors of the kernel message.
456The kernel message will be printed bright red on black background.
457The reversed message will be black on red background.
458.Pp
459.Dl "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)
460.Dl "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)
461.Pp
462The following example adds the font files
463.Pa cp850-8x16.fnt ,
464.Pa cp850-8x14.font
465and
466.Pa cp850-8x8.font
467to the kernel.
468.Pp
469.Dl "options SC_DFLT_FONT"
470.Dl "makeoptions SC_DFLT_FONT=cp850
471.Dl "device sc0 at isa?
472.Pp
473.\".Sh DIAGNOSTICS
474.\".Sh CAVEATS
475.Sh BUGS
476This manual page is incomplete and urgently needs revision.
477.Sh SEE ALSO
478.Xr kbdcontrol 1 ,
479.Xr login 1 ,
480.Xr vidcontrol 1 ,
481.Xr atkbd 4 ,
482.Xr atkbdc 4 ,
483.Xr keyboard 4 ,
484.Xr screen 4 ,
485.Xr splash 4 ,
486.Xr ukbd 4 ,
487.Xr vga 4 ,
488.Xr kbdmap 5 ,
489.Xr rc.conf 5 ,
490.Xr screenmap 5 ,
491.Xr ttys 5 ,
492.Xr config 8 ,
493.Xr getty 8 ,
494.Xr kldload 8 ,
495.Xr moused 8
496.Sh HISTORY
497The
498.Nm
499driver first appeared in
500.Fx 1.0 .
501.Sh AUTHORS
502.An -nosplit
503The
504.Nm
505driver was written by
506.An S\(/oren Schmidt Aq sos@FreeBSD.org .
507This manual page was written by
508.An Kazutaka Yokota Aq yokota@FreeBSD.org .
509