Creating a bootable PXE image from a dos utility firmware updater

Solution 1:

You can see a step-by-step tutorial here: http://www.smop.co.uk/mediawiki/index.php/PXE_booting_floppy_images

Or try to search for "boot ISO via PXE", "boot DOS via PXE", etc.


Extended edit

The following is tested and working.

All you need is the Full FreeDOS ISO, a recent Linux LiveCD, an installed Linux and a Virtual Machine.

Then this is what I did:

  1. Create a virtual machine with a harddisk of only 20 MB size, also attach the Full FreeDOS ISO as a CD-ROM.
  2. Boot the virtual machine from the FreeDOS ISO and install the minimal version of FreeDOS on the virtual harddisk.
  3. Make sure that you partition and format the harddisk with the provided FreeDOS tools during install. The disk should be bootable and formatted as FAT16.
  4. Eject the ISO image and try to boot from the virtual harddisk. Repeat the steps until it successfully boots into the virtual harddisk. For me it only works with 3rd FreeDOS boot option, but you should try all of them.
  5. Attach the Linux LiveCD to the virtual Machine and boot the LiveCD. Then mount the virtual harddisk somewhere in the filesystem.
  6. Transfer the needed DOS tools onto the mounted harddisk. Either via HTTP, SCP, FTP, SMB or even via a real USB flashdrive. It is not necessary but recommended to create a subfolder of the virtual harddisk and put the files in it. You should have extracted the files externally or within the Linux LiveCD system. Make sure that you do not overwrite any FreeDOS files on the harddisk.
  7. Unmount the virtual harddisk.
  8. Create a disk image of the virtual harddisk with dd if=/dev/sda of=/tmp/freedos.img (replace /dev/sda with the correct device name of the virtual harddisk)
  9. Transfer the image /tmp/freedos.img to a real machine (SCP, SMB, FTP or whatever).
  10. Shutdown the Linux LiveCD system, eject the LiveCD image, reboot and try to boot back into the FreeDOS harddisk (not the image).
    If it works and you see the copied programs everything is fine and you can shutdown the system again. If not, repeat from step 5).
  11. If you have an installed Linux somewhere, then try to install the syslinux package. This is easier then compiling your own binaries or download precompiled images from somewhere.
    After the install locate the memdisk binary in the filesystem. Mine was at /usr/lib/syslinux/memdisk.
  12. Transfer memdisk and freedos.img to the tftp server of your PXE environment and configure it with the following configuration entry.

.

label freedos
menu label FreeDOS flash environment 
kernel memdisk
append initrd=freedos.img harddisk

Boot via PXE and enjoy FreeDOS from network.


As an exercise for the reader you should try iPXE which is an Open Source PXE firmware. With it you can skip all the tftp/PXE crap and instead boot via HTTP! In this case you can boot from the iPXE boot loader and enter the following commands:

dhcp
imgfetch http://192.168.1.1/freedos.img
chain http://192.168.1.1/memdisk harddisk

dhcp gives you any IP from your DHCP server just to communicate with 192.168.1.1 or whatever your (internal) webserver is. You could also set a static IP instead. The other commands download and install the bootloader and the disk image from HTTP and then boot the image. Impressive.