Subject: Real mode kernel bootstrapper
To: None <port-i386@netbsd.org>
From: Claus Andersen <clan@wheel.dk>
List: port-i386
Date: 10/01/2000 18:00:25
Hello,

Handling of PXE has been dicussed several times (especially on
tech-install) and there seems to be three general ways to go about this:
1) Use Grub.
2) Use Etherboot.
3) Use Intel "demo" code and load a 1.44Mb floppy image.

I am currently using method 3 to prepare computers for installation. I do
however feel it's a bit of a kludge and I would like an alternative. 1 & 2
might be a little more streamlined but it doesn't quite fit the bill in my
mind.

There has previously been put a lot of effort into writing bootcode for
various networkadapters (/usr/src/sys/arch/i386/stand/netboot) but as far
as I can see PXE is still left out in the dark.

This does however require a _little_ coding but as the !PXE API use the
Microsoft 16-bit C/C++ __cdecl parameter format we should be able to avoid
pure assembler programming.

All what would be needed as I see it would be a small real mode code
sniplet doing something like this:

1) Check for !PXE at int 1Ah
2) Use PXENV_TFTP_READ_FILE (0023h) to download a kernel
3) Do "magic"/clean-up to jumpstart the kernel

Unfortunately apart from having strange ideas like this I am a pretty
clueless person. I haven't got a clue how to "jumpstart" the kernel. I
have been looking at the netboot and dosboot code without much
enlightenment.
I have a feeling that for the right person it should be fairly easy to
hack dosboot - but alas - I am not said person.

If the above bootstrapper could be done it should be easy to expand it
with PXENV_GET_CACHED_INFO (0071h) so bootservers etc. wouldn't be
hardcoded.

I believe my idea would be pretty straightforward to implement but it
needs quite a bit of lowlevel knowledge of the i386 platform.

If anyone would be willing to write a code skeleton for this I would be
happy to test/document it and write a whitepaper/redpiece on how to do
prestine installs of PXE enabled computers using NetBSD.

Comments, flames and friendly hackers are more than welcome :-)

Kind Regards,
Claus Andersen