I needed a bootable FreeDOS USB stick. It's a bit of a problem to make on OS-X for a number of reasons that I'll skip. I discovered that FreeDOS is included in the SystemRescueCD (SRCD) (which I wanted a copy of anyway), so I decided to make a bootable SRCD USB stick instead. Here's what I did:
- I used a 4GB USB stick. Zeroed out the partition info via dd if=/dev/zero of=/dev/foo/bar count=1000.
- Download the SystemRescueCD iso image.
- Create a new VirtualBox (VB) machine. When setting it up, tell it to use an existing drive, and point it to the SRCD iso image. Make sure that this CD image is setup as the IDE primary master.
- Edit the VM's USB settings and add a filter to accept all new USB devices. This is so it will get to see your USB stick when you insert it in a subsequent step.
- Start the SRCD VM, which will boot from the CD image. You'll get a menu of options. Boot SRCD with the default options.
- Insert your USB stick.
- When you run sysresccd-usbstick listdev, your USB stick should appear in the list of devices found. If, for some reason, OS-X grabbed the stick instead and mounted it, use diskutil to eject the stick. Try listdev again.
- Run sysresccd-usbstick dialog, your USB stick should should appear in the dialog. Select your stick then press OK. The install will begin.
- When the install completes, you can exit VB. When you do this, OS-X will likely mount your newly created bootable stick automatically.
How to get to FreeDOS
When you boot from the stick, you'll see nothing about FreeDOS. Hit the escape key. At the command line prompt, type freedos, then return. Voila.
The best thing to do is to test the stick from a real PC (not a mac).
Testing from VirtualBox
Don't have a real PC, but want to test your bootable stick anyway? Use VirtualBox.
- Run the command: VBoxManage internalcommands creaerawvmdk -filename foo.vmdk -rawdisk /dev/disk2, where disk2 is the device associated with your USB stick. If OS-X has the SYSRESC filesystem mounted from the stick, you may need to unmount it before the command will work.
- Create another VB VM. Set the primary IDE harddrive of the machine to the file foo.vmdk you created in the previous step.
- Start the VM. You'll be running your bootable stick in VB.
Additional Tools with FreeDOS
I wanted to have some additional files on the stick that would be used to flash hard drive firmware. Modifying the contents seemed too involved for the moment, and I punted. I got a second USB stick to place my extra files on.
But how to access a USB stick from FreeDOS? This seems to be an answer: http://hddguru.com/software/2006.02.09-USBASPI-MS-DOS-Driver/