NetBSD/macppc X11 FAQ

NetBSD/macppc X11 FAQ

General Questions

XFree86 Questions

Xmacppc Questions

Other sources of information


General Questions

Which X Window System package should I use?

Xmacppc or XFree86? There are two complete X Window System servers distributed in the NetBSD/macppc xserver.tgz set.

The Xmacppc package uses the raw device that is set up by Open Firmware. It is very limited in capability, but runs on almost all supported macppc models. It cannot change the resolution of your screen or use more than 8 bpp color depth. It does not have any acceleration of any sort.

The XFree86 package uses its own knowledge about the video card's chipset, but there are no drivers for the older macppc models which used Apple-developed video chipsets (as opposed to newer systems which use video cards from ATI or NVIDIA). Thus, XFree86 supports a small subset of all supported macppc models, but it is a much more capable X server -- it handles resolution switching and more than 8 bpp color depth, in addition to some acceleration.

To select a different X server, redirect the link /usr/X11R6/bin/X to point at your preferred server:

# cd /usr/X11R6/bin
# ls -l X*
lrwxr-xr-x  1 root  wheel       22 Nov 12 13:50 X@ -> /usr/X11R6/bin/XFree86
-rws--x--x  1 root  wheel  1918906 Nov 12 13:48 XFree86*
-rws--x--x  1 root  wheel  1506734 Nov 12 13:48 Xmacppc*
-r-xr-xr-x  1 root  wheel    27494 Jun  9  2001 Xmark*
-r-xr-xr-x  1 root  wheel  3518011 Nov 12 13:48 Xnest*
-r-xr-xr-x  1 root  wheel  1914704 Nov 12 13:48 Xprt*
-r-xr-xr-x  1 root  wheel  3832078 Nov 12 13:48 Xvfb*
# rm X
# ln -s Xmacppc X

How come the delete key produces a tilde (~) instead of deleting?

Actually, it produces the proper VT100 delete key, not the delete escape sequence (which is what just about every other VT100 emulator does).

You will need to run the following command each time you start the X server:

# xmodmap -e "keycode 59 = BackSpace"

Of course, you can place this command into your xdm/Xsetup_0 file or in each user's .xinitrc.

To get only xterm to recognize this, insert the following line into one of the default setting locations:

XTerm*VT100*deleteIsDEL: true

While the most universal location would be /usr/X11R6/lib/X11/app-defaults/XTerm, this might cause problems if you or one of your users runs an xterm on a remote X server without the correct VT100 delete key. Less intrusively, you could put it into the .Xdefaults file in the home directory of each user that will be using X from the console.

Cannot open kbd/mouse : no such file or directory

This happens when a non-root user tries to run startx or xinit. The default behavior of NetBSD/macppc is for the console devices to belong only to root. We suggest you run something like xdm, which will change the permissions when a user successfully logs in.

Alternatively, you can use ttyaction(5) which changes the permissions when the user logs in. For example, create /etc/ttyaction with the following contents:

console * /usr/sbin/chown ${USER} /dev/wskbd0 /dev/wsmouse0
ttyE0   * /usr/sbin/chown ${USER} /dev/wskbd0 /dev/wsmouse0

How can I emulate a 3-button mouse with a 1-button mouse in X?

At the moment, you can only set up keys on your keyboard to be mouse keys. We suggest trying to find a cheap 3 button mouse, as most ADB and USB mice are supported.

You will be using xmodmap(1) to remap keys on your keyboard to mouse buttons. Create an .xmodmaprc file in each users' home directory, and have their .xinitrc run `xmodmap .xmodmaprc'. The contents of the .xmodmaprc will specify which key enables/disables the keyboard pointer buttons, and which keys correspond to which mouse buttons. For example, on an Apple Extended Keyboard II, I use:

keycode  79 = Pointer_EnableKeys
keycode 113 = Pointer_Button1
keycode 115 = Pointer_Button2
keycode 121 = Pointer_Button3

where keycode 79 is the Num Lock key (which enables/disables mouse keys), and 113, 115, and 121 correspond to F13, F14, and F15.

On my PowerBook (FireWire), I use F8 (108) to enable and F10 (117), F11 (111), and F12 (119) for the mouse keys.

To figure out what keys correspond to which keycodes, use the xev(1) command. You may also want to put your keymap for the delete key into your .xmodmaprc as well.


XFree86 Questions

Which models can run XFree86?

Only models that have supported video cards with appropriate Open Firmware initialization. In general, this means only recent models (i.e. Open Firmware 3) or a supported video card (such as an ATI Rage 128).

You will need to create an XF86Config file.

How do I create an XF86Config file?

Try using xf86config. Otherwise, post to port-macppc@NetBSD.org asking for a sample.

Fatal server error: ppcPciInit: /dev/kmem

Unfortunately, at present, the XFree86 X server requires direct access to /dev/kmem which is typically something you only want root programs to have access to. By doing the following, you are opening up a security hole (albeit a small one).

You will need to compile a new kernel with options INSECURE, as this is not enabled in the default GENERIC kernel shipped with distributions of NetBSD.

My keymap is all screwed up.

You may need to create (as root) the following directory for XFree86 to store keyboard mapping information:

# mkdir -p /var/db/xkb;chmod 755 /var/db/xkb

Xmacppc Questions

Which models can run Xmacppc?

Every model that can boot with console support and models with supported video cards (that have proper Open Firmware initialization code). Models which require you to use a serial console can not run any X servers.

While it supports almost every NetBSD/macppc model, the downside is that the color depth is limited to 8 bpp, there is no way to change screen resolution, and there is no graphics acceleration.

How do I change the resolution or the number of colors?

You can't do this from within NetBSD. These settings need to be changed in Open Firmware. Also, NetBSD/macppc does not yet support color depths of more than 8 bpp.

Older machines (7300 - 8600) cannot change resolutions from within Open Firmware. They are fixed to 640x480 at 67 Hz (after applying the patch). Without this patch, the frequency is undetermined (usually 60 Hz or 120 Hz, but could be just about anything).

On newer machines, you need to set the resolution you want from within Mac OS. Open Firmware should then keep that setting.

Chris Tribo reports that his XClaimVR 64 card ignores the Mac OS monitor setting and always comes up at the same resolution.


Other sources of information

NetBSD Documentation: X Window System

The Xfree86 Project Home Page


Back to  NetBSD/macppc ports page