DOS boot from GRUB



If you are running linux and you are wondering how to boot DOS without using boot floppy or CD image keep reading :).

This article will also help to those people, who want to flash their BIOS without making a boot floppy or CD or DVD or whatever.

You can download either FreeDOS or MSDOS or whatever DOS version you want.
All you need is plain .img image. I will show you how to do this using FreeDOS, but it should be pretty similar for other DOS versoins.

You can download FreeDOS image from here:
http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
Or MSDOS image from here:
http://www.allbootdisks.com/

1. Download the fdos and the files you theoretically would want to put on a floppy.

2. Install syslinux (dos floppy bootloader):

On redhad based distros this is pretty straight forward:

yum install syslinux

I guess that almost all distributions have this package
Create DOS directory and copy bootloader/diskimage

3. Create a directory for DOS stuff and copy the bootloader and the disk image there. memdisk may be elsewhere on your system, and the image will be wherever you copied/unzipped it to.

    mkdir /boot/dos
cp /usr/lib/syslinux/memdisk /boot/dos
cp FDOEM.144 /boot/dos

NOTE: memdisk may be located somewhere else. It is part of syslinux package, just find where it is.

If you want to add some additional programs/files to the floppy (for example BIOS flash program and ROM file)

4. Create a mount point and mount the floppy image.

mkdir /media/floppy mount -t msdos -o loop /boot/dos/FDOEM.144 /media/floppy

Note, if a different boot image is being used (instead of FDOEM.144) that should be called instead.
Once /media/floppy is mounted, one can copy various DOS programs to that "floppy" area, such that they will be present after one reboots.

Add boot option to grub for floppy

5. Add a boot option for the floppy image.

For redhat distros and derivatives the GRUB config file is:

/etc/grub.conf

for Suse

/boot/grub/menu.lst

title DOS
root (hd0,0)
kernel /boot/dos/memdisk
initrd /boot/dos/FDOEM.144
boot

Note: If you have separate boot parition you should remove "/boot" from the path:

title DOS
root (hd0,0)
kernel /dos/memdisk
initrd /dos/FDOEM.144
boot

Regarding the line: "root (hd0,0)", take a look at the other entries in your config file and put the same numbers

No comments:

Post a Comment

Comment