HOWTO Create a DOS boot disk
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
[edit] Introduction
This article shows how to create a bootable DOS-floppy or CD without using non-free software. Originally the article was only about the floppy-method, but has been updated to accommodate for the CD-method as well, since not everyone has a floppy-drive anymore.
[edit] Background
While many Linux users don't normally need to boot into DOS (or any other OS for that matter) once in a blue moon it may become necessary - a BIOS update, perhaps being the first thing that comes to mind. That's what I needed to do anyway, and I was surprised at how hard it was to find software - or even instructions that allowed one to perform such a (seemingly) trivial task. The reason for this I suppose is that even most of the hard-core Linux-geeks have some old Windows 98 floppy lying around, and will use this, because it's so simple. I, however wanted to do it without any help from Redmond, and it turns out it's pretty simple, once you know how...
[edit] Requirements
This article requires an x86-compatible computer with a 1,44MB 3,5" floppy drive, or an optical drive capable of burning CD-R(W) media. A functioning Linux-installation is also assumed. For the CD-method root access is needed, for the floppy-method the user needs to be a member of the "floppy"-usergroup.
[edit] Setting up
In order to create the boot disk you will need a boot disk image. For this guide we will use a FreeDOS image. FreeDOS is open source, and a premade usable image can be found at www.fdos.org. There are several images to choose from, but for this guide we'll assume that you want to upgrade your BIOS, in which case you'll want nothing but the OS plus the new BIOS and flashing tool provided by the motherboard manufacturer on your floppy. In this case you should download the file named "FDOEM.144.gz". (Once downloaded you can keep it on your hard disk, and use it whenever you need a boot floppy.)
[edit] Creating the disk (floppy-method)
To create the disk you must first unpack the image file:
gunzip FDOEM.144.gz
Next insert the floppy you want to write to into the floppy drive. (Note that any data on it will be irreversibly erased.) Then issue the following command:
dd if=FDOEM.144 of=/dev/fd0
If your floppy (for some odd reason) isn't /dev/fd0 then you obviously need to replace that part with the correct path. Once you get it writing just wait (and wait, and wait) until it's finished. You may then mount the floppy and copy the BIOS + flash-tool onto it. That's all there is to it. Reboot, flash, and enjoy your new BIOS.
[edit] Creating the disk (CD-method)
To create the disk you must first unpack the image file:
gunzip FDOEM.144.gz
Since the image will be modified when using this method you may want to make a backup copy of it, and store it someplace safe, ready to reuse when needed.
For the following procedure to work you need to have the following option enabled in your kernel, either complied-in or as a module:
| Linux Kernel Configuration: 2.6.x |
Device Drivers --->
Block devices --->
<*> Loopback device support
|
Next open up a root-console. If you don't yet have a directory where to mount things temporarily, create one:
mkdir /mnt/temp
If you compiled the loopback device support as a module you will then need to issue the following command (if it's compiled in-kernel you can skip it):
modprobe loop
Next, it's time to mount the freedos-image:
mount -o loop -t vfat FDOEM.144 /mnt/temp
When that is done copy the flashing tool and the new BIOS to /mnt/temp. (The code isn't listed, because the filenames vary depending on the motherboard manufacturer, model and BIOS in question, but you should be able to figure it out.) :-) Then unmount the image:
umount /mnt/temp
We are now ready to proceed with creating an ISO-image from the floppy-image:
mkisofs -o Bootable-CD-image.iso -b FDOEM.144 FDOEM.144
Almost done. Now you just need to burn the image with your favourite CD-burning software, then reboot from the CD, flash & enjoy.
