Wow!

I have made an incredible amount of progress on KQEMU for NetBSD in the past two days. I wrote a small prototypical device LKM to test, and everything else has fallen into place. Lots of stupid errors were vetted this way.

As I started testing compilation today, I was a little distraught to find

  1. The Lunix-binary kqemu-mod-i386.o had, at some point, been deleted from my working source tree.
  2. kqemu-1.3.0pre9.tar.gz (the version I was developing against) is no longer available for download anywhere that I can find.
  3. kqemu-1.3.0pre11 was failing to build natively on NetBSD (with errors regarding inline assemly & registers.

But, (3) was very easily resolved by trying to build on my -current machine instead of NetBSD-2.1.

At this point I have some apparently minor uvm(9) stuff to clean up; and then it's on to testing ;)

2007/04/21 00:47

I had been keeping some half-notes on porting KQEMU on my work wesite, but I don't really see that site staying in tact too much longer in its current form. Now that olix0r.net exists, it seems better to keep all of my notes on development in one place.

The following is generally a recap of the work done between 2007/01/10 and 2007/02/07.

  • Reformat kqemu-freebsd.c (rev 1.6) while trying to get a feel for the work needed to be done
  • Translations from FreeBSD interfaces:
    • module(9) -> lkm(9)
    • vm(9) -> uvm(9)
    • scheduler(9) -> scheduler(9)
    • proc(9)/thread(9) -> lwp(9)

Since then, I have been reading (albeit, sporadically) both BSDs' bpf(4) implementations in order to compare the way in which devices are cloned. I've grokked most of it, but there were a seemingly minor difference that were nagging me, which I have since chalked up to bpf(4) implementation differences (rather than API differences).

This evening, I sat down and tried to finish the rest of the KQEMU port. At this point, it's not quite compiling, but I believe all of the interfaces have been translated appropriately. There are several bizarre compile (#include!) errors that I have to mitigate before I can start testing KQEMU.

Now that I look back, it's surprising how little work I had remaining. It was really all about getting throught the bpf(4) code. Really, what I had to do was use the file(9) interface to clone the KQEMU file pointer. This is implemented with a list (from QUEUE(3)) of KQEMU instances.

Tired- but pleased ;)

2007/04/14 22:04
THE MEATENING!! -- I strongly suggest that you do not send mail to that link.