Saskatoon Linux Group | RecentChanges | Preferences

These are my notes from a presentation I did to the SLG in July 2001. I don't know if they're still useful, but I figured I'd put them here for historical purposes, if nothing else.



      Etherboot is a package to create boot ROMS for ethernet cards to
      enable diskless booting of x86 machines.


      I'm working on a linux-based controller for my underground sprinkers.  
      I thought it would be nice to make it diskless to reduce power 
      requirements, reduce noise, and make it more reliable.  (Disks die.)


      Etherboot requires several pieces to all work together.  The etherboot
      ROM itself is inserted in the ethernet card (or simply place on a 
      floppy disk with dd).  The boot ROM initializes the ethernet card over
      DHCP -- meaning you need a functional DHCP server on your network.  
      The DHCP reply contains information about where the boot ROM can find
      its kernel.  The ROM then uses tftp to download the kernel from the
      tftp server and finally passes control to the kernel.

Step 1:

      I downloaded and unpacked the etherboot sources.  I read the 
      documentation and found a link to a website called rom-o-matic:
      where you can fill out a web form and it will return a rom built
      to your specifications.  I made a default ROM for my NE2000 clone NIC.

      I burned the rom into an eprom (27C128) put it in the isa card, and
      place the card in the system.  On boot, nothing special happened.  I
      ran the configuration utility for the card and enabled the boot-rom.
      On the next boot, the ROM responded with:
      Boot from (N)etwork or (L)ocal?
      It then probed the NIC's io address, got an IP address via DHCP, and 
      tried to download /tftpboot/kernel from the DHCP server.  (That's the
      default if the dhcp reply didn't contain a location for the kernel.)

Step 2:

      I configured the DHCP server to pass the required information to the
      boot ROM.  I added:
                host bootrom {
                  hardware ethernet xx:xx:xx:xx:xx:xx;
                  filename "/tftpboot/dos622.nbi";

      "next-server" indicates what machine to get the kernel from.  If 
      omitted, the boot ROM will try the DHCP server.  
      "filename" indicates the filename of the kernel on the tftp server.

Step 3:

      I took a standard DOS 6.22 boot floppy, and "dd"ed it to a file on
      the hard drive.  I ran mknbi-dos on it, which adds some header 
      information which the boot ROM will use.  I put the resulting file 
      in /tftpboot/dos622.nbi

Smoke test:

      I booted up the machine with the boot rom.  This time, it got its
      kernel from /tftpboot/dos622.nbi and I got the familiar date and time
      prompts from DOS.

As a next step, I built a boot floppy using MS-Client 3.0 which would mount C: over the network from a SAMBA server. I replaced dos622.nbi with this disk image. I built a small C: drive on my linux box and shared it via samba.

This was all cool, but I really wanted to net-boot linux. I did more reading.

Step 4:

      I built a kernel containing the ethernet driver for my ethernet 
      card, nfs, and root as nfs.  I ran mknbi-linux on this kernel and 
      placed it in the /tftpboot directory.  I added a "fixed-address" line
      to dhcpd.conf (not necessary, but I wanted it that way.) changed the 
      filename for the kernel and added a line indicating the location of
      the root filesystem.  The format of the option root-path changed 
      from DHCPD v2 to v3, but the documentation hasn't been updated.  In
      the old way, the nfs server was included in the root-server option.
      ( "")  I spent quite a while
      trying to figure out why my kernel couldn't nfsmount 
      "" until I took a closer look. 
      in DHCPD v3, the server sends the current "next-server" as the part
      to the left of the colon.  My host section now contained:

         filename "/tftpboot/zImage.nbi";
         option root-path "/tftpboot/";

Step 5:

      I found a small (~8MB) linux distribution called LEM.  I untarred it
      into /tftpboot/ and tried booting.  LEM was set up for
      a fixed IP address, so I had to add dhcpcd and adjust the init scripts.
      I got it to boot, but it would always hang just as it entered 
      multi-user mode.  I finally figured out that LEM is compiled with
      pentium optimization, and I was using a 386.  Instead, I followed the
      steps in Bruce Perens' articles in Embedded Linux Magazine (Issues 00,
      01, 02) to build a small linux distribution.  (His is designed for a
      boot floppy.  I modified it slightly.)  I booted the diskless machine
      and it worked.

Other stuff:

      I also played with boot menus.  By adding options lines in dhcpd.conf
      you can offer a list of kernels to choose from.  I played with 
      password protecting a kernel -- the boot ROM requires a valid 
      password before booting the selected kernel.  (It's not much security...
      a boot ROM compiled without password support will happily boot the
      password protected kernel.)

To Do:

      Apparently, the boot ROM passes the dhcp response to the kernel.  It 
      should be possible to avoid using DHCP a second time but rather 
      use the info from the first DHCP reply. 

Saskatoon Linux Group | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited July 25, 2005 11:59 am (diff)