OpenBSD: using Xorg above OpenBSD/macppc
By default, OpenBSD/macppc comes with a /etc/X11/xorg.conf that runs the window system in an unaccelerated framebuffer, with only 256 colors. The truth is that the X server is a recent version of Xorg and might have the ability to use accelerated graphics with millions of colors, if you take away the config file and let Xorg configure itself.
How to use accelerated graphics:
$ sudo mv /etc/X11/xorg.conf{,.off}
$ startx
The above startx commands causes a PowerBook5,4 with an "ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]" to use the "ati" driver, which loads radeon(4) as submodule. (The default /etc/X11/xorg.conf uses the wsfb(4) driver to draw on the framebuffer from wsdisplay(4). This is vgafb(4) which only uses Open Firmware to provide a 256-color framebuffer at the default resolution.)
When X runs, use xrandr(1) to change the screen resolution:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1280 x 854, maximum 1280 x 1200
LVDS connected 1280x854+0+0 (normal left inverted right x axis y axis) 321mm x 214mm
1280x854 60.0*+
1024x768 60.0
800x600 60.3
640x480 59.9
VGA-0 disconnected (normal left inverted right x axis y axis)
S-video disconnected (normal left inverted right x axis y axis)
$ xrandr -s 1024x768
Fixing the Delete Key
An ADB keyboard has a "Delete" key where a PC or USB keyboard would have a "BackSpace" key. This key is the same as the traditional vt100 delete key and deletes the character on the left.
The X server should map the ADB "Delete" key as a BackSpace key. The problem is that the X server maps the ADB "Delete" key as a Delete key, which deletes the character on the right. This causes problems when the user tries to delete characters in applications like Firefox or Konqueror. (The OpenBSD xterm actually handles Delete like a traditional vt100 delete, and deletes the character on the left.) It also prevents using Control+Alt+Backspace to reset the X server.
The fix is to xmodmap to remap the Delete key as a BackSpace key. It is very convenient to place this xmodmap command in the .xinitrc file.
$ xmodmap -e 'keysym Delete = BackSpace'
This enables the Delete key to work as a BackSpace key, but it does not enable the Control+Alt=BackSpace to reset the X server.
A better fix...
To implement a better fix, we must find the ADB keymap, and change the Delete key to a BackSpace key. To find this keymap, we must understand how the X server sees the keyboard.
I had expected that the X server would pass ADB keyboard to xkb, but in actuality the "kbd" driver of X.org actually translates the ADB keycodes into PC keycodes, then passes the PC keycode (plus 8, for some reason) to xkb. So I do not want to adjust the xkb keycodes, but I want to tell the "kbd" driver to translate ADB "Delete" into PC "BackSpace".
When I looked at the source code to the "kbd" driver, I found that it contained two protocols, the "Standard" protocol and the "wskbd" protocol. The "wskbd" protocol would open /dev/wskbd to get the keycodes. Instead, the default configuration uses the "Standard" protocol. With the "Standard" protocol, the X server expects its standard input to be the console tty. The X server uses a wscons ioctl to toggle the console tty into raw mode. It then reads PC keycodes from standard input.
The kernel must translate ADB keycodes into PC keycodes, and this is what happens. Thus I do not change the xkb keycodes, I do not change the "kbd" driver, but I change the kernel.
For this to work, the kernel must translate ADB keycodes into PC keycodes, and this is what happens. Thus we do not change the xkb configuration, we do not change the "kbd" driver, but we change the kernel.
The kernel source file cd /usr/src/sys/dev/adb/keyboard.h contains the map:
#include <dev/wscons/wskbdraw.h>
unsigned char keyboard[128] = {
RAWKEY_a,
RAWKEY_s,
RAWKEY_d,
RAWKEY_f,
...
RAWKEY_space,
#ifdef FIX_SV_X_KBDBUG
RAWKEY_less,
#else
RAWKEY_grave,
#endif
RAWKEY_Delete,
RAWKEY_KP_Enter,
RAWKEY_Escape,
...
Changing RAWKEY_Delete to RAWKEY_BackSpace and building a new kernel would fix the keyboard.
The text of this wiki page is in the PublicDomain.
Comments (0)
You don't have permission to comment on this page.