[FAQ Index] [To Section 6 - Networking] [To Section 8 - General Questions]
The ports that use the wscons(4) console driver: alpha, amd64, hppa, i386, mac68k, macppc, sparc, sparc64, vax, and zaurus.
With wscons(4) consoles, most options can be controlled using the wsconsctl(8) utility. For example, to change keymappings with wsconsctl(8) one would execute the following:
# wsconsctl -w keyboard.encoding=uk
In the next example, we will remap "Caps Lock" to be "Control L":
# wsconsctl -w keyboard.map+="keysym Caps_Lock = Control_L"
For the alpha, amd64 and i386 platforms, OpenBSD provides wsmoused(8), a port of FreeBSD's moused(8). It can be enabled automatically at startup by editing the appropriate line in rc.conf(8).
To do this you must add a line in /etc/gettytab(5). Change the current section:
P|Pc|Pc console:\
:np:sp#9600:
adding the line ":cl=\E[H\E[2J:" at the end, so that it ends up looking like this:
P|Pc|Pc console:\
:np:sp#9600:\
:cl=\E[H\E[2J:
On some platforms, OpenBSD provides a console scrollback buffer. This allows you to see information that has already scrolled past your screen. To move up and down in the buffer, simply use the key combinations [SHIFT]+[PGUP] and [SHIFT]+[PGDN].
The default scrollback buffer, or the number of pages that you can move up and view, is 8. This is a feature of the vga(4) driver, so it will not work without a VGA card on any platform (many Alpha systems have TGA video).
Due to space limitations, the install kernels do not provide the scrollback function. Switching consoles will clear the scrollback buffer.
The X environment uses ttyC4, [CTRL]+[ALT]+[F5]. When using X, the [CTRL]+[ALT]+[Fn] keys will take you to the text screens; [CTRL]+[ALT]+[F5] will take you back to the graphical environment.
If you wish to have more than the default number of virtual consoles, use the wsconscfg(8) command to create screens for ttyC6, ttyC7 and above. For example:
wsconscfg -t 80x25 6
will create a virtual terminal for ttyC6,
accessed by [CTRL]+[ALT]+[F7].
Don't forget to add this command to your
rc.local(8)
file if you want the extra screen the next time you boot the computer.
Note that you will not get a "login:" prompt on the newly-created virtual console unless you set it to "on" in /etc/ttys(5), and either reboot or send init(8) a HUP signal using kill(1).
On the Zaurus, two virtual terminals (/dev/ttyC0 and /dev/ttyC1) are available by default, accessible with [ALT]+[CALENDAR] and [ALT]+[ADDRESS] (The [ALT] key is the one right of the left [CTRL] key).
First, a font that supports the desired resolution must be loaded using the wsfontload(8) command. The standard 80x25 text screen uses 8x16 pixel fonts; to double the number of lines we will have to use 8x8 pixel fonts.
After that, we will have to delete and recreate a virtual console at the desired screen resolution, using the wsconscfg(8) command.
This can be done automatically at boot by adding the following lines to the end of your rc.local(8) file:
wsfontload -h 8 -e ibm /usr/share/misc/pcvtfonts/vt220l.808
wsconscfg -dF 5
wsconscfg -t 80x50 5
As with any modification to your system configuration, it is
recommended you spend some time with the man pages to understand what
these commands do.
The first line above loads the 8x8 font. The second line deletes screen 5 (which would be accessed by [CTRL]+[ALT]+[F6]). The third line creates a new screen 5 with 50 lines of 80 characters each. If you do this, you will see your primary screen, and the other three default virtual consoles, come up in the standard 80x25 mode, but a new screen 5 at 80x50 accessible through [CTRL]+[ALT]+[F6].
Remember that [CTRL]+[ALT]+[F1] is screen 0 (ttyC0). If you wish to alter other screens, simply repeat the delete and add screen steps for whichever screens you want running at the 80x50 resolution.
You should avoid changing screen 4 (ttyC4, [CTRL]+[ALT]+[F5]), which is used by X as a graphical screen. It is also not possible to change the resolution of the primary console device (i.e., ttyC0).
As one might expect, all these commands can also be entered at the command prompt, as root, or (better) using sudo(8).
Note: this will not work on all video cards. Unfortunately, not all video cards support the uploaded fonts that wscons(4) requires to achieve the 80x50 text mode. In these cases, you might wish to consider running X.
Note that serial interfacing is NOT a trivial task -- you will often need unusual cables, and ports are not standardized between machines, in some cases, not even consistent on one machine. It is assumed you know how to select the appropriate cable to go between your computer and the device acting as your serial terminal. A full tutorial on serial interfacing is beyond the scope of this article, however, we offer one hint: just because the ends plug in doesn't mean it will work.
Terminal sessions are controlled by the
/etc/ttys
file. Before OpenBSD will give you a "login:" prompt at a
device, it has to be enabled in /etc/ttys, after all, there are
other uses for a serial port other than for a terminal. In platforms
which typically have an attached keyboard and screen as a console, the
serial terminal is typically disabled by default. We'll use the i386
platform as an example. In this case, you must edit the line that
reads:
tty00 "/usr/libexec/getty std.9600" unknown off
to read something like:
tty00 "/usr/libexec/getty std.9600" vt220 on secure
Here, tty00 is the serial port we are using as a console.
vt220 is the
termcap(5)
entry that matches YOUR terminal (other likely options might include
vt100, xterm, etc.).
The "on" activates the
getty
for that serial port so that a "login:" prompt will be
presented, the "secure" permits a root (uid 0) login at this
console (which may or may not be what you desire), and the
"9600" is the terminal baud rate.
Resist the urge to crank the baud rate up to the maximum your hardware
can support, as you are more likely to create problems than benefit.
Most systems have a "default" speed (supported by default by the boot
ROM and/or the boot loader, often 9600), use this unless you have real
reason to use something different.
Note that you can use a serial console for install without doing this step, as the system is running in single user mode, and not using getty for login.
On some platforms and some configurations, you must bring the system up in single user mode to make this change if a serial console is all you have available.
set tty com0
to use the first serial port as your console. The
default baud rate is 9600bps, this can be changed with a
/etc/boot.conf line using the stty option. This file is put on
your boot drive, which could also be your install floppy, or the command
can be entered at the boot> prompt from the
OpenBSD
second-stage boot loader for a one-time (or first time) serial
console usage.
ok setenv input-device ttya
ok setenv output-device ttya
ok reset
If the keyboard and monitor (ttyC0) are active in /etc/ttys
(above), you can use the keyboard and monitor
in X.
ok setenv output-device scca
ok setenv input-device scca
ok reset-all
Set your serial console to 57600bps, 8N1.
# wsconsctl -w display.screen_off=60000
display.screen_off -> 60000
or set them permanently by editing
/etc/wsconsctl.conf
so these changes take place at next boot:
display.vblank=on # enable vertical sync blank
display.screen_off=600000 # set screen blank timeout to 10 minutes
display.kbdact=on # Restore screen on keyboard input
display.outact=off # Restore screen on display output
The blanker is activated when either display.kbdact or
display.outact is set to "on".
Virtually all Unix commands and user names are entered using all lowercase. However, some very old terminals were only capable of uppercase characters, making them difficult, if not impossible, to use with Unix. As a workaround, if you entered your user name in all uppercase, getty(8) would assume your terminal was "lowercase challenged", and simply interpret everything you type as lowercase, while echoing it as uppercase. If you have a mixed-case or uppercase password, this will make login impossible.
Hitting CTRL-D at the login prompt will cause getty(8) to terminate, and init(8) will relaunch a new one, which will accept uppercase and lowercase properly.
[FAQ Index] [To Section 6 - Networking] [To Section 8 - General Questions]