Back in February this year I added Multiboot support to NetBSD/i386. Unfortunately, the implemenation was quite hackish because it required the application of a patch to GRUB-Legacy: the code used the "a.out kludge" present in the Multiboot specification which this bootloader incorrectly omitted in ELF kernels; the patch fixed this issue. However, this prevented booting NetBSD with mainstream GRUB builds (those used by all Linux distributions), thus making this feature mostly useless.

The need for the "a.out kludge" came from two different problems:
I've now finally fixed this long-standing issue appropriately. All the code to create the minimal ELF image is gone and instead the kernel simply moves the data passed in by GRUB to a memory region that is available after bootstrapping. Then, it uses a custom function (ksyms_init_explicit instead of ksyms_init) which does not need any ELF headers to initialize the ksyms.

The results are much clearer and less error-prone code as well as the ability to boot NetBSD straight from a stock GRUB installation! Keep in mind that this will go into 4.0, so setting up dual-boot machines will be easier than ever :-)

I've prepared a couple of screenshots for your pleasure. First, a look at the configuration used to boot a Multiboot-enabled NetBSD kernel:
And then a look at the messages printed by the kernel as well as a demonstration that ksyms work by invoking a backtrace in the debugger (ddb):

Subscribe via RSS · Go to posts index

   Delivered by FeedBurner

Comments from the original Blogger-hosted post: