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