NILO architecture

Note: The NLNet NILO project has expanded requirements over the original NILO concept below. It need not follow the implementation suggestions below; that and others will be decisions to be taken by the implementor. Therefore the technical discussion below is for historic purposes and is not binding on the NLNet NILO project, and should be read in that light.

What is NILO ?

NILO is the Network Interface Loader project. It will build on the Etherboot and Netboot efforts. It will, in rough order of desirability:

How will it be done ?

NILO will consist of three portions. The main part of the program will control the BOOTP/DHCP address resolution and the TFTP loading process. The second part comprises the protocol handlers and is interfaced through a jump table or interrupt entry points to the first part. The third part is the device driver.

Why three parts? In order to support many devices the device driver is separate, naturally. To support separate testing of the booting code and device drivers we need a split at the protocol level. This will allow a version of NILO to run as a user process on Linux, interfacing to Linux system calls.

NILO architecture

Additionally, by splitting off the protocol code, it will be possible to load secondary loaders that use these services. This will make it possible to move code for enhancements like menus and similar features into secondary loaders, thus keeping the primary loader small. It will always be possible to do basic netbooting with the primary loader though. In the diagram above, the secondary and following loaders will take over the role of the main control program but the protocol handlers and driver remain active. If the memory for the main control can be reclaimed, all the better.

The Linux network device drivers will be compiled from source. A goal is to not edit the driver source at all. So we have to provide stubs for the functions that the drivers call, or include files for macros. In other words a harness for the device driver needs to be built. I have done some initial experiments with the driver code and the main areas of difficulty seem to be:

A lot of code can be recycled from the Etherboot project. And of course, the mknbi utilities from Netboot will be used.

There seems to be some a package called OSKit here that could be used for wrapping the Linux device drivers. An alternative site for the old release until the new release appears.

How will the project be run ?

I propose to run the project in a bazaar fashion, following the nomenclature that Eric Raymond used. I will keep the latest snapshot at this site. Each snapshot will be dated. (I do not expect to upload more than once per day.) Anybody is free to take the snapshot and hack on it and send me the changes. In addition, this Web page will contain a LOG and TODO section which can be updated by anybody so that people can see what is going on. I expect that in the beginning things will be very raw and then, depending on the level of hacking interest, useful things will emerge.

Distribution

Latest snapshot.

How does this datestamping of the distribution work? In the Makefile you will see a macro that uses a small Perl script to provide a 8 digit date code depending on the last update time of README. Therefore after edits have been made to the code, update the README and then run make clean archive which will remove the temp files, then produce the tarball.

Status: There are two main build targets in the Makefile at the moment. One builds nilo, which is a user level program (but needs to run with root privilege) that will go through the bootp and tftp steps, printing status. The server IP address and MAC address are set with environment variables. In the bootptab that MAC address must correspond to the IP address of host nilo is run on or the reply will not be seen. The other builds a bootrom for an arbitrary card. Lots of harness routines are missing. I want to get nilo working first so that people like Vlad can put in DHCP and other goodies. For sure I have made some mistakes in the partitioning of the mainline from the protocol handler (the latter must not rely on global variables or routines as it can be called from a secondary boot), but we can correct things as we go.

ChangeLog

19980429

Started on version that runs as user level program on Linux

19980522

Got the first version which does bootp and tftp

19981109

Ok, I've started hacking NILO again. I'm going to try to get one NIC working. I've chosen the 3c509 as the first guinea pig NIC. I've got the probe routine working. I've hooked up the oskit memory manager routines, allocating from the top 1 MB of memory. Things that need attention: loops_per_sec needs to be set to a roughly correct value so that udelay works well (later). Need to hook up interrupt to handler. Need to figure out how to fill the skb before passing to the xmit routine. Then try to transmit one packet.

19981111

I think I have skbuffs and interrupts figured out. I have the concept down in my mind now. Currently stealing code from Linux kernel for IRQ handling. Also the RTC reprogramming is there too.

19981116

Put in more of the protocol handling code. Ironed out some problems with memory allocation. We need a different IDT for protected mode. Etherboot/32 skirted this issue by disabling interrupts in protected mode, so the RTC was only updated when calling real mode routines, like currticks.

TODO

Issues to think about

Why a new network booter? Aren't Etherboot and Netboot good enough?

Etherboot suffers from these disadvantages:

Netboot suffers from these disadvantages:

NILO will have some disadvantages too: