Subject: Multiboot support for review
To: None <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 01/31/2006 21:19:21
Hi all,

after some hacking days, I've finally got some code to make NetBSD
Multiboot-compliant.  We already discussed this here and all I got
was positive feedback:

	http://mail-index.netbsd.org/tech-kern/2005/12/28/0008.html

The patch still needs some cleanup and bug fixing (specially testing
that several things work after the changes) but, while I do those,
I want to ask for feedback because the code won't change that much.
The preliminary patch is at:

	ftp://ftp.NetBSD.org/pub/NetBSD/misc/jmmv/multiboot.diff

Here come some things I'd like to discuss:

- In the past days, someone suggested the idea of adding a textual
   data representation to pass variable/value pairs between the kernel
   and userspace.  I've had to do something similar to pass some boot
   information between GRUB and the kernel, and hence implemented such
   an interface.

   It is currently very, very simple, but it may do the job in the
   cases where it's needed (e.g., mount(2) arguments).

   It is named 'optstr' and is implemented in sys/optstr.h and
   kern/subr_optstr.c.  See the manual page in the patch file.

- I think that this Multiboot thing is applicable to amd64 too,
   although I'm not completely sure.  Could it be better to place
   the new files (multiboot.[ch]) in x86 rather than in i386 so
   that they do not have to be moved in the future if multiboot
   support is added to amd64?  (It should be a matter of adapting
   its locore.S file.)

- If you take a look to the setup_bootdisk function in multiboot.c,
   you'll notice a hack.  Ideally, I'd use the x86_alldisks table.
   But to do that, I'd need to add a call to setup_bootdisk from
   x86's cpu_rootconf function (between the call to matchbiosdisks()
   and findroot()).

   I don't know how to do this if the multiboot files live in i386
   because the generic x86 code would be calling i386-specific one.

- Anything else you notice.

Thanks.

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/