FreeDOS Flash Drive

From Gentoo Linux Wiki

Jump to: navigation, search

Almost every BIOS/firmware update needs DOS to work, this article aims to explain how to create a USB flash drive, used to boot on FreeDOS and run those medieval programs. (You will need to have a motherboard BIOS capable of booting from a USB device. Some may also need to enable this option from within their motherboard's BIOS setup screen as well.)

Contents

[edit] Requirements

There are several packages you'll need for this, sys-boot/syslinux, which provides various bootloaders (Syslinux, PXELinux, etc.), sys-boot/grub, The GNU GRUB 2 boot loader, sys-apps/util-linux which provides cfdisk(sys-apps/util-linux is part of @system, so you already have this) and last, sys-fs/dosfstools which provides the DOS filesystem tools(mkfs.vfat etc.).

Emerge these packages before continuing:

emerge -av sys-boot/syslinux sys-boot/grub sys-fs/dosfstools

[edit] Setup

[edit] Partitioning

First thing you need to do is create a partition, let's assume the USB flash drive is /dev/sdb:

cfdisk /dev/sdb

Remove everything, create a primary partition, set its type to 0E(W95 FAT16 (LBA)), mark it bootable, write the partition table and quit.

[edit] Formating

Now you can format the partition in FAT16, you can try FAT32 but FAT16 is recommended :

mkdosfs -F16 /dev/sdb1

[edit] FreeDOS

There is a nice image of FreeDOS with all you need, you just have to copy a file from it to the partition:

mount /dev/sdb1 /mnt/usb cd /mnt/usb wget http://odin.fdos.org/odin2005/odin1440.img

[edit] MBR

Next thing you need to do is make the USB flash drive boot on something, that would be GRUB. You will also need a file from Syslinux to boot FreeDOS.

cd /mnt/usb mkdir grub cp /lib/grub/<your-arch>/* grub/ cp /usr/share/syslinux/memdisk .

A nice configuration for GRUB :

File: /mnt/usb/grub/menu.lst
default=0
timeout=10
root=(hd0,0)
title FreeDOS
        kernel /memdisk
        initrd /odin1440.img

And finally, you can install GRUB :

grub grub> device (hd5) /dev/sdb grub> root (hd5,0) grub> setup (hd5) grub> quit
Note: GRUB might give you two "... failed (this is not fatal)" warnings, just ignore them.

[edit] Last touch

Now you can copy your BIOS update/whatever to the USB flash drive (/mnt/usb).

Last step:

umount /dev/sdb1

That's it, you can boot on your USB flash drive. Once you are in FreeDOS, your flash drive will be c:\, enjoy...

2009-06-09 - This statement might not be accurate, as the system is now booted into the odin floppy image. This will only present the files and programs that are within that odin image. Anything outside it will not be accessible. The only solution is to somehow load those desired program into the odin image in the first place.

[edit] External links

Old howto upon which this one is based

Personal tools