Diskless DOS Floppy Image Boot Using PXE

Date July 26, 2006 by Isaac

Most of the clusters of servers that I administer are diskless -- they receive their boot images over the network using PXE. These are Linux clusters, and the diskless nodes all boot Linux images, however, a couple months ago I had need to boot a DOS disk image. This is very similar to a Linux image, but it is enough different that I had to perform many Google searches to finally figure it out.

Let's back up a bit. Let's say you have one master computer node and want to boot a whole bunch of diskless cluster nodes. The master node will need to be setup both as a DHCP and TFTP server. The diskless nodes also need to have a PXE enabled ethernet card. The boot sequence is basically:

  • Node powers up and sends DHCP request
  • Master sends acknowledgment containing:
    • IP address that is assigned to the node
    • The path of the boot image
  • Node requests boot image using TFTP protocol
  • Node boots off image

So, in order for this all to work you will need a working DHCP server and a TFTP server. I won't cover the details of setting up either, but I will give a little snippet of the DHCP configuration that you'll need. My configuration assigns specific IP's to specific machines based on the MAC address, so that's what I show below. Note, this isn't a complete dhcpd.conf file, just a snippet.

group{    filename "/path/to/pxelinux.0"

    host somecomputername    {        hardware ethernet 00:11:22:33:44:55:66;        fixed-address 10.100.10.1;    }

    host anothercomputer    {        hardware ethernet AA:BB:CC:DD:EE:FF;        fixed-address 10.100.10.2;    }}

So, there you go; the piece of the DHCP config needed to tell the node what to boot. The TFTP server will take care of getting the actual image to the machine.

Now, on to the main topic...

The first thing you'll need is a DOS boot image. The easiest way to get this is to format a bootable DOS floppy, load it with the software you need, and edit the autoexec.bat to start up your desired program. It's very important that this floppy is bootable.

I know that there are various Windows based programs to create an image from this floppy, but since I'm a Linux man I'll show you how to do it under Linux.

On the Linux command line type:

dd if=/dev/fd0 of=boot.img

That's it! The dd program just reads the raw data into the boot.img file. You'll have to adjust the command line if your floppy is a different device than fd0.

Now that you've got a disk image you need to install Syslinux. The parts of the package that you're interested in are PXELINUX and MEMDISK. Build and install Syslinux according to the instructions on their web site.

Now, create a directory somewhere that will house your boot images. Be sure that your TFTP server can see this directory.

mkdir /bootdirmkdir /bootdir/pxelinux.cfg

Copy the files pxelinux.0, memdisk, and boot.img into the /bootdir directory. In the directory /bootdir/pxelinux.cfg create a file called default. The contents of this file are:

DEFAULT dos

LABEL dos    kernel memdisk    append initrd=boot.img floppy=0

Your final directory layout should be:

/bootdir   +- pxelinux.0   +- memdisk   +- boot.img   +- /pxelinux.cfg         +- default

Now, if all goes well and DHCP and TFTP are setup correctly then you can turn your diskless node on and watch it boot into the DOS image. It's pretty cool actually. Oh, be sure to restart your DHCP server to force the new config settings to take effect.

Good luck!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>