How to get a boot menu before loading BartPE using GRUB4DOS 

http://www.911cd.net/forums//index.php?showtopic=16980

What I'm after is a way to dual boot my 1GB USB flash stick. I have successfully installed (and can boot from) the Bart PE on it. But I would like a way to get a menu so I can boot right to DOS so I can run other utilities from the USB flash stick.

You can choose to:

  1. Install "normally" NTLDR with an entry in boot.ini that points to a DOS bootsector (made with BOOTPART) and another one pointing to GRLDR + an entry in menu.lst pointing to your SETUPLDR.BIN.
  2. Install directly GRLDR with an entry in menu.lst pointing to your SETUPLDR.BIN + an entry pointing to a DOS floppy image

Also check these: http://www.911cd.net/forums//index.php?showtopic=10806 http://www.msfn.org/board/index.php?showtopic=69211

here is some detailed info.

I am assuming that you already can boot both DOS (the one from Windows 98 aka 7.1) and PE from USB without problem.

Version 1, NORMAL DOS INSTALL 

Format the key as usual, including SYSTEM files IO.SYS MSDOS.SYS COMMAND.COM Verify that it boots. Add to the key the /I386 directory Add to the key GRUB.EXE and the following MENU.LST:

# This is a basic menu.lst file for GRUB4DOS

# Following is the timeout for the default choice
# By not pressing any key during the timeout, the default will be chosen
timeout 10

# Following is the menu item that will default
default 0

# This reflects the "normal" behaviour of a PC
# i.e. booting the first partition of first harddisk
# By setting it as default with timeout 10 seconds (see above)
# We try to replicate somehow the "Press any key to boot from CD..." message
# of Microsoft Install CDs, this way if no key is pressed, as an example for
# unattended installs, the system will boot "normally" even if CD is inserted
# of course if the "any" you press is [ENTER]system will boot from this entry
title Boot Hard Disk MBR on (hd0,0)
chainloader (hd0,0)+1
rootnoverify (hd0)

title NTLDR
# This entry simply tries to load a NT/Win2K/XP/2003
# system ALREADY on your hard disk using the NTLDR/NTDETECT.COM
# and boot.ini on the CD
chainloader /NTLDR

If you have your SETUPLDR.BIN renamed as NTLDR in the root directory, it should work.

Alternatively, try adding the following to menu.lst:

title SETUPLDR.BIN
# This entry simply tries to directly load BartPE
# from SETUPLDR.BIN in the /I386 directory
chainloader /I386/SETUPLDR.BIN

version 2, Through NTLDR 

Format the key as usual, including SYSTEM files IO.SYS MSDOS.SYS COMMAND.COM Verify that it boots.

Copy to the stick bootpart and use it to make a bootsector with DOS Win9x code, say C:\bootsect.dat Use bootpart to rewrite the NT/2K/XP bootsector. Copy to the stick NTLDR and this BOOT.INI:

[Boot Loader]
Timeout=5
Default=C:\Bootsect.dat
[Operating Systems]
C:\Bootsect.dat="Windows 98 Command Line" /win95
C:\GRLDR="GRUB"

Add to the stick GRLDR and menu.lst

version 3, Direct GRUB4DOS+DOS (win9x) 

Format as usual, as above.

Copy to the stick GRLDR, menu.lst and bootlace.com, use it to install GRLDR as the main bootmanager in the MBR.

use the options:

--force-backup-mbr
--boot-prevmbr-first
--time-out=5
--hot-key=3920

This way if the SPACEBAR is not pressed within 5 seconds, GRLDR will boot, otherwise the normal DOS will.

The above are just examples, another way is using simply a Floppy image for the DOS booting, in this case you need an entry in menu.lst along these lines:

title Win98SE (Win98SE.ima)
# This image has been set to boot using directly the GRUB bootloader
# You might also want to experiment with compressed images and memdisk
# The image is first mapped to memory as first floppy
# then Int13h is hooked
# finally the 1st sector of floppy is chainloaded and booted
map --mem /IMAGES/Win98SE.ima (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

title Win98SE (Win98SE.ima.gz)
# This image has been set to boot using directly the GRUB bootloader
# This example uses a compressed image (gzipped)
# The image is first mapped to memory as first floppy
# then Int13h is hooked
# finally the 1st sector of floppy is chainloaded and booted
map --mem /IMAGES/Win98SE.ima.gz (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

title Win98SE (Win98SE.imz) memdisk
# This image has been set to boot using memdisk
# Using memdisk instead of direct GRUB booting
# If the compressed image does not boot through memdisk you can always
# try to uncompress it and use it with direct GRUB booting
kernel /IMAGES/memdisk.gz
initrd /IMAGES/Win98SE.imz
Boot

Instead of the floppy image one can use a partition image, there are so many possibilities that it's impossible to list them all.

If on the stick there is also GRUB.EXE it is possible to re-start GRUB from the DOS command line without rebooting.

Please NOTE that GRUB paths/filenames are CaSe SeNsItIvE!

jaclaz

documented on: May 8 2006

version 3, Direct GRUB4DOS+DOS (win9x) 

 

I wanted to mess with the boot.ini again real quick. I found that if I copy the ntldr from my XP box to the root of the USB flash then I can get it to give me a menu. However I can't get it to load the BartPE regardless of how I try to edit the boot.ini file.

 
 -- QUOTE (Raceit @ May 8 2006)

Raceit, you are missing a logical step:

  1. The BOOTSECTOR (i.e. first sector of the Active Primary Partition) contains CODE that boots (under NT/2K/XP/2003) the NTLDR
  2. The NTLDR has the capacity to boot (through the selection in BOOT.INI and using NTDETECT.COM) only the windows NT/2K/XP/2003 System partition, (i.e. \Winnt or \Windows) through an arcpath sintax, (i.e. something like multi(0)disk(0)rdisk(0)partition(1)\WINNT)
  3. To keep compatibility with elder MS operating systems, the NTLDR has also the option to load ANOTHER bootsector; this bootsector MUST have the same geometry (dynamic data) of the main one, but can have different CODE, i.e. can load something different like the DOS files IO.SYS SDOS.SYS COMMAND.COM or another OS, or even another bootloader
  4. BartPE normally boots by using a copy of SETUPLDR.BIN renamed as NTLDR or PELDR.
  5. SETUPLDR.BIN behaves differently from NTLDR:

    1. It DOES NOT use the BOOT.INI settings file
    2. Searches for needed files in the \I386 directory (this is fixed, hardcoded INSIDE SETUPLDR.BIN, needs hexediting to be changed) or in the \minint one if on hard disk
    3. Reads the textsetup.SIF, or WINNT.SIF (or any other .sif file)

The way to have a BartPE selection in boot.ini is to have an alternate BOOTSECTOR, peboot.bin, that loads PELDR (i.e. a renamed SETUPLDR.BIN) INSTEAD of NTLDR.

So the booting goes like this:

  1. REAL BOOTSECTOR loads NTLDR
  2. NTLDR loads BOOT.INI
  3. If the line invoking the ALTERNATE bootsector peboot.bin is chosen, peboot.bin loads PELDR

You cannot load anything else but an ARCPATH or a BOOTSECTOR from NTLDR/BOOT.INI!

See these threads here: http://www.911cd.net/forums//index.php?showtopic=2316 http://www.911cd.net/forums//index.php?showtopic=11213 http://www.911cd.net/forums//index.php?showtopic=11226 http://www.911cd.net/forums//index.php?showtopic=13930 http://www.911cd.net/forums//index.php?showtopic=14684

and this post from cdob: http://www.911cd.net/forums//index.php?showtopic=14164&st=20

Using GRLDR or GRUB.EXE makes it possible to load DIRECTLY (i.e. chainload) NTLDR or SETUPLDR.BIN without need for renaming the latter to NTLDR or PELDR.

jaclaz

documented on: May 8 2006