Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Booting DOS from floppy image on harddisk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
woobi
n00b
n00b


Joined: 27 Dec 2003
Posts: 4

PostPosted: Sat Dec 27, 2003 12:59 pm    Post subject: Booting DOS from floppy image on harddisk Reply with quote

Booting DOS from floppy image on harddisk

Why?
I often find myself in the situation where I need a DOS floppy to update some bios or firmware for my hardware.
First problem is that I can never find my boot floppies, and second problems is I usually dont have a floppy drive connected.
So I thought it would be a lot easier to be able to boot into DOS directly from GRUB, and never ever have to worry about broken floppes anymore.

How to do it
Basicly it is done by using memdisk which is a part of the SYSLINUX bootloader.
memdisk can boot using a floppy image, so all you have to do is get the bootimage, setup a partition DOS can access and setup GRUB to load memdisk.

DOS Partition
To have a place to store the files for bios-updates etc. I needed a drive for DOS.
I made a FAT partition as hda2 on about 40Mb, but you can also juse use the Win98 bootdisk which can read from FAT32 drives.
In this guide my dos-partition is mounted by:
Code:
mount /dev/hda2 /mnt/dos

I also created a dir for holding the boot-files.
Code:
mkdir /mnt/dos/dosboot


Boot-image
If you dont allready have a floppy-image you can get one here:
http://www.bootdisk.com/bootdisk.htm
I use the DOS 6.22 disk.
On the site they are stored in exe files, but we need the image-file itself.
Code:
wget http://csislabs.palomar.edu/Student/Utilities/boot622.exe
unzip boot622.exe
cp boot622.IMA /mnt/dos/dosboot/boot622.ima

When using the unzip command it prints out some errors but just ignore those, it still works.

memdisk
memdisk is part of the SYSLINUX boot loader, you can find it on this site.
http://syslinux.zytor.com/memdisk.php
SYSLINUX is in the portage tree but since we only need the memdisk module I just downloaded and compiled it myself.
Code:
wget http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-2.08.tar.gz
tar -zxf syslinux-2.08.tar.gz
cd syslinux-2.08/memdisk
make
cp memdisk /mnt/dos/dosboot/


Setup the bootloader
To make the memdisk module boot the floppy image, you just have to setup your bootloader to use memdisk as the kernel and the boot622.ima as an initrd.

Since I use GRUB I added the following part to my grub.conf file;
Code:
title DOS 6.22
root (hd0,1)
kernel (hd0,1)/dosboot/memdisk
initrd=/dosboot/boot622.ima

Thats it!
Now I can select DOS during boot, and I end up in DOS 6.22 with access to my hda2 partition, where I have all my files located for bios updating.

Hope someone find my guide usefull, have fun.

Morten Kjaergaard
Back to top
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Sat Dec 27, 2003 1:07 pm    Post subject: Reply with quote

interesting! will try that.
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Sat Dec 27, 2003 5:21 pm    Post subject: Reply with quote

Amazing first post woobi!
Back to top
View user's profile Send private message
nepenthe
Guru
Guru


Joined: 14 Jul 2002
Posts: 317
Location: Sanford, ME

PostPosted: Sun Dec 28, 2003 7:57 pm    Post subject: Reply with quote

Is it possible to create and format an FAT32 partition from within Linux? =)
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Sun Dec 28, 2003 8:27 pm    Post subject: Reply with quote

I think so! The tool you need is mkfs.vfat which, I think, comes from dosfstools. Now the question is, will that make fat16 or fat32... This I am not too sure. Hope that helps you somewhat.
Back to top
View user's profile Send private message
fsck_ms
n00b
n00b


Joined: 02 Jul 2002
Posts: 25
Location: just outside reality

PostPosted: Thu Jan 01, 2004 2:33 am    Post subject: Reply with quote

You can indeed format fat32 filesystems with dosfstools. You have to explicitly tell it to use fat32 instead of fat16.
_________________
fortune: The best defense against logic is ignorance.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Mon Jan 05, 2004 4:15 pm    Post subject: Reply with quote

Which drive letter is the hard disk dos partition? a: is the boot image, b: is the floppy drive, r: and s: are the cdroms, but c: is invalid...
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum