Sunday, October 07, 2012

Legacy X background

I know that you missed it since the day Xorg switched to an all-black default background.

 $ xsetroot -fg black -bg white \
   -bitmap /usr/include/X11/bitmaps/root_weave



Saturday, October 06, 2012

German iBook G4 Keyboard

I currently have a iBook-G4 on my desk, running Linux. Everything is dandy, only a few things with the keyboard are odd. Two keys are swapped: “°^” (to the left of the number 1-key on a German keyboard) and “<>” (to the left of “Y” on a German keyboard)". And the right ALT key seems to be mapped to the “Enter” function. I got it running after messing around with the Xorg xkb settings (which is a nightmare, btw.) but it is clear that the problem is somewhere deeper.

There’s some serious mapping error for this keyboard in the kernel’s table stored in adbhid.c.

Key ADB Code Key is… Key should…
<> 0x32 KEY_GRAVE KEY_102ND
°^ 0x0a KEY_102ND KEY_GRAVE
R-Alt 0x34 KEY_KPENTER KEY_RIGHTALT

Here’s a patch that makes this keyboard behave:

$ cat ~/adbhid_c.patch
--- ./drivers/macintosh/adbhid.c.orig   2012-10-06 15:52:16.032673677 +0200
+++ ./drivers/macintosh/adbhid.c        2012-10-06 16:23:23.708911092 +0200
@@ -798,7 +798,7 @@

                memcpy(hid->keycode, adb_to_linux_keycodes, sizeof(adb_to_linux_keycodes));

-               printk(KERN_INFO "Detected ADB keyboard, type ");
+               printk(KERN_INFO "Detected ADB keyboard, type (%x) ",original_handler_id);
                switch (original_handler_id) {
                default:
                        printk("<unknown>.\n");
@@ -807,11 +807,19 @@

                case 0x01: case 0x02: case 0x03: case 0x06: case 0x08:
                case 0x0C: case 0x10: case 0x18: case 0x1B: case 0x1C:
-               case 0xC0: case 0xC3: case 0xC6:
+               case 0xC0: case 0xC6:
                        printk("ANSI.\n");
                        input_dev->id.version = ADB_KEYBOARD_ANSI;
                        break;

+               case 0xC3:
+                       printk("ANSI (iBook G4 German).\n");
+                       input_dev->id.version = ADB_KEYBOARD_ANSI;
+                       hid->keycode[0x32] = KEY_102ND; /* German: left of Y, less/greater */
+                       hid->keycode[0x0a] = KEY_GRAVE; /* German: left of 1 */
+                       hid->keycode[0x34] = KEY_RIGHTALT;
+                       break;
+
                case 0x04: case 0x05: case 0x07: case 0x09: case 0x0D:
                case 0x11: case 0x14: case 0x19: case 0x1D: case 0xC1:
                case 0xC4: case 0xC7:

Thursday, October 04, 2012

Facts about my Dishwasher

Things I learnt about my dishwasher today:

  • It has a Mitsubishi M38503M4-722FP micro controller with 512 byte RAM and 16kByte of mask-programmable ROM, which, frankly, is quite a lot for doing the dishes.
  • There is a debug-connector with serial port Tx/Rx, GND and Vcc on the side of the controller PCB, but there's no signal on the pins it because apparently the controller is broken.
  • It has probably be killed by overvoltage, more precisely by the kind overvoltage that also made the (I assume) 7805 on the other PCB explode violently.
  • 7805 tend to explode violently if a power-relay next to it shorts, and burns through half of the PCB, and I assume it did so with a ball of conducting gas or plasma generated under the relay, feeding 230V AC to what previously was a +5V Vcc line.
  • PCBs that short and burn through half of the material make the whole kitchen stink like burnt electronics.
  • I think need a new controller for my dishwasher.