Using multipie wsdisplay devices

Using a machine with single graphics card is trivial and well documented. However, once second graphics card is installed, additional wsdisplay device is detected by the kernel. But how to use it? By default screen will be added only on device used as a console:

$ dmesg | grep ^ws
wsdisplay1 at tdvfb0 kbdmux 1
wsmux1: connecting to wsdisplay1
wsdisplay0 at r128fb0 kbdmux 1: console (default, vt100 emulation)
wsmux1: connecting to wsdisplay0
wskbd0 at ukbd0: console keyboard, using wsdisplay0
wsmouse0 at ums0 mux 0

In the above example r128fb (wsdisplay0) is used as console.

All wsdisplay devices are accessed through /dev/ttyE* files. Standard installation has only files for a single wsdisplay!

First you need to determine which major number is used for wsdisplay:

$ mknod -l wsdisplay
wsdisplay character major 35

Device minor numbers for single wsdisplay are 8-bit. So wsdisplay0 occupies range 0 to 254:

$ ls -l /dev/ttyE*
crw-------  1 root  tty    35,   0 Oct  3 00:17 /dev/ttyE0
crw-------  1 root  wheel  35,   1 Jul 15  2012 /dev/ttyE1
crw-------  1 root  wheel  35,   2 Jul 15  2012 /dev/ttyE2
crw-------  1 root  wheel  35,   3 Jul 15  2012 /dev/ttyE3
crw-------  1 root  wheel  35,   4 Jul 15  2012 /dev/ttyE4
crw-------  1 root  wheel  35,   5 Jul 15  2012 /dev/ttyE5
crw-------  1 root  wheel  35,   6 Jul 15  2012 /dev/ttyE6
crw-------  1 root  wheel  35,   7 Jul 15  2012 /dev/ttyE7
crw-------  1 root  wheel  35, 255 Jul 15  2012 /dev/ttyEcfg
crw-------  1 root  wheel  35, 254 Jul 15  2012 /dev/ttyEstat

First screen on wsdisplay1 would have minor 256, second would have minor 257, while cfg device would have 511. So let's create the needed device files:

# mknod /dev/ttyFcfg c 35 511
# mknod /dev/ttyF0 c 35 256

Now adding a new screen on wsdisplay1 is as easy as:

# wsconscfg -f /dev/ttyFcfg 0 

Keep in mind that screens have separate numbers per wsdisplay device (so you will have two screens 0 now).

# dmesg | tail -n1
wsdisplay1: screen 0 added (default)

Now that the screen is allocated, you can use it.

This information should go into man pages at some point, but currently I don't know how to do it in a non-confusing way... Thanks to uwe@ for explaining how ttyEcfg are used.

Add a comment