Otto's LinuxPPC Goodies

The purpose of this page

This page contains information on my LinuxPPC project. I am currently experimenting with LinuxPPC versions 2.2.10 and newer on my Apple G3 Power Mac, also known as Blue & White G3. General information on LinuxPPC can be found at The official LinuxPPC site. For information on specific G3 issues Robert Shaw's home page is a very good starting point.

How to map Mac keyboard keys to mouse buttons

If you are running LinuxPPC 2000, you only have to do step 4 and 5, and possibly 6. This distribution does contain the right files and installs the right settings. At least on my machine....
I don't know about other distributions.

The 2.2.10 and newer LinuxPPC kernels do not include the fix that mapped the NumLock and keypad equals keys to the second and third mouse buttons. This mapping is done in the 2.2.6 UUSB driver, but since the 2.2.10 kernel uses a different diver, this handy feature is lost. Below is a description of a solution to this problem. If you have an ADB Mac keyboard this also works. The result is that all Macs running LinuxPPC will be able to use the keyboard to emulate mouse buttons.
The starting point of the solution was given to me by Kostas Gewrgiou: xkb, including some patches. It took some effort to get xkb working since from the start the X server did not use xkb, because of some XF86Config problem. A short description of the way I got this working:

Steps 1-3 do not seem to be neccesary on LinuxPPC 2000.

  1. It looks like the default keyboard settings as generated by Xautoconfig do not include the correct settings. As a result, the X server switches off the xkb extension and falls back to the default keyboard mapping. To check if the X server uses xkb, look in the file /var/gdm/:0.log if you are running Gnome. If you are running a different desktop manager, look into the log files generated by that desktop manager.
    You will find some lines referring to the settings of some xkb parameters. Look through the whole file, scanning for xkbcomp related error messages. These messages will not appear immediately after the xkb parameters! If the X server reports that xkbcomp failed, it also reports switching to the default pre-xkb keyboard mapping.
  2. Once I changed the /etc/X11/XF86Config keyboard settings to be:
      XkbKeycodes "macintosh" 
      XkbTypes    "default" 
      XkbCompat   "default" 
      XkbSymbols  "macintosh/us" 
      XkbGeometry "macintosh" 
      XkbRules    "xfree86" 
      XkbModel    "macintosh"
    and restarted my X server, I could check that I was indeed using the xkb Mac keyboard settings by reading the X server log. If you have an USB keyboard and you applied the above patch or if you have an ADB keyboard, you can also verify the xkb settings by checking the output of the keypad equals key. This key should correctly map to an equals sign.

    These manual settings will only keep working if you do not run Xautoconfig on each boot!

  3. To be able to use the mouse keys, you have to change several xkb related files. Download this gzipped tar archive . Replace the following files under the /usr/lib/X11/xkb directory:
    by the corresponding files in the tar archive. Now restart your X session.
  4. The default setting of the keypad is to map to cursor movement keys. If you want numeric entries, first press NumLock. If you want the keypad to emulate the mouse, first press Shift-Numlock. The default key mappings are described in the file /usr/lib/X11/xkb/compat/mousekeys. You can also use xev to study the mappings. Although the settings provided are for the Apple Extended ADB keyboard, I found no problems when using my USB ISO keyboard.
  5. I changed the default setting to always map keypad 0 and keypad period to mouse button 2 and 3 respectively by replacing the KP_0, KP_Insert, KP_Decimal and KP_Delete entries in /usr/lib/X11/xkb/compat/mousekeys:
      interpret KP_0 {
        action = PointerButton(button=2); 
      interpret KP_Insert { 
        action = PointerButton(button=2); 
      interpret KP_Decimal { 
        action = PointerButton(button=3); 
      interpret KP_Delete { 
        action = PointerButton(button=3); 
  6. After all this was done, I could remove my /usr/lib/X11/xinit/.Xmodmap file that contained an entry to map the delete key to backspace.


Recently, I found out that the mouse keys do an auto-repeat. This not very handy. The the keyboard driver generates the auto-repeat. This makes the auto-repat hard to avoid in the X server.

My project: adding general purpose PCI support to the Linux serial driver

Last update:
Active development of my own driver has ceased. I sent my patches to the maintainer of the serial driver, and my changes are merged into the 2.3 tree, in addition to even more general serial PCI support. I have a stand alone module available that works on 2.2.x.Please contact me if you are interested.

I am currently adding general purpose PCI support to the standard Linux serial driver. This project started as an exercise in writing a driver for my Keyspan SX2 serial PCI card. This is a serial card sold by Keyspan. The project gradually changed to a much broader scope. You can find some of my experiences in a document called Writing a Linux device driver for the Keyspan SX serial card.

If you have a "dumb" serial PCI card and are running Linux version 2.2.x on an Intel, PowerPC, Alpha or any other platform supporting PCI, chances are the driver will work for you! More details available on the download page:

The third version of the general purpose patch is available. Look here!

Wednesday, Sept. 1 1999

Active development of my own driver has ceased. I sent my patches to the maintainer of the serial driver, and my changes are going to be merged into the 2.3 tree, in addition to even more general PCI support.

Wednesday, Aug. 25 1999

Third version of the patch posted. See download page for details.

Tuesday, Aug. 24 1999

Second version of the patch posted. Bug spotted by Stuart MacDonald fixed.

Sunday, Aug. 22, 1999

Last week the goal of the project gradually changed into a more general one: adding general purpose PCI support to the standard serial driver. The first version is finished, you can find it here.

Sunday, Aug. 15, 1999

I sent out a request to resolve some design issues to the linuxpp-dev and the linux-kernel list. You can find it here.

Friday, Aug. 13, 1999

The very first version of the driver is working, but I don't think it ready for publishing yet. Some patience required!

Monday Aug. 9, 1999

I sent out the first request for cooperation to the linuxppc-dev and linuxppc-user lists and the comp.os.linux.powerpc newsgroup: you can find it here. I am also busy making a description of my experiences so far. The document is called Writing a Linux device driver for the Keyspan SX serial card.

The following file is available for download

Apple USB ISO keyboard patch

Another plan

I should start to learn how to type or at least read back what I've typed. I have to stop blaming my keyboard!!

That's all for the moment... 

Please email comments to Otto Moerbeek