Creating a bootable PXE image from a dos utility firmware updater

9,001

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.

Share:
9,001

Related videos on Youtube

Wilshire
Author by

Wilshire

Updated on September 18, 2022

Comments

  • Wilshire
    Wilshire almost 2 years

    I was wondering if it was possible to make a PXE bootable image from a dos utility firmware. For some specifics the firmware updater is usually to be installed on a USB stick. I have all the flat files. Should I be fine just dumping the flat files on my tftpboot server and then just adding in the proper bits for the pxemenu or is the process a bit more involved?

    I found FreeDOS but they do not supply a bigger image than 1.44MB which is an issue because the firmware rom alone is 5MB in size. I tried creating a larger image using these steps but have not had any success as each time I go to boot into the image it does not display the usual FreeDOS menu (it only prints out FreeDOS and gives no command prompt).

    EDIT: I was able to get the rom running off the FreeDOS image from here but of course when running the rom it says that the rom is corrupted because the entire rom is not actually on there and is only partially there due to there being only 1.44MB of space on the image. To further complicate things the rom will only run when himem.exe and emm386.exe are running (they are started by selecting the second option on FreeDOS).

    EDIT2: I finally got the USB stick to work after adding the flat files to the stick and the COMMAND.COM from a custom freedos usb stick I found. Still with copying the files to a USB image and trying to boot from PXE it refuses to boot.

    • mailq
      mailq almost 13 years
      Do you want my working image that I created like described below?
    • Wilshire
      Wilshire almost 13 years
      Would be helpful in trying to test this out before I go out and just buy a handful of usb sticks to update our 900 machines.
    • mailq
      mailq almost 13 years
      The image file is located at ubuntuone.com/p/18gb
  • Wilshire
    Wilshire almost 13 years
    funnily enough the HPQUSB.exe utilty just copies in an IBMDOS program that is only 21k large and then continues to copy all files from the spxxxxx.exe directory until the stick is full. So trying that route is a bust since HP is incapable of making a proper USB drive program.
  • mailq
    mailq almost 13 years
    And it gets even better. I just figured out that you can even have a gziped image to boot via iPXE.
  • Andre de Miranda
    Andre de Miranda about 8 years
    Also note that if you are using VirtualBox you can use "VBoxManage internalcommands converttoraw" instead of dd