[lug] Grub menu item to go back to BIOS?

scott.herod at comcast.net scott.herod at comcast.net
Thu May 26 08:52:47 MDT 2011


----- Will <will.sterling at gmail.com> wrote:
> Once BIOS has loaded and transfered execution to GRUB I don't think there is
> anything left of BIOS running that you could go back to.
> 

Thanks for the response, Will.  I had rather expected something like that was
true.  After I sent my original question I did find a good discussion of
what one can do with the menu available with grub4dos.  It's at:

http://sites.google.com/site/rmprepusb/tutorials/grub4dos

(Although it is perhaps NSFW.)

BTW, I've noticed a trend that I'm sure most others have as well.  When
trying to find out how to do something in Windows land, web pages tend to
describe the various dialogs that you must click through.  For Linux the
opposite applies; the examples say to enter something on a command-line
then use the results to enter something else.

Often neither method is particularly usable in an automated manner.  For
example, grub has a 'find' command that can find files on the file systems of
the various devices.  That command can be used to find say, /ntldr, the
WinXP bootloader.  Unfortunately, it reports a drive and partition in the
form (hd1,0).  There is a manner to set the root device with the 'find' command
but apparently to boot WinXP, you must also make sure that the drive is the
first hardware device.  Grub's 'map' command can do that but I have not
discovered a way to pass the results of the find command to the map command.
It's easy to do by hand but not automatically as far as I can tell.

Grub, at least grub4dos, does support execution of a binary discovered on 
one of the hardware devices.  Providing an extended scripting capability
might be an interesting project if such a thing doesn't already exist.

Thanks

Scott

> On Wed, May 25, 2011 at 1:47 PM, <scott.herod at comcast.net> wrote:
> 
> > Hello,
> >
> > I've got a small tool that unpacks a bootable ISO onto a USB drive and
> > installs GRUB for booting.  (Often the partition on the USB drive has an
> > NTFS file system so I cannot use isolinux directly.)  A customer has asked
> > if I can add a grub menu item which essentially says, "Tell the BIOS that
> > this is not a bootable device and fall-through to the next device".  Does
> > anyone know a way to do that?
> >
> > More details:  I'm using grub4dos rather than GNU GRUB since my installer
> > needs to run in Windows.  Grub4dos is very close to GRUB 1 in its command
> > set.  I can do a "find" to see whether I can discover either /ntldr or
> > /bootmgr and boot that from GRUB but that would potentially bypass a
> > bootable CD that a user might have inserted.  I could also switch the root
> > device to (hd1) and use the "chainloader +1" command but again that would
> > probably bypass a bootable CD and I'm not sure that I can guarantee that
> > (hd1) would be the next drive in the BIOS boot sequence or that it was
> > bootable.
> >
> > It would be best if there were a way to tell the BIOS that the USB device
> > wasn't bootable and that the BIOS should move on to the next device in its
> > list.
> >
> > Thanks
> >
> > Scott
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
> >




More information about the LUG mailing list