Introduction
vt(4) is the virtual terminal console driver implementation (also known as the “Newcons” project) which replaces syscons(4), adding the following features:
- Unicode support.
- Double-width character support for CJK characters.
- Bigger font maps (because of the use of graphics mode).
- Better use of graphics modes, enabling more appealing graphical boot experiences.
It was added to CURRENT in r259016 (2013-12-05) and enabled by default in GENERIC for amd64 and i386 architectures in r268045 (2014-06-30).
syscons(4) Comparison
vt(4) currently has the following features compared to syscons:un
Note: Additional vt(4) features will be implemented; this table does not represent the end goal for vt(4).
| Feature | syscons(4) | vt(4) |
|---|---|---|
| splash screen support | Yes | Limited (see ImproveVtSplashScreenSupport) |
| ASCII encoding | Yes | Yes |
| UTF-8 encoding | No | Yes |
| Encodings other than ASCII/UTF-8 | Yes | No |
| Double-width characters (for CJK) | No | Yes |
| VGA text mode font changing | Yes | No |
| VGA vesa | Yes | Limited (vt_vbefb supports the mode set by the loader) |
| screensaver | Yes | No |
| Kernel Modesetting (KMS) integration | No | Yes |
| More than 256 distinct characters on screen | No | Yes |
| support for hardware mouse cursors | Yes | No |
Testing
i386/amd64
The vt and vt_vga devices are enabled by default; if using a custom kernel make sure they are included. The sc and vga devices may be omitted.
#device vga # VGA video card driver #device sc device vt device vt_vga
To test vt(4) with KMS on Intel driver
kldload i915kms
For ATI/AMD Radeon drivers
kldload radeonkms
vt_vga defaults to graphics mode. A loader tunable hw.vga.textmode can be set to use text mode instead. To enable text mode add the following to /boot/loader.conf:
hw.vga.textmode=1
PowerPC
vt(4) is enabled by default in GENERIC in -CURRENT.
Font Support
The vtfontcvt(8) tool can convert BDF and HEX format font files for use by the vt(4) console.
For example, a 16×32 version of the terminus font can be created as follows:
- Obtain the latest Terminus font distribution and extract it
- Convert it to a vt(4) .fnt file:
% vtfontcvt -w 16 -h 32 ter-u32n.bdf ter-u32b.bdf ter-u32.fnt
- Load it from a console window:
% vidcontrol -f ter-u32.fnt
TODO
| Feature | Status |
|---|---|
| Generic terminal layer for the kernel | DONE |
| Core of the vt driver, screen buffering, drawing, etc | DONE |
| Make the keyboard layer accept Unicode | DONE |
| Migrate syscons to xterm, to ease switching between vt(4) and syscons | DONE |
| Make kernel mode setting work: to be investigated. | DONE |
| Scrollback | Works |
| Moused support | Works |
| kbdcontrol(1) | In progress: PR 204837 |
| +— kbdmap load | Works. |
| +— kbdmux control | Works. |
| kbdmap(1) front end | Works. |
| vidcontrol(1) | In progress |
| +— Font load | Works |
| +— Font console attributes | Works |
| +— Colormap | Not yet |
| +— Clear history | Done (r361601, PR 224436) |
| +— CONS_BLANKTIME | Not implemented: PR 233356 |
| vidfont(1) front end | DONE |
| Switch to text when required | Works |
| ddb(4) debugger | Works |
| Integration with X11 | Works |
| vt(4) man page | DONE |
| double width character support | Done |
| CJK fonts Fonts | In progress |
| UTF-8 keymaps | DONE |
| Update FreeBSD Handbook | Unstarted |
| Keyboard and char map support for other than Unicode UTF-8 | Unstarted |
| Font setting from loader (at kernel start) | Unstarted |
| Architecture / Hardware Specific | |
| amd64 | Works (VGA/i915kms/radeonkms) |
| ARM | Works Framebuffer. |
| arm64 | Unknown |
| i386 | Works (VGA/i915kms/radeonkms) |
| MIPS | Works |
| PPC | Works |
| SPARC | Works |
| VGA driver that supports at least 80×25 text mode and 640×480 graphics mode | DONE |
| VESA driver | Limited functionality (mode switch only by loader) |
| Graphics driver that works with Intel and ATI/AMD | DONE |
| i386/amd64 nvidia driver | Works |
| Xbox framebuffer driver (as a test, because it's easy to do so) | DONE |
| DRM notification on panic/reboot/shutdown/debugger | DONE |
| Screen saver | Unstarted |
Known Issues
Search for PRs tagged with the vt keyword
- No support for non-UTF-8 charmap (e.g. ru_RU.KOI8-R).
- Limited support for modesetting.
- Partly fixed with a KMS driver (
i915kmsorradeonkms): one can set a mode by putting this in/boot/loader.conf:
kern.vt.fb.default_mode="1024x768"
- No support for several vidcontrol(1) features.
- No support for VGA text mode loadable fonts.
- No support for moused(8) in VGA text mode.
- No support for vgl(3).
- No support for DPMS.
- No support for splash(4).
- Support only 16 colors.
- Pre-loading i915kms.ko/radeonkms.ko disables video output from the point of time these video drivers are attached until interrupt threads are enabled way later. This makes kernel panics during boot undebugable.
- Machines with at least certain Intel Ivy Bridge hardware may reliably panic when pre-loading i915kms.ko (but work when loading i915kms.ko after boot). Please submit a PR with details if you reproduce this.
- Machines with at least certain Radeon ARUBA hardware may reliably panic when loading radeonkms.ko after boot (but work when pre-loading radeonkms.ko). Please submit a PR with details if you reproduce this.
- If drm2 have 2+ outputs, it decides to use too big a window, which is not fully visible on one or both screens.
- Console output with at least VGA in graphics mode or via i915kms.ko/radeonkms.ko still is remarkably slow, especially compared to syscons(4) with VGA text mode.
- Having text marked for copy and paste and then launching something that clears the screen, f. e. vi(1), leaves the region of previous text still marked.
Fixed Issues
- No mouse terminal events yet (terminal char sequence for app notification on mouse event).
- (looks like) Failure mode with incorrect mix of options (e.g. vt w/ vga) is not obvious
- Scrolling / refresh is very slow on some hardware
- Newcons w/ gallant12x22 font does not clear the screen properly: http://people.freebsd.org/~emaste/newcons/gallant.png
- Newcons locks up w/ gallant12x22 font in VirtualBox
- When resuming from suspend, switching back from ttyv0 may cause a kernel panic (vt_switch_timer). To disable the vt switch, add kern.vt.suspendswitch=0 in loader.conf.
- No beep in X
- vidcontrol -S on/off (enable/disable vty switch) does not work
- Scrollback fails on vty0 (others work)
- VGA driver produces corrupted output with fonts other than 8 pixels wide. pr191591
- Switch to vty0 on panic/reboot/shutdown/debugger fails from X (works from other VTs)
- e.g.
sysctl debug.kdb.enter=1from xterm
- X crash on Unicode input (some mistake with enabling RAW kbd mode) pr191459
- Control keys mishandled on entry to ddb. For instance, use Ctrl+Alt+Esc to enter debugger, then 'c'. Ctrl and/or Alt are still active.
- The text cursor may end up in the middle of kernel messages after loading a kernel video driver (r273932).
- PS/2 keyboard might fail in X - add
kbdmuxto kernel config (see freebsd-current posting) (r273973). - No support for configurable history size (even compile-time) (274117).
- The keymap selection in the installer doesn't work properly (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193656).
- The screen isn't cleared at boot in some cases (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191564).
- kbdmux control pr191306)
- During output of large amounts of text certain fractions repeatedly are incorrecly displayed as marked text. (PR211922)
Credits
Significant contributors to vt(4) include: