I said I'd never blog

DeforaOS, NetBSD, reverse-engineering and stuff

Older stuff...

DeforaOS/NetBSD
Tue Jun 26 19:01:25 CEST 2007

DeforaOS/NetBSD just worked for the first time. The issue was simply that the NetBSD kernel does not automatically opens the standard file descriptors (stdin, stdout and stderr) when spawning the first process (usually init).

Consequently, new screenshots, downloads, and stuff should be available shortly. This is going to be an extraordinary source of motivation to fix bugs, finish the current tools and implement new ones.

Insomnia can be awesome
Wed Jun 20 18:30:35 CEST 2007

...when you wake up in the middle of the night with cool ideas and don't have to go to work afterwards and forget everything about it when you're back (or realized in the meantime that it sucked anyway). So I was (again) dreaming about code and managed to wake up, get up and do it. Nothing spectacular, but finally a decent linking system on the DeforaOS website. Automated web leeches should like it better. Rate, rant, rank, rack, track (ok I need some sleep now).

OpenBSD on the zaurus
Mon Jun 18 23:02:54 CEST 2007

I am finally giving it a try. I have to if I want to install NetBSD on it anyway. During this process I got stuck while trying to boot OpenBSD from the Linux system: the device would simply shut down instead. The following steps helped:

  • mount / read-write
  • copy bsd.rd from the root filesystem
  • unplug the power supply
  • unmount /hdd1, /hdd2 and /hdd3
  • disable OpenBSD as the active partition

I cannot exactly tell which one(s) actually had an influence, but I suspect the first or the third.

About a MIPS
Sun Jun 17 14:25:53 CEST 2007

Just a few random facts about MIPS assembly:

  • there is no delay slot
  • you have to name the registers yourself
  • the destination operand comes first
  • multiply and divide instructions are apparently available
  • some instructions can apparently prevent others from working correctly (eg mfhi and multiply/divide)

Update: I am not so sure about the delay slot now, maybe some assembly programs are actually handling it transparently. Carefully check this!

You will be attached, too
Sun Jun 10 14:32:08 CEST 2007

Again, I am having trouble with a NetBSD driver I am trying to write. I don't know why I even started to write a driver for a card whose vendor is dead, with nothing but reverse-engineering notes left as documentation, or partial drivers for Solaris or FreeBSD or FreeBSD again (!).

Thankfully the ALSA project seems to have gotten it quite right, even if I am not a big fan of the project in the first place, and don't really like the way they wrote the driver. I cannot base my effort on this code though, for obvious licensing issues.

So there I was with the FreeBSD code as a base, which I did not realize soon enough that it did not support playback in the first place. Duh!

Anyway, I cannot resist to post here the result of what I have achieved so far:

vortex0 at pci0 dev 12 function 0: Aureal Semiconductor AU8830 Vortex 3D Digital Audio Processor (audio multimedia, revision 0xfe)
vortex0: interrupting at irq 11
vortex0: ac97: SigmaTel STAC9704 codec; 18 bit DAC, 18 bit ADC, SigmaTel 3D
vortex0: ac97: ext id ffff<SECONDARY10,SECONDARY01,AC97_23,AC97_22,AMAP,LDAC,SDAC,CDAC,VRM,SPDIF,DRA,VRA>
vortex0: ac97: Slot assignment: 10&11, 3&4, 7&8.
vortex0: Ignore these capabilities.
vortex0: attaching audio
audio0 at vortex0: full duplex, mmap, independent

And the mixer says:

outputs.master=127,127 volume delta=8
outputs.master.mute=off  [ off on ]
outputs.mono=255 volume delta=8
outputs.mono.mute=on  [ off on ]
outputs.mono.source=mixerout  [ mixerout mic ]
inputs.speaker=255 volume delta=16
inputs.speaker.mute=off  [ off on ]
inputs.phone=191 volume delta=8
inputs.phone.mute=on  [ off on ]
inputs.mic=191 volume delta=8
inputs.mic.mute=on  [ off on ]
inputs.mic.preamp=off  [ off on ]
inputs.mic.source=mic0  [ mic0 mic1 ]
inputs.line=191,191 volume delta=8
inputs.line.mute=off  [ off on ]
inputs.cd=191,191 volume delta=8
inputs.cd.mute=off  [ off on ]
inputs.video=191,191 volume delta=8
inputs.video.mute=off  [ off on ]
inputs.aux=191,191 volume delta=8
inputs.aux.mute=off  [ off on ]
inputs.dac=191,191 volume delta=8
inputs.dac.mute=off  [ off on ]
record.source=mic  [ mic cd video aux line mixerout mixeroutmono phone ]
record.volume=0,0 volume delta=16
record.volume.mute=off  [ off on ]
outputs.spatial=off  [ off on ]
outputs.spatial.center=0 volume delta=16
outputs.spatial.depth=0 volume delta=16

...but the sound output is still quiet, the network interrupt clicks apart.

Well now, who cares if it does not work, right? Well well, I am currently documenting my effort. It takes a hell of a lot of time, but for now it's better than a non-working driver. So yeah, here it is, the writing an audio device driver for NetBSD tutorial.

IBM ACPI driver for NetBSD is stalled
Sun Jun 10 14:15:03 CEST 2007

For a number of reasons, I could not really finish my IBM ACPI driver for NetBSD. I no longer own any laptop for at least another month now. Moreover, it seems that different IBM/Lenovo laptops handle hotkeys differently, as an example on the X60 of a friend the Fn+F5 key already enables/disables bluetooth support, without the help of a driver. I wonder what else can differ like this.

Maybe that's a reason why the original Linux driver simply generates ACPI key pressed events, and then it's up to the user to glue it to actual calls. This scheme also helps with the differences that may be found printed on the keyboards. Why aren't there simply ACPI callbacks like FN01 to FN12? Something similar seems to be found in my DSDT but I couldn't really tell if it worked, let alone test it on other systems.

It could also be that my T60 was flawed. I had the weirdest errors with the internal wireless card's driver, which was working properly on the X60...

I will try to fix all of this again when I get a new Lenovo laptop, if I have the chance.

Come back...
Creative Commons License