dr death
2007-05-18, 07:49 AM CDT
I needed to flash the BIOS on my m/board and had no floppy drive or windows (obviously). Anyway, after much searching and problems, I finally got a bootable USB disk with FreeDOS and flashed the BIOS. I hope that someone finds this useful, so here goes
1) Install dosemu (There is an rpm at http://dosemu.sourceforge.net/stable/)
# rpm -Uvh dosemu-1.4.0-1.i386.rpm
THE REST OF THIS ASSUMES THAT THE USB DISK IS /dev/sdb. CHECK YOUR LOG FILES TO BE SURE...
2) Clear the MBR (& partition table), create a new partition table and format the disk
# dd if=/dev/zero of=/dev/sdb bs=512 count=1
# fdisk /dev/sdb
(make the partition whatever size you need, partition type 0x06 (FAT16), and mark it as bootable)
# mkdosfs -v /dev/sdb1
3) Run dosemu to create the directories
# dosemu -dumb
C:\> EXITEMU
4) Create the file ~/.dosemurc with the line
$_hdimage = "drives/* /dev/sdb1"
dosemu expands the filelist in quotes and allocates each item a drive letter in sequence. So e.g. /drives/* /dev/sdb1 expands to /drives/c /drives/d /drives/e /dev/sdb1 and these 4 items become C: D: E: F:. It seems however that it expects E: to be a cdrom (on /media/cdrom), and that cdrom may not be there. So if /drives/e does not exist it needs to be created otherwise /dev/sdb1 will be assigned E: and the cdrom driver will cause problems.
# ln -s /tmp ~/.dosemu/drives/e
5) Run dosemu and install the OS (make sure the disk is not mounted!)
# dosemu -dumb
C:\> SYS Z: F:
C:\> XCOPY /S C: F:
C:\> EXITEMU
6) Mount the partition on the USB disk (just unplug and replug the disk in) and edit config.sys and autoexec.bat as required, given that C: will be A: when you boot, and that nothing was copied from Z:
You should now be done. Except that this worked in one machine and not in the one where I needed it. Possibly something to do with USB-HDD and USB-ZIP in the BIOS.
Anyway to work around this problem (if it exists), copy the partition to the raw device
# dd if=/dev/sdb1 of=/tmp/tmpfle
# dd if=/tmp/tmpfile of=/dev/sdb
and this seems to work now :)
Death
1) Install dosemu (There is an rpm at http://dosemu.sourceforge.net/stable/)
# rpm -Uvh dosemu-1.4.0-1.i386.rpm
THE REST OF THIS ASSUMES THAT THE USB DISK IS /dev/sdb. CHECK YOUR LOG FILES TO BE SURE...
2) Clear the MBR (& partition table), create a new partition table and format the disk
# dd if=/dev/zero of=/dev/sdb bs=512 count=1
# fdisk /dev/sdb
(make the partition whatever size you need, partition type 0x06 (FAT16), and mark it as bootable)
# mkdosfs -v /dev/sdb1
3) Run dosemu to create the directories
# dosemu -dumb
C:\> EXITEMU
4) Create the file ~/.dosemurc with the line
$_hdimage = "drives/* /dev/sdb1"
dosemu expands the filelist in quotes and allocates each item a drive letter in sequence. So e.g. /drives/* /dev/sdb1 expands to /drives/c /drives/d /drives/e /dev/sdb1 and these 4 items become C: D: E: F:. It seems however that it expects E: to be a cdrom (on /media/cdrom), and that cdrom may not be there. So if /drives/e does not exist it needs to be created otherwise /dev/sdb1 will be assigned E: and the cdrom driver will cause problems.
# ln -s /tmp ~/.dosemu/drives/e
5) Run dosemu and install the OS (make sure the disk is not mounted!)
# dosemu -dumb
C:\> SYS Z: F:
C:\> XCOPY /S C: F:
C:\> EXITEMU
6) Mount the partition on the USB disk (just unplug and replug the disk in) and edit config.sys and autoexec.bat as required, given that C: will be A: when you boot, and that nothing was copied from Z:
You should now be done. Except that this worked in one machine and not in the one where I needed it. Possibly something to do with USB-HDD and USB-ZIP in the BIOS.
Anyway to work around this problem (if it exists), copy the partition to the raw device
# dd if=/dev/sdb1 of=/tmp/tmpfle
# dd if=/tmp/tmpfile of=/dev/sdb
and this seems to work now :)
Death