SYSCONS(4)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1

πŸ‘‘ SYSCONS(4) β€” the legacy console driver, bestie πŸ‘‘

🌸 NAME 🌸

  • syscons, sc β€” the legacy console driver. Yes, it’s giving old-school, but we’re covering it anyway πŸ’…

πŸ› οΈ SYNOPSIS πŸ› οΈ

Compile-time vibes, exactly as they appear:

options MAXCONS=N
options SC_ALT_MOUSE_IMAGE
options SC_CUT_SEPCHARS=_characters_
options SC_CUT_SPACES2TABS
options SC_DFLT_TERM
options SC_DISABLE_KDBKEY
options SC_DISABLE_REBOOT
options SC_HISTORY_SIZE=N
options SC_MOUSE_CHAR=C
options SC_NO_CUTPASTE
options SC_NO_FONT_LOADING
options SC_NO_HISTORY
options SC_NO_PALETTE_LOADING
options SC_NO_SUSPEND_VTYSWITCH
options SC_NO_SYSMOUSE
options SC_NO_TERM_DUMB
options SC_NO_TERM_SC
options SC_NO_TERM_SCTEKEN
options SC_PIXEL_MODE
options SC_TWOBUTTON_MOUSE
options SC_NORM_ATTR=_attribute_
options SC_NORM_REV_ATTR=_attribute_
options SC_KERNEL_CONS_ATTR=_attribute_
options SC_KERNEL_CONS_ATTRS=_attributes_
options SC_KERNEL_CONS_REV_ATTR=_attribute_
options SC_DFLT_FONT
makeoptions SC_DFLT_FONT=_font_name_
device sc

And in /boot/device.hints:

hint.sc.0.at="isa"
hint.sc.0.vesa_mode=0x103

And in /boot/loader.conf:

kern.vty=sc

⚠️ DEPRECATION NOTICE ⚠️

Okay bestie, this is the serious part: the syscons console is deprecated, and it will be removed in a future version of FreeBSD. Users are advised to migrate to the vt(4) console instead. Like, genuinely advised. 🫢

πŸ’– DESCRIPTION πŸ’–

The syscons driver provides multiple virtual terminals, and it resembles the SCO color console driver. Old-school console energy, but make it functional ✨

Important vibe check: syscons is not compatible with systems booted via UEFI(8). Forcing use of syscons on such systems will result in no usable console. Not a cute look. πŸ’€

The syscons driver is implemented on top of the keyboard driver (atkbd(4)) and the video card driver (vga(4)), so both of them need to be configured in the system.

There can be only one syscons device defined in the system. One. Singular. Periodt.

πŸ–₯️ Virtual Terminals πŸ–₯️

The syscons driver gives you multiple virtual terminals, and they appear as if they were separate terminals. One virtual terminal is considered current and exclusively occupies the screen and the keyboard; the other virtual terminals are placed in the background. Main character terminal energy, honestly.

To use virtual terminals, they must be individually marked on in /etc/ttys so that getty(8) will recognize them as active and run login(1) to let the user log in to the system. By default, only the first eight virtual terminals are activated in /etc/ttys.

You press the Alt key and a switch key to switch between virtual terminals. Here’s the correspondence between the switch key and the virtual terminal:

  • Alt+F1 β†’ ttyv0
  • Alt+F2 β†’ ttyv1
  • Alt+F3 β†’ ttyv2
  • Alt+F4 β†’ ttyv3
  • Alt+F5 β†’ ttyv4
  • Alt+F6 β†’ ttyv5
  • Alt+F7 β†’ ttyv6
  • Alt+F8 β†’ ttyv7
  • Alt+F9 β†’ ttyv8
  • Alt+F10 β†’ ttyv9
  • Alt+F11 β†’ ttyva
  • Alt+F12 β†’ ttyvb
  • Shift+Alt+F1 β†’ ttyva
  • Shift+Alt+F2 β†’ ttyvb
  • Shift+Alt+F3 β†’ ttyvc
  • Shift+Alt+F4 β†’ ttyvd
  • Shift+Alt+F5 β†’ ttyve
  • Shift+Alt+F6 β†’ ttyvf

You can also use the nscr key β€” usually the PrintScreen key on the AT Enhanced keyboard β€” to cycle available virtual terminals. Very handy, very iykyk πŸ’«

The default number of available virtual terminals is 16. This can be changed with the kernel configuration option MAXCONS (see below).

Note that the X server usually requires a virtual terminal for display purposes, so at least one terminal must be left unused by getty(8) so that it can be used by the X server. Leave one for the X server, bestie. 🫢

⌨️ Key Definitions and Function Key Strings ⌨️

The syscons driver, in conjunction with the keyboard driver, allows the user to change key definitions and function key strings. The kbdcontrol(1) command will load a key definition file β€” known as a keymap file β€” dump the current keymap, and assign a string to a function key. See keyboard(4) and kbdmap(5) for the keymap file.

You may want to set the keymap variable in /etc/rc.conf.local to the desired keymap file so that it will be automatically loaded when the system starts up. Set it and forget it, lowkey iconic. ✨

πŸ”€ Software Font πŸ”€

For most modern video cards, e.g., VGA, the syscons driver and the video card driver allow the user to change the font used on the screen. The vidcontrol(1) command can be used to load a font file from /usr/share/syscons/fonts.

The font comes in various sizes: 8x8, 8x14, and 8x16. The 8x16 font is typically used for the VGA card in the 80-column-by-25-line mode. Other video modes may require different font sizes. It is better to always load all three sizes of the same font. Matching font set = clean vibe 🌸

You may set font8x8, font8x14, and font8x16 variables in /etc/rc.conf to the desired font files so that they will be automatically loaded when the system starts up.

Optionally you can specify a particular font file as the default. See the SC_DFLT_FONT option below. πŸ‘‘

πŸ—ΊοΈ Screen Map πŸ—ΊοΈ

If your video card does not support software fonts, you may still be able to achieve a similar effect by re-mapping the font built into your video card. Use vidcontrol(1) to load a screen map file which defines the mapping between character codes. Not the same as a software font, but it’s giving resourceful πŸ’…

πŸ–±οΈ Mouse Support and Copy-and-Paste πŸ–±οΈ

You can use your mouse to copy text on the screen and paste it as if it was typed by hand. You must be running the mouse daemon moused(8) and enable the mouse cursor in the virtual terminal via vidcontrol(1).

Pressing mouse button 1 β€” usually the left button β€” will start selection. Releasing button 1 will end the selection process. The selected text will be marked by inverting foreground and background colors. You can press button 3 β€” usually the right button β€” to extend the selected region. The selected text is placed in the copy buffer and can be pasted at the cursor position by pressing button 2 β€” usually the middle button β€” as many times as you like. Copy-paste slay πŸŽ€

If your mouse has only two buttons, you may want to use the SC_TWOBUTTON_MOUSE option below to make the right button paste the text. Alternatively you can make the mouse daemon emulate the middle button. See the man page for moused(8) for more details.

πŸ“œ Back Scrolling πŸ“œ

The syscons driver allows the user to browse the output which has scrolled off the top of the screen.

Press the slock key β€” usually ScrllLock / Scroll Lock or Pause on many keyboards β€” and the terminal is in the scrollback mode. It is indicated by the Scroll Lock LED. Use the arrow keys, the Page Up/Page Down keys, and the Home/End keys to scroll buffered terminal output. Press the slock key again to get back to the normal terminal mode. Scrollback mode: unlocked πŸ”₯

The size of the scrollback buffer can be set by the SC_HISTORY_SIZE option described below.

🌈 Screen Saver 🌈

The syscons driver can be made to put up the screen saver if the current virtual terminal is idle β€” that is, the user is not typing on the keyboard nor moving the mouse. See splash(4) and vidcontrol(1) for more details. Idle console gets the cute little screensaver treatment, periodt. πŸ¦‹

πŸ’» DRIVER CONFIGURATION πŸ’»

okay so this is where you tell the syscons driver how to act πŸ’… these are the kernel-side settings, driver flags, and loader tunables β€” and yes, every single one matters, no skipping bestie.

🧩 Kernel Configuration Options 🧩

The following kernel configuration options control the syscons driver.

  • MAXCONS=N β€” sets the number of virtual terminals to N. The default value is 16.
  • SC_ALT_MOUSE_IMAGE β€” selects the alternative way of displaying the mouse cursor in the virtual terminal. It may be expensive for some video cards to draw the arrow-shaped cursor, and you may want to try this option. However, the appearance of the alternative mouse cursor may not be very appealing. Note that if you use the SC_NO_FONT_LOADING option then you must also use this option if you wish to be able to use the mouse.
  • SC_CUT_SEPCHARS=_characters_ β€” specifies characters that will be looked for when the driver searches for word boundaries when doing cut operation. By default, its value is "\x20" β€” a space character.
  • SC_CUT_SPACES2TABS β€” instructs the driver to convert leading spaces into tabs when copying data into the cut buffer. This might be useful to preserve indentation when copying tab-indented text.
  • SC_DFLT_TERM=_name_ β€” specifies the name of the preferred terminal emulator.
  • SC_DISABLE_KDBKEY β€” disables the β€œdebug” key combination (by default, it is Alt-Esc, or Ctl-PrintScreen). It will prevent users from entering the kernel debugger (KDB) by pressing the key combination. KDB will still be invoked when the kernel panics or hits a break point if it is included in the kernel. If this option is not defined, this behavior may be controlled at runtime by the sysctl(8) variable hw.syscons.kbd_debug.
  • SC_DISABLE_REBOOT β€” disables the β€œreboot” key (by default, it is Ctl-Alt-Del), so that the casual user may not accidentally reboot the system. If this option is not defined, this behavior may be controlled at runtime by the sysctl(8) variable hw.syscons.kbd_reboot.
  • SC_HISTORY_SIZE=N β€” sets the size of the back scroll buffer to N lines. The default value is 100.
  • SC_MOUSE_CHAR=C β€” unless the SC_ALT_MOUSE_IMAGE option above is specified, the syscons driver reserves four consecutive character codes in order to display the mouse cursor in the virtual terminals in some systems. This option specifies the first character code to C to be used for this purpose. The default value is 0xd0. A good candidate is 0x03.
  • SC_PIXEL_MODE β€” adds support for pixel (raster) mode console. This mode is useful on some laptop computers, but less so on most other systems, and it adds a substantial amount of code to syscons. If this option is NOT defined, you can reduce the kernel size a lot. See the VESAMODE flag below.
  • SC_TWOBUTTON_MOUSE β€” if you have a two button mouse, you may want to add this option to use the right button of the mouse to paste text. See β€œMouse Support and Copy-and-Paste” above.
  • SC_NORM_ATTR=_attribute_
  • SC_NORM_REV_ATTR=_attribute_
  • SC_KERNEL_CONS_ATTR=_attribute_
  • SC_KERNEL_CONS_ATTRS=_attributes_
  • SC_KERNEL_CONS_REV_ATTR=_attribute_ β€” these options set the default colors. Available colors are defined in <machine/pc/display.h>. See β€œEXAMPLES” below. SC_KERNEL_CONS_ATTRS is a character string giving a sequence of attributes in binary format. The sequence will be repeated up to the number of CPUs. Beware that the string must not be null, since the kernel divides by its length.
  • SC_DFLT_FONT β€” specifies the default font. Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865, cp866 and cp866u. 16-line, 14-line and 8-line font data will be compiled in. Without this option, the syscons driver will use whatever font is already loaded in the video card, unless you explicitly load a software font at startup. See β€œEXAMPLES” below.
  • SC_NO_SUSPEND_VTYSWITCH β€” this option, which is also available as a loader(8) tunable and sysctl(8) variable hw.syscons.sc_no_suspend_vtswitch, disables switching between virtual terminals (graphics <-> text) during suspend/resume (ACPI and APM). Use this option if your system is freezing when you are running X and trying to suspend.

The following options will remove some features from the syscons driver and save kernel memory.

  • SC_NO_CUTPASTE β€” disables β€œcopy and paste” operation in virtual terminals.
  • SC_NO_FONT_LOADING β€” the syscons driver can load software fonts on some video cards. This option removes this feature. Note that if you still wish to use the mouse with this option then you must also use the SC_ALT_MOUSE_IMAGE option.
  • SC_NO_HISTORY β€” disables back-scrolling in virtual terminals.
  • SC_NO_SYSMOUSE β€” removes mouse support in the syscons driver. The mouse daemon moused(8) will fail if this option is defined. This option implies the SC_NO_CUTPASTE option too.
  • SC_NO_TERM_DUMB
  • SC_NO_TERM_SC
  • SC_NO_TERM_SCTEKEN β€” these options remove the β€œdumb”, β€œsc”, and β€œscteken” terminal emulators, respectively.

🚩 Driver Flags 🚩

The following driver flags can be used to control the syscons driver. Driver flags can be set with the hint.sc.0.flags tunable, either in /boot/device.hints, or else at the loader prompt (see loader(8)).

  • 0x0080 (VESAMODE) β€” this option puts the video card in the VESA mode specified by /boot/device.hints variable vesa_mode during kernel initialization. Note that in order for this flag to work, the kernel must be compiled with the SC_PIXEL_MODE option explained above. A list of the available mode can be obtained via vidcontrol(1).
  • 0x0100 (AUTODETECT_KBD) β€” this option instructs the syscons driver to periodically scan for a keyboard device if it is not currently attached to one. Otherwise, the driver only probes for a keyboard once during bootup.

πŸŽ›οΈ Loader Tunables πŸŽ›οΈ

These settings can be entered at the loader(8) prompt or in loader.conf(5).

  • kern.vty β€” when both syscons and vt(4) have been compiled into the kernel, the one to use for the system console can be selected by setting this variable to sc or vt. The GENERIC kernel uses vt(4) when this value is not set.

πŸ“ FILES πŸ“

  • /dev/console
  • /dev/consolectl
  • /dev/ttyv? β€” virtual terminals
  • /etc/ttys β€” terminal initialization information
  • /usr/share/syscons/fonts/* β€” font files
  • /usr/share/syscons/keymaps/* β€” key map files
  • /usr/share/syscons/scrmaps/* β€” screen map files

🌸 EXAMPLES 🌸

As the syscons driver requires the keyboard driver and the video card driver, the kernel configuration file should contain the following lines.

device atkbdc
device atkbd
device vga
device sc
device splash

You also need the following lines in /boot/device.hints for these drivers.

hint.atkbdc.0.at="isa"
hint.atkbdc.0.port="0x060"
hint.atkbd.0.at="atkbdc"
hint.atkbd.0.irq="1"
hint.vga.0.at="isa"
hint.sc.0.at="isa"

If you do not intend to load the splash image or use the screen saver, the last line is not necessary, and can be omitted.

Note that the keyboard controller driver atkbdc is required by the keyboard driver atkbd.

The following lines will set the default colors. The normal text will be green on black background. The reversed text will be yellow on green background. Note that you cannot put any white space inside the quoted string, because of the current implementation of config(8).

options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)
options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)

The following lines will set the default colors of the kernel message. The kernel message will be printed bright red on black background. The reversed message will be black on red background.

options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)
options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)

Provided SC_KERNEL_CONS_ATTR is not set, or is set to its default of bright white on black, the following line will set 4 red-ish colors for printing kernel messages in colors depending on the CPU.

options SC_KERNEL_CONS_ATTRS=\"\x0c\x04\x40\x0e\"

The default scheme is probably better for up to 8 CPUs. Use a long string to get unique colors for more than 8 CPUs.

To turn off all per-CPU coloring of kernel messages, set SC_KERNEL_CONS_ATTR to a non-default value, or use the default in a pattern of length 1.

options SC_KERNEL_CONS_ATTRS=\"\x0f\"

The following example adds the font files cp850-8x16.fnt, cp850-8x14.font and cp850-8x8.font to the kernel.

options SC_DFLT_FONT
makeoptions SC_DFLT_FONT=cp850
device sc

πŸ‘€ SEE ALSO πŸ‘€

kbdcontrol(1), login(1), vidcontrol(1), atkbd(4), atkbdc(4), keyboard(4), screen(4), splash(4), ukbd(4), vga(4), vt(4), kbdmap(5), rc.conf(5), ttys(5), config(8), getty(8), kldload(8), moused(8)


πŸ•°οΈ HISTORY πŸ•°οΈ

The syscons driver first appeared in FreeBSD 1.0.


πŸ‘‘ AUTHORS πŸ‘‘

The syscons driver was written by SΓΈren Schmidt <sos@FreeBSD.org>. This manual page was written by Kazutaka Yokota <yokota@FreeBSD.org>.


⚠️ CAVEATS ⚠️

The amount of data that is possible to insert from the cut buffer is limited by the {MAX_INPUT}, a system limit on the number of bytes that may be stored in the terminal input queue β€” usually 1024 bytes (see termios(4)).


πŸ’€ BUGS πŸ’€

This manual page is incomplete and urgently needs revision. no cap, it literally says that 😭


and that’s the whole entire tea πŸ«–βœ¨ β€” this page is from the Debian source/version, dated November 2, 2024, for SYSCONS(4). mwah πŸ’…

πŸ“¦ where this page comes from