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