LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-24-2005, 07:48 PM   #1
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Rep: Reputation: 15
Boot from floppy image using GRUB


I need to reflash the BIOS on my Dell Precision 410, but my floppy drive was removed. Is there a way to get GRUB to boot a floppy image file (.bin, .img, etc) stored on a hard drive? Under linux, I can mount a floppy image, and I found a driver that creates a virtual drive under Windows, but I'm stumped as to how to boot from one.
 
Old 12-24-2005, 08:59 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Check out this thread: HOW-TO:Installing (or upgrading) fedora without a CDROM

The method should work for any iso bootable image.

If you have a bin image, check out bin2iso to convert it to an iso image. (If you need to -- GRUB might understand bin.)
 
Old 12-24-2005, 09:59 PM   #3
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Original Poster
Rep: Reputation: 15
Several problems with that.
First, I am trying to boot a floppy image (.img), not a cd, although the principle should be the same.
Second, and most important, the BIOS reflash disk is a DOS-based disk, not linux-based, so there are no kernel or initrd files.
Third, I don't know what the difference between an .iso and .bin is. I thought they were all just a bit-for-bit image of a disk, made with dd if=/dev/fd0 of=floppy.img.
 
Old 12-25-2005, 10:39 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Ah.

Well, try putting this in your /boot/grub/grub.conf:
Code:
title Floppy
        rootnoverify (fd0)
        chainloader +1
Wait one: I'm going to try this with my GRUB test floppy.

Edit: OK, that works fine. Now all you need to do is point GRUB to your image file (per the method in the thread). The key s the rootnoverify and chainloader +1 which tell GRUB to use the boot information from the image and loader.

In fact, I'm going to copy my test floppy (which, by the way, is a MSDOS formatted disk) to a HD, and see if I can get it to work from the image.

Last edited by PTrenholme; 12-25-2005 at 10:50 AM.
 
Old 12-25-2005, 12:13 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Thumbs down Well, that didn't work.

I guess it's not so easy. That set of GRUB code boots fine from a real floppy, but I can't get an image to work. Yet.

But now I have to go play Santa for the grand-kids of my wife will get really upset.

Later. I hope.
 
Old 12-25-2005, 06:01 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
OK, here's something that seemed to almost work:
Code:
$ dd if=/dev/fd0 of=/var/share/z/bootfloppy.img # Copy of a bootable floppy
Code:
title Boot from Floppy Image
root (hd4)
chainloader (hd4,0)/bootfloppy.img
where /var/share/z is my 5th hd (which happens to be a vfat drive, but that's probably not necessary).

I'm not, actually, sure that the root (hd4) command is needed, but I haven't (yet) tried it without that line.

Now, note that I said "almost work" in the first line. The floppy I copied is my GRUB boot floppy, and, when I ran the GRUB commands, I got
Code:
GRUB
, and then a frozen system. I suspect that I need to be more careful in the dd command, because the file block list for bootflopy.img does not appear to be a contiguous set of blocks, and (again, I suspect) the loader is not finding "stage 1" where it expects it to be found.

Hopefully, the image with which you're working is a more carefully constructed image.

Give it a shot, and let us kow it it hits the target for you.
 
Old 12-26-2005, 10:37 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Why not use Grub itself?

You can put Grub's stage1 and stage2 in a bootable Fat32 partition, say it is in hda2, and store it in a directory /boot/grub. In the link I provided later (on BSD & Solaris systems) I used Win98 to host Grub. Boot a Live CD up, invoke a Grub shell by typing
Code:
grub
and then install Grub in MBR by
Code:
root (hd0,1)
setup (hd0)
The above effectively asks Grub to use hda2 stage1 and stage2 files to set itself up in the MBR so that you can boot to a Grub prompt. In Grub prompt you can boot any system manually.

You can automate your booting by writing a menu.lst stored inside /boot/grub and Grub will follow it.

In a Grub prompt one can boot 100+ systems

How you arrange Grub to boot whatever image you have becomes a secondary matter.
The primary objective is to have Grub available first.
 
Old 12-26-2005, 02:31 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by saikee
Why not use Grub itself?
[snip]
Yes, that's fine, but his (ninjabob7's) problem is that he needs to "flash" his BIOS, but doesn't have a floppy drive from which to run the "flash" program he's downloaded from his BIOS vendor. We're trying to get GRUB to boot from a copy of a bootable disk stored on a hard drive.

As an aside, my local CompUSA store sells floppy drives in the $10-20 range, and they're even less at the local computer parts recycler.

Hum, here's a thought: Why not install dosbox, and have it boot the image for you? I think that might be possible, but I've never tried it.

Of course, "flashing" the BIOS when the system is running can, potentially, cause severe problem if the running system has stored BIOS access addresses which are changed by the "flash."
 
Old 12-26-2005, 03:04 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
(1) I don't have a misconception of thinking a Grub prompt must come from a floppy

(2) I suggested Grub to be sourced from a Live CD in my advice.
 
Old 12-26-2005, 03:56 PM   #10
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: Debian Wheezy
Posts: 2,839

Rep: Reputation: 48
Perhaps add the flash program to a floppy image from bootdisk.com and burn it to CD as the boot image?
 
Old 12-26-2005, 05:32 PM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by saikee
(1) I don't have a misconception of thinking a Grub prompt must come from a floppy

(2) I suggested Grub to be sourced from a Live CD in my advice.
I think you still don't get it. He's got GRUB running fine on his system now, and doesn't need to get it from anywhere. What he need is to boot from a (probably) MSDOS floppy containing his new BIOS settings. He does not have a working floppy drive. He therefore wants GRUB to boot his system from the HD image of the (probably) MSDOS disk which, when started, will upgrade his BIOS.

So, do you have any suggestion which might help him upgrade his BIOS?

Oh, a question for injabob7: Who is your mother board vendor? (I ask because my board is an Asus, and Asus has a system that can update a BIOS over the web., so there may be other options available to you for BIOS upgrade.)
 
Old 12-26-2005, 05:41 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,154

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by 2damncommon
Perhaps add the flash program to a floppy image from bootdisk.com and burn it to CD as the boot image?
Now that might just work. Ninjabob7, do you have a working CD burner? It might suffice just to mount the floppy image using the loopback device, put FREEDOS or Win98 on a bootable CD with the floppy contents, boot to a DOS prompt, and start the program from the floppy. (I'm assuming the floppy image contains a DOS program with an AUTOEXEC.BAT file to start it running.)
 
Old 12-26-2005, 06:02 PM   #13
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Original Poster
Rep: Reputation: 15
OK. First thing you should know is that I realized that the BIOS upgrade was actually the one I already had. However, I would still like to figure out how to boot from the floppy. Second, how do I find out the motherboard? I just discovered something called LinuxBIOS, but don't know if it's compatible with my computer. The computer is a Dell Precision 410. The BIOS doesn't seem to be Phoenix, Award, or anything else. It looks like a custom Dell-made BIOS. I just installed a CD burner today, and it works with K3B from Linux (haven't installed Windows drivers yet). I am using Windows 2000 if that matters, but I have it on a FAT partition. The liveCDs I currently have are:
Knoppix (several versions, newest 4.0.2)
Kanotix 2005-03 (based on Knoppix)
Puppy 1.0.6
FreeDOS
PCLinuxOS 9.1
I'll try that chainloader bit in GRUB, but I don't think it will work. Chainloader (I think) is supposed to execute a piece of code like you'd find in the MBR. What would need to happen, most likely, is to mount the image as a virtual floppy drive and then boot from it. I don't know how you'd do that, though. GRUB probably isn't the way to go.
Once I had this weird version of GRUB that ran under Windows 2000/XP/NT. It came with a mini-version of Windows 3.1. The commands looked something like this (I think):
title Windows 3.1 from floppy image (just for fun...)
kernel (hd0,0)/boot/memdisk
initrd (hd0,0)/boot/win311.img
However, I don't think that was actually a working floppy image, because copying it to an actual floppy and booting it didn't work. Maybe memdisk was the MBR of the floppy?? Anyway, I'll post again once I try these two things.

Edit: Okay, the chainloader method looks like it started booting, then the disk gave this message:
I/O Error: Insert another disk
The kernel=mbr initrd=.img method also failed. GRUB gave a message about not fitting the kernel in memory or something. Which is strange, since it should only be 512 bytes. (dd if=/dev/loop0 of=mbr.bin bs=512 count=1) Maybe I read it wrong and the initrd couldn't fit in memory. Should I gzip it?

Last edited by ninjabob7; 12-26-2005 at 06:20 PM.
 
Old 12-26-2005, 09:02 PM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Wrong question leads to wrong answers.

This got nothing to do with Grub which is a "boot loader". The Bios updating program isn't a system.

Is this what you after?
 
Old 12-26-2005, 09:27 PM   #15
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Original Poster
Rep: Reputation: 15
No. If you paid attention, you would see that I'm trying to boot from a floppy image using GRUB. You would also see that I'm not trying to update my BIOS anymore. I just want to boot the image.

Also, where can I get the GRUB image you're using? It might help me to be on the same page.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Floppy Boot Image - Help Bobalternate Linux - Newbie 7 11-04-2005 08:39 AM
booting floppy image with grub rr1mand0 Linux - General 1 10-07-2005 07:34 AM
craeting a boot image when I don't have a floppy drive jomy Linux - Networking 15 02-02-2005 01:53 PM
DOS Floppy image w/ grub? hroman Linux - Software 5 10-09-2004 01:23 AM
FreeBSD 4.5 boot floppy image glock19 Linux - General 0 03-01-2002 06:48 PM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration