Jump to content











Photo
* * * * * 5 votes

Easy2Boot Development Discussion

grub4dos multiboot multipass usb boot iso

  • Please log in to reply
1383 replies to this topic

#326 halikus

halikus

    Frequent Member

  • Advanced user
  • 110 posts
  •  
    Canada

Posted 23 June 2013 - 04:12 PM

I have been messing around with v1 tailoring it to my needs, and it works great.  I generally use it with a 64gig usb with a main ntfs partition and a smaller fat32 partition.   As the fat32 partition is usually hidden in windows, i don't update my changes i make as often as the visible ntfs partition.  When using the usb, i noticed sometimes i was booting the fat32 g4d without knowing it.  I made these additions to menu.lst to display some extra information about the usb, and to have some information displayed in the header.  It seems to work well.

 

 

menu.lst

set USB=0 && geometry (cd) > nul  || set USB=1

set NTFS=
if "%USB%"=="1" && if "%NTFS%"=="" find  checkrange 0x07 parttype (hd0,0) && set NTFS=NTFS (hd0,0) && echo NTFS   USB (hd0,0)
if "%USB%"=="1" && if "%NTFS%"=="" find  checkrange 0x07 parttype (hd0,1) && set NTFS=NTFS (hd0,1) && echo NTFS   USB (hd0,1)
set FAT32=
if "%USB%"=="1" && if "%FAT32%"=="" find  checkrange 0x0C parttype (hd0,0) && set FAT32=FAT32 (hd0,0) && echo FAT32  USB (hd0,0)
if "%USB%"=="1" && if "%FAT32%"=="" find  checkrange 0x0C parttype (hd0,1) && set FAT32=FAT32 (hd0,1) && echo FAT32  USB (hd0,1)

set HDDformat=
if "%USB%"=="1" && if "%HDDformat%"=="" find  checkrange 0x07 parttype (hd0,0) && set HDDformat=NTFS && echo (bd) NTFS
if "%USB%"=="1" && if "%HDDformat%"=="" find  checkrange 0x0C parttype (hd0,0) && set HDDformat=FAT32 && echo (bd) FAT32
if "%USB%"=="0" && if "%HDDformat%"=="" find  checkrange 0xFF parttype (bd) && set HDDformat=DVD && echo (bd) CD
clear

# Warn if buggy BIOS!
call /%grub%/CheckAccess.g4b
set ostype=
if "%ostype%"=="" checkrange 0,1 is64bit && set ostype=32-bit CPU && echo 32-bit CPU found
if "%ostype%"=="" checkrange 2,3 is64bit && set ostype=64-bit CPU && echo 64-bit CPU found
checkrange 1,3 is64bit && echo PAE supported
checkrange 0,2 is64bit && echo PAE not supported
find 
if "%USB%"=="1" && root (hd0,0)
if "%USB%"=="1" && root (hd0,1)

echo %NTFS%
echo %FAT32%


set plpbt=
if "%plpbt%"=="" /%grub%/APPS/bios int=0x13 eax=0x504c6f50 ebp=0x43484b44 > (md)0x300+1 &&  cat --locate="EAX=79657320" (md)0x300+1 && set plpbt=1
if "%plpbt%"=="1" echo Plop is loaded

and then in main.hdr (preferable to ensure its updated) or E2B.cfg

 


set    HEADING=\x20   Grub4dos  %ostype%  %HDDformat%:/%grub%  %NTFS% %FAT32%   \x20

iftitle [if "%plpbt%"=="1"]          **Plop is loaded into memory (USB is read ONLY)**
root


By adding the USB=, i can then also use it for cd and usb.  With grub2 as an example, i do this to boot from either partition.

 

iftitle [if "%USB%"=="0" && if exist /boot/grub/g2ldr]  Grub2\n    Boot Grub2 (bd)
find --set-root --ignore-floppies /boot/grub/g2ldr
chainloader /boot/grub/g2ldr
boot

iftitle [if "%USB%"=="1" && if exist (hd0,0)/boot/grub/g2ldr]  Grub2 (hd0,0)\n    Boot Grub2 (hd0,0)
root (hd0,0)
chainloader (hd0,0)/boot/grub/g2ldr
boot

iftitle [if "%USB%"=="1" && if exist (hd0,1)/boot/grub/g2ldr]  Grub2 (hd0,1)\n    Boot Grub2 (hd0,1)
root (hd0,1)
chainloader (hd0,1)/boot/grub/g2ldr
boot

and for the back to g4d main menu, you can see if its the fat32 or ntfs drive (or cd) by using

 

iftitle [if "%USB%"=="0"]  Grub4dos Main Menu (cd)
configfile %LBACKMENU%

iftitle [if "%USB%"=="1" && find  checkrange 0x07 parttype (bd)]  Grub4dos Main Menu (NTFS)
configfile %LBACKMENU%

iftitle [if "%USB%"=="1" && find  checkrange 0x0C parttype (bd)]  Grub4dos Main Menu (Fat32)
configfile %LBACKMENU%

 

And finally for your FAT32_Menu.lst and NTFS_menu.lst mod (wich i think you should include) i use this method instead of using the fat32.TAG

 

iftitle [if "%USB%"=="1" && find  checkrange 0x07 parttype (hd0,1)]  Boot NTFS  USB (hd0,1) and set active\n  Make other partition bootable and boot it.
configfile /%grub%/APPS/NTFS_menu.lst

iftitle [if "%USB%"=="1" && find  checkrange 0x0C parttype (hd0,1)]  Boot FAT32 USB (hd0,1) and set active\n  Make other partition bootable and boot it. 
configfile /%grub%/APPS/FAT32_Menu.lst

and then with FAT32_Menu.lst as an example, i just do

 

debug off
# This always sets the first partition to FAT32 (if NTFS+FAT32 in ptn table)
 
# first get MBR into two areas of memory
dd if=(hd0) of=(md)0x3000+1 count=1
dd if=(hd0) of=(md)0x3100+1 count=1
clear
echo FAT32 MENU - PTN TABLE WAS...
cat --hex --length=32 --skip=446 (md)0x3000+1
 
#Now overwrite 2nd copy with tables from 1st copy but change the order...
set /A m=*0x6001be
write     0x6201ce %m%
set /A m=*0x6001c2
write     0x6201d2 %m%
set /A m=*0x6001c6
write     0x6201d6 %m%
set /A m=*0x6001ca
write     0x6201da %m%
 
set /A m=*0x6001ce
write     0x6201be %m%
set /A m=*0x6001d2
write     0x6201c2 %m%
set /A m=*0x6001d6
write     0x6201c6 %m%
set /A m=*0x6001da
write     0x6201ca %m%

echo NEW TABLE WILL BE...
cat --hex --length=32 --skip=446 (md)0x3100+1
 
# get value of original 1st ptn ID = c=FAT32
set /A n=*0x6001c2 & 0xff
if /i "%n%"=="0xc" echo 1st ptn entry is already FAT32 - NO NEED TO SWAP!
set /A m=*0x6001d2 & 0xff
if not /i "%n%%m%"=="0xc0x7" if not /i "%n%%m%"=="0x70xc" echo WARNING: NO FAT32+NTFS FOUND IN 1st OR 2nd PARTITION (1st=%n% 2nd=%m%)!

set ASK=N && echo 
if /i "%m%"=="0xc" set /p ASK=OK TO RE-ORDER PTN TABLE AND WRITE MBR TO (hd0) (Y/N)? : 
if /i "%m%"=="0xc" if not /i "%ASK%"=="Y" configfile /menu.lst
if /i "%ASK%"=="Y" dd if=(md)0x3100+1 of=(hd0) count=1 
if /i "%m%"=="0xc" clear && echo -e \r\nNOW PTN TABLE SET TO... 
if /i "%m%"=="0xc" cat --hex --length=0x20 --skip=0x1be (hd0)+1


foreground 000088
background cccccc

if exist /%grub%/BG.bmp.gz splashimage /%grub%/BG.bmp.gz
if exist (hd0,1)/%grub%/BG.bmp.gz splashimage (hd0,1)/%grub%/BG.bmp.gz

write (md)0x220+1 !BAT\necho -n -P:0000 $[0116]                     FAT32 MENU -- %@DATE%  %@TIME%          \0 && initscript (md)0x220+1

default /default
#default 0
debug 1


configfile (hd0,1)/%grub%/menu.lst

 

I use a /%grub%/APPS dir to separate my addons from e2b, and you would need to add the file "bios" for the plop check.



#327 halikus

halikus

    Frequent Member

  • Advanced user
  • 110 posts
  •  
    Canada

Posted 23 June 2013 - 04:37 PM

Also, heres my main.hdr for the heck of it.  My method for booting the _ISO directory on another drive is more automated than the current mnu solution.

 


if not "%GFX%"=="" gfxmenu /%grub%/%GFX%
color light-gray/blue yellow/dark-gray white/black white/black
splashimage=/%grub%/BG.bmp.gz

set    HEADING=\x20   Grub4dos  %ostype%  %HDDformat%:/%grub%  %NTFS% %FAT32%   \x20

#Are we booting from a CD?
set CD=0 && geometry (cd) > nul  && set CD=1
set USB=0 && geometry (cd) > nul  || set USB=1
#clear TT for XP menu later
set TT=
write 0x8274 0x2001 > nul
if "%HCOLOUR%"=="" set HCOLOUR=0133
if "%HEADING%"=="" set HEADING=\x20   Grub4dos  %ostype%  %HDDformat%:/%grub%  %NTFS% %FAT32%   \x20
if "%HELPTEXT%"=="" set HELPTEXT=see www.RMPrepUSB.com  - Tutorial 72a
write (md)0x220+1 !BAT\necho -n -P:0000 $[%HCOLOUR%]%HEADING%\necho -n -P:%HBTM% $[%FCOLOUR%]%HELPTEXT%\0 > nul
initscript (md)0x220+1


iftitle [if "%USB%"=="1" && if not exist (hd0,0)/sources/install.wim]               ** (hd0,0)\\sources\\install.wim NOT Found**
root

iftitle [if "%USB%"=="0" && if not exist /sources/install.wim]                ** DVD:\\sources\\install.wim NOT Found**
root


iftitle [if "%plpbt%"=="1"]          **Plop is loaded into memeory (USB is read ONLY)**
root


iftitle [if exist /_ISO/E2B/grub/menu.lst]  Easy2boot Menu \n 
configfile /_ISO/E2B/grub/menu.lst


iftitle [if "%USB%"=="0" && if exist (bd)/bootmgr]  Boot Vista/Win7/Win8 from (CD)\n    Boot the Windows BCD boot menu
find --set-root (bd)/bootmgr
chainloader (bd)/bootmgr || chainloader (bd)/BOOTMGR 

iftitle [if exist (hd0,0)/bootmgr]  Boot Vista/Win7/Win8 from (hd0,0)
root (hd0,0)
chainloader (hd0,0)/bootmgr
iftitle [if exist (hd0,1)/bootmgr]  Boot Vista/Win7/Win8 from (hd0,1)
root (hd0,1)
chainloader (hd0,1)/bootmgr
iftitle [if exist (hd0,2)/bootmgr]  Boot Vista/Win7/Win8 from (hd0,2)
root (hd0,2)
chainloader (hd0,2)/bootmgr 
iftitle [if exist (hd0,3)/bootmgr]  Boot Vista/Win7/Win8 from (hd0,3)
root (hd0,3)
chainloader (hd0,3)/bootmgr
iftitle [if exist (hd0,4)/bootmgr]  Boot Vista/Win7/Win8 from (hd0,4)
root (hd0,4)
chainloader (hd0,4)/bootmgr 
iftitle [if exist (hd1,0)/bootmgr]  Boot Vista/Win7/Win8 from (hd1,0)
root (hd1,0)
chainloader (hd1,0)/bootmgr
iftitle [if exist (hd1,1)/bootmgr]  Boot Vista/Win7/Win8 from (hd1,1)
root (hd1,1)
chainloader (hd1,1)/bootmgr 
iftitle [if exist (hd1,2)/bootmgr]  Boot Vista/Win7/Win8 from (hd1,2)
root (hd1,2)
chainloader (hd1,2)/bootmgr
iftitle [if exist (hd1,3)/bootmgr]  Boot Vista/Win7/Win8 from (hd1,3)
root (hd1,3)
chainloader (hd1,3)/bootmgr
iftitle [if exist (hd1,4)/bootmgr]  Boot Vista/Win7/Win8 from (hd1,4)
root (hd1,4)
chainloader (hd1,4)/bootmgr
iftitle [if exist (hd2,0)/bootmgr]  Boot Vista/Win7/Win8 from (hd2,0)
root (hd2,0)
chainloader (hd2,0)/bootmgr
iftitle [if exist (hd2,1)/bootmgr]  Boot Vista/Win7/Win8 from (hd2,1)
root (hd2,1)
chainloader (hd2,1)/bootmgr
iftitle [if exist (hd2,2)/bootmgr]  Boot Vista/Win7/Win8 from (hd2,2)
root (hd2,2)
chainloader (hd2,2)/bootmgr
iftitle [if exist (hd2,3)/bootmgr]  Boot Vista/Win7/Win8 from (hd2,3)
root (hd2,3)
chainloader (hd2,3)/bootmgr
iftitle [if exist (hd2,4)/bootmgr]  Boot Vista/Win7/Win8 from (hd2,4)
root (hd2,4)
chainloader (hd2,4)/bootmgr
iftitle [if exist (hd3,0)/bootmgr]  Boot Vista/Win7/Win8 from (hd3,0)
root (hd3,0)
chainloader (hd3,0)/bootmgr
iftitle [if exist (hd3,1)/bootmgr]  Boot Vista/Win7/Win8 from (hd3,1)
root (hd3,1)
chainloader (hd3,1)/bootmgr
iftitle [if exist (hd3,2)/bootmgr]  Boot Vista/Win7/Win8 from (hd3,2)
root (hd3,2)
chainloader (hd3,2)/bootmgr
iftitle [if exist (hd3,3)/bootmgr]  Boot Vista/Win7/Win8 from (hd3,3)
root (hd3,3)
chainloader (hd3,3)/bootmgr 
iftitle [if exist (hd3,4)/bootmgr]  Boot Vista/Win7/Win8 from (hd3,4)
root (hd3,4)
chainloader (hd3,4)/bootmgr 

iftitle [find --ignore-floppies --ignore-cd /ntldr]  Find and Load NTLDR of Windows NT/2K/XP
find --set-root --ignore-floppies --ignore-cd /ntldr
chainloader /ntldr
 
iftitle [find --ignore-floppies --ignore-cd /cmldr]  Find and Load CMLDR of Windows NT/2K/XP
find --set-root --ignore-floppies --ignore-cd /cmldr
chainloader /cmldr
 
iftitle [find --ignore-floppies --ignore-cd /io.sys]  Find and Load IO.SYS of Windows 9x/Me
find --set-root --ignore-floppies --ignore-cd /io.sys
chainloader /io.sys
 
iftitle [find --ignore-floppies --ignore-cd /sbin/init]  Find and Boot Linux with menu.lst already installed
find --set-root --ignore-floppies --ignore-cd /sbin/init
configfile /%grub%/menu.lst


#iftitle [if "%USB%"=="1" && if exist (hd0,0)/boot/grub/grldr]  Grub4dos (hd0,0)\n    Boot Grub4dos (hd0,0)
#root (hd0,0)
#chainloader (hd0,0)/boot/grub/grldr
#boot

iftitle [if "%USB%"=="1" && if exist (hd0,1)/boot/grub/grldr]  Grub4dos (hd0,1)\n    Boot Grub4dos (hd0,1)
root (hd0,1)
chainloader (hd0,1)/boot/grub/grldr
boot

iftitle [if "%USB%"=="0" && if exist /boot/grub/g2ldr]  Grub2\n    Boot Grub2 (bd)
find --set-root --ignore-floppies /boot/grub/g2ldr
chainloader /boot/grub/g2ldr
boot

iftitle [if "%USB%"=="1" && if exist (hd0,0)/boot/grub/g2ldr]  Grub2 (hd0,0)\n    Boot Grub2 (hd0,0)
root (hd0,0)
chainloader (hd0,0)/boot/grub/g2ldr
boot

iftitle [if "%USB%"=="1" && if exist (hd0,1)/boot/grub/g2ldr]  Grub2 (hd0,1)\n    Boot Grub2 (hd0,1)
root (hd0,1)
chainloader (hd0,1)/boot/grub/g2ldr
boot

iftitle [if "%USB%"=="0" && if exist /boot/isolinux/isolinux.bin]  Isolinux\n    Isolinux
find --set-root --ignore-floppies /boot/isolinux/isolinux.bin
chainloader --force /boot/isolinux/isolinux.bin
boot

iftitle [if "%USB%"=="0" && if exist /isolinux/isolinux.bin]  Isolinux\n    Isolinux
find --set-root --ignore-floppies /isolinux/isolinux.bin
chainloader --force /isolinux/isolinux.bin
boot

iftitle [if "%USB%"=="1" && if exist (hd0,0)/boot/isolinux/syslinux.bin]  Syslinux  (hd0,0)\n    Boots Syslinux from USB - Remember to run make MBR and syslinux.bin bat so that your USB boots
root (hd0,0)
chainloader (hd0,0)/boot/isolinux/syslinux.bin
boot

iftitle [if "%USB%"=="1" && if exist (hd0,1)/boot/isolinux/syslinux.bin]  Syslinux  (hd0,1)\n    Boots Syslinux from USB - Remember to run make MBR and syslinux.bin bat so that your USB boots
root (hd0,1)
chainloader (hd0,1)/boot/isolinux/syslinux.bin
boot

iftitle [if "%USB%"=="1" && if exist (hd0,0)/boot/syslinux/syslinux.bin]  Syslinux  (hd0,0)\n    Boots Syslinux from USB - Remember to run make MBR and syslinux.bin bat so that your USB boots
root (hd0,0)
chainloader (hd0,0)/boot/syslinux/syslinux.bin
boot

iftitle [if "%USB%"=="1" && if exist (hd0,1)/boot/syslinux/syslinux.bin]  Syslinux  (hd0,1)\n    Boots Syslinux from USB - Remember to run make MBR and syslinux.bin bat so that your USB boots
root (hd0,1)
chainloader (hd0,1)/boot/syslinux/syslinux.bin
boot

title  NTBOOT Menu
configfile /%grub%/APPS/NTBOOT.LST/menu.lst


title  Boot alternate bootloader from another HDD Menu
configfile /%grub%/APPS/OtherHDD.lst

title
root () > nul && configfile (bd)/%grub%/main.hdr



title  Utilities Menu \n    A collection of utilities to help with common annoyances.
configfile /%grub%/UTILITY.lst



iftitle [if "%USB%"=="0" && ls (bd)/_ISO/ > nul]  Run any file in (bd)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(bd)
configfile /%grub%/ISODIR.lst

iftitle [ ls (hd0,0)/_ISO/ > nul]  Run any file in (hd0,0)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd0,0)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd0,1)/_ISO/ > nul]  Run any file in (hd0,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd0,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd0,2)/_ISO/ > nul]  Run any file in (hd0,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd0,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd0,3)/_ISO/ > nul]  Run any file in (hd0,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd0,3)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd1,0)/_ISO/ > nul]  Run any file in (hd1,0)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd1,0)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd1,1)/_ISO/ > nul]  Run any file in (hd1,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd1,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd1,2)/_ISO/ > nul]  Run any file in (hd1,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd1,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd1,3)/_ISO/ > nul]  Run any file in (hd1,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd1,3)
configfile /%grub%/ISODIR.lst


iftitle [ls (hd2,0)/_ISO/ > nul]  Run any file in (hd2,0)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd2,0)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd2,1)/_ISO/ > nul]  Run any file in (hd2,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd2,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd2,2)/_ISO/ > nul]  Run any file in (hd2,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd2,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd2,3)/_ISO/ > nul]  Run any file in (hd2,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd2,3)
configfile /%grub%/ISODIR.lst


iftitle [ls (hd3,0)/_ISO/ > nul]  Run any file in (hd3,0)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd3,0)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd3,1)/_ISO/ > nul]  Run any file in (hd3,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd3,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd3,2)/_ISO/ > nul]  Run any file in (hd3,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd3,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd3,3)/_ISO/ > nul]  Run any file in (hd3,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd3,3)
configfile /%grub%/ISODIR.lst


iftitle [ls (hd4,0)/_ISO/ > nul]  Run any file in (hd4,0)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd4,0)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd4,1)/_ISO/ > nul]  Run any file in (hd4,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd4,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd4,2)/_ISO/ > nul]  Run any file in (hd4,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd4,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd4,3)/_ISO/ > nul]  Run any file in (hd4,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd4,3)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd5,1)/_ISO/ > nul]  Run any file in (hd5,1)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd5,1)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd5,2)/_ISO/ > nul]  Run any file in (hd5,2)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd5,2)
configfile /%grub%/ISODIR.lst

iftitle [ls (hd5,3)/_ISO/ > nul]  Run any file in (hd5,3)\\_ISO\n Run any file in the \\_ISO folder and below
set hdd=(hd5,3)
configfile /%grub%/ISODIR.lst

iftitle [ls (bd)/_ISO/MNU/ > nul]  Run any mnu in \\_ISO\\MNU\n Uses the Easy2Boot .mnu files\n located under the \\_ISO\\MNU folder
(bd)/%grub%/automn.g4b .automenu /_ISO/MNU
# Load the new configfile
configfile (md)0x3000+0x50

iftitle [if "%USB%"=="1" && if not "%CALL%"=="0"]  Install Windows from ISO (%CALL% present)\n Install Windows to a Hard Disk from an ISO file\n Empty folders are not listed in next menu
configfile (bd)/%grub%/MenuWinInstall.lst



iftitle [if exist /boot/pxeboot.0]  pxeboot.0
pxe keep
chainloader --raw /boot/pxeboot.0


title  ByPass Windows Password (PassPass)\n Holmes.Sherlock's PassPass.g4b patcher utility.\n Patches a Windows DLL to allow any password to be used\n UnPatch after use.
insmod /%grub%/wenv > nul
/%grub%/APPS/PPass.g4b
delmod /%grub%/wenv > nul
configfile (bd)/%grub%/main.hdr


iftitle [if exist (fd0)/kernel.sys || (fd0)/io.sys || (fd0)/ibmio.sys || (fd0)/ibmdos.sys]  Boot FreeDOS as Hard Disk (fd0)\n Boot from this USB drive as Hard Disk C: hard disk as 2nd disk
map --unhook
map --unmap=0:0x82
#Next line checks if we booted as a floppy drive (0) - if so we cannot convert to a hard disk
checkrange 0x00 read 0x8280 && clear && find && echo Sorry - cannot map this floppy device as a hard disk! && pause && configfile (bd)/%grub%/menu.lst
find
rootnoverify (fd0)
chainloader (fd0)/kernel.sys || chainloader (fd0)/io.sys || chainloader (fd0)/ibmio.sys || chainloader (fd0)/ibmdos.sys
clear

iftitle [if exist (hd0,0)/kernel.sys || (hd0,0)/io.sys || (hd0,0)/ibmio.sys || (hd0,0)/ibmdos.sys]  Boot FreeDOS as Hard Disk (hd0,0)\n Boot from this USB drive as Hard Disk C: hard disk as 2nd disk
map --unhook
map --unmap=0:0x82
#Next line checks if we booted as a floppy drive (0) - if so we cannot convert to a hard disk
checkrange 0x00 read 0x8280 && clear && find && echo Sorry - cannot map this floppy device as a hard disk! && pause && configfile (bd)/%grub%/menu.lst
find
rootnoverify (hd0,0)
chainloader (hd0,0)/kernel.sys || chainloader (hd0,0)/io.sys || chainloader (hd0,0)/ibmio.sys || chainloader (hd0,0)/ibmdos.sys
clear

iftitle [if exist (hd0,1)/kernel.sys || (hd0,1)/io.sys || (hd0,1)/ibmio.sys || (hd0,1)/ibmdos.sys]  Boot FreeDOS as Hard Disk (hd0,1)\n Boot from this USB drive as Hard Disk C: hard disk as 2nd disk
map --unhook
map --unmap=0:0x82
#Next line checks if we booted as a floppy drive (0) - if so we cannot convert to a hard disk
checkrange 0x00 read 0x8280 && clear && find && echo Sorry - cannot map this floppy device as a hard disk! && pause && configfile (bd)/%grub%/menu.lst
find
rootnoverify (hd0,1)
chainloader (hd0,1)/kernel.sys || chainloader (hd0,1)/io.sys || chainloader (hd0,1)/ibmio.sys || chainloader (hd0,1)/ibmdos.sys
clear


title  Display HDDs
find 
if "%USB%"=="1" && root (hd0,0)
if "%USB%"=="1" && root (hd0,1)
pause
configfile /%grub%/main.hdr


iftitle [if "%USB%"=="1"]  USB Partition Menu
configfile /%grub%/Partition.lst

title  Reboot
reboot

title
root () > nul && configfile (bd)/%grub%/main.hdr


iftitle [if "%USB%"=="0" && if exist /boot/XP.wim]  MiniXP WinPE (May Not Work)
chainloader /%grub%/XPLOADER.BIN

iftitle [if "%USB%"=="1" && if exist /boot/XP.wim]  MiniXP WinPE
chainloader /%grub%/XPLOADER.BIN

  
iftitle [if "%USB%"=="1" && if exist /sources/boot.wim]  Multiboot:\\sources\\boot.wim\n  Must select boot.wim in the bcd menu.
configfile /%grub%/APPS/Wim.lst

iftitle [if "%USB%"=="1" && if exist /sources/Win8.wim]  Multiboot:\\sources\\win8.wim\n  Must select win8.wim in the bcd menu.
configfile /%grub%/APPS/Wim8.lst

iftitle [if "%USB%"=="1" && if exist /sources/Win7.wim]  Multiboot:\\sources\\win7.wim\n  Must select win7.wim in the bcd menu.
configfile /%grub%/APPS/Wim7.lst

iftitle [if "%USB%"=="1" && if exist /sources/w8x86.wim]  Multiboot:\\sources\\w8x86.wim\n  Must select w8x86.wim in the bcd menu.
configfile /%grub%/APPS/w8x86.lst

iftitle [if "%USB%"=="1" && if exist /sources/w8x64.wim]  Multiboot:\\sources\\w8x64.wim\n  Must select w8x64.wim in the bcd menu.
configfile /%grub%/APPS/w8x64.lst

iftitle [if "%USB%"=="1" && if exist /sources/w7x86.wim]  Multiboot:\\sources\\w7x86.wim\n  Must select w7x86.wim in the bcd menu.
configfile /%grub%/APPS/w7x86.lst

iftitle [if "%USB%"=="1" && if exist /sources/w7x64.wim]  Multiboot:\\sources\\w7x64.wim\n  Must select w7x64.wim in the bcd menu.
configfile /%grub%/APPS/w7x64.lst


title
root () > nul && configfile (bd)/%grub%/main.hdr



iftitle [if exist /HBCD/menu.lst]  Hirrens Boot CD\n    A collection of tools for Windows repairs.
configfile /HBCD/menu.lst


iftitle [if exist /casper/BT5/casper/vmlinuz]  BackTrack 5 (1024x768) Persistent\n    Type startx (needs BT5 extracted in \\casper\\BT5\\ and .disk dir in root)
kernel /casper/BT5/casper/vmlinuz file=/cdrom/preseed/custom.seed live-media-path=/casper/BT5/casper boot=casper persistent locale=en_US.UTF-8 keyb=us textonly noprompt vga=791--
initrd /casper/BT5/casper/initrd.gz


iftitle [if exist /casper/vmlinuz]  Ubuntu 12.14\n    Needs .disk dir and Casper in root
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed live-media-path=/casper boot=casper locale=en_US.UTF-8 keyb=us textonly noprompt vga=791--
initrd /casper/initrd.lz


iftitle [if exist /_ISO/PARTITION/pmagic_2013_06_15.iso]  PC CMOS Cleaner and Parted Magic
find --set-root /_ISO/PARTITION/pmagic_2013_06_15.iso 
map /_ISO/PARTITION/pmagic.iso (hd32) || map --mem  /_ISO/PARTITION/pmagic_2013_06_15.iso (hd32) 
map --hook 
root (hd32) 
kernel /pmagic/bzImage edd=off iso_location=/_ISO/PARTITION/ iso_filename=/_ISO/PARTITION/pmagic_2013_06_15.iso noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=788 loglevel=0 max_loop=256 vmalloc=256MiB 
initrd /pmagic/initramfs

iftitle [if exist /_ISO/PARTITION/pmagic_2013_06_15.iso]  Parted Magic pmagic_2013_06_15.iso
find --set-root /_ISO/PARTITION/pmagic_2013_06_15.iso   
map /_ISO/PARTITION/pmagic_2013_06_15.iso (hd32) || map --mem  /_ISO/PARTITION/pmagic_2013_06_15.iso (hd32)   
map --hook    
root (hd32)   
kernel /pmagic/bzImage  iso_filename=/_ISO/PARTITION/pmagic_2013_06_15.iso  noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=256MiB  
initrd /pmagic/initrd.img


and ISODIR.lst

 

if not "%GFX%"=="" gfxmenu /%grub%/%GFX%
color light-gray/blue yellow/dark-gray white/black white/black
splashimage=/%grub%/BG.bmp.gz
#Are we booting from a CD?
set CD=0 && geometry (cd) > nul  && set CD=1
set USB=0 && geometry (cd) > nul  || set USB=1
#clear TT for XP menu later
set TT=
write 0x8274 0x2001 > nul
if "%HCOLOUR%"=="" set HCOLOUR=0133
if "%HEADING%"=="" set HEADING=\x20                Grub4Dos - %hdd%//ISO MENU                   \x20
if "%HELPTEXT%"=="" set HELPTEXT=see www.RMPrepUSB.com  - Tutorial 72a
write (md)0x220+1 !BAT\necho -n -P:0000 $[%HCOLOUR%]%HEADING%\necho -n -P:%HBTM% $[%FCOLOUR%]%HELPTEXT%\0 > nul
initscript (md)0x220+1



title  Grub4dos Main Menu
#configfile /%grub%/menu.mnu
configfile %LBACKMENU%



iftitle [ls %hdd%/_ISO/AUTO/ > nul]  Run any file in %hdd%\\_ISO\\AUTO\n Run any file in the %hdd%\\_ISO\\AUTO folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/AUTO
configfile (md)0x3000+0x50


iftitle [ls %hdd%/_ISO/ANTIVIRUS/ > nul]  Run any file in %hdd%\\_ISO\\ANTIVIRUS\n Run any file in the%hdd%\\_ISO\\ANTIVIRUS folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/ANTIVIRUS
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/BACKUP/ > nul]  Run any file in %hdd%\\_ISO\\BACKUP\n Run any file in the %hdd%\\_ISO\\BACKUP folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/BACKUP
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/BOOT/ > nul]  Run any file in %hdd%\\_ISO\\BOOT\n Run any file in the %hdd%\\_ISO\\BOOT folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/BOOT
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/DIAGNOSTIC/ > nul]  Run any file in %hdd%\\_ISO\\DIAGNOSTIC\n Run any file in the %hdd%\\_ISO\\DIAGNOSTIC folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/DIAGNOSTIC
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/DOS/ > nul]  Run any file in %hdd%\\_ISO\\DOS\n Run any file in the %hdd%\\_ISO\\DOS folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/DOS
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/LINUX/ > nul]  Run any file in %hdd%\\_ISO\\LINUX\n Run any file in the %hdd%\\_ISO\\LINUX folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/LINUX
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/MAC/ > nul]  Run any file in %hdd%\\_ISO\\MAC\n Run any file in the %hdd%\\_ISO\\MAC folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/MAC
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/PARTITION/ > nul]  Run any file in %hdd%\\_ISO\\PARTITION\n Run any file in the %hdd%\\_ISO\\PARTITION folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/PARTITION
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/UTILITIES/ > nul]  Run any file in %hdd%\\_ISO\\UTILITIES\n Run any file in the %hdd%\\_ISO\\UTILITIES folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/UTILITIES
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/WIFI/ > nul]  Run any file in %hdd%\\_ISO\\WIFI\n Run any file in the %hdd%\\_ISO\\WIFI folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/WIFI
configfile (md)0x3000+0x50

iftitle [ls %hdd%/_ISO/WINpe/ > nul]  Run any file in %hdd%\\_ISO\\WINpe\n Run any file in the %hdd%\\_ISO\\WINpe folder and below
/%grub%/ISODir.g4b .automenu %hdd%/_ISO/WINpe
configfile (md)0x3000+0x50

and ISODir.g4b

!BAT

::set DD=0
::Uncomment line below to show debug lines
::set DD=1

debug off
checkrange 20101214:-1 read 0x8278 || echo Err.version && exit 1
:: this batch file calls itself, so use the label as the place to jump to
goto %~x1
exit

:.automenu

:: Variables: %0=/xx/automenu.bat %~nx0=automenu.bat %~nx1=.automenu %1=.automenu %~x1=.automenu
::echo 0=%0 nx0=%~nx0 nx1=%~nx1 nx2=%~nx2 nx3=%~nx3 1=%1 x1=%~x1
:: get the menu folder into DIR variable
::echo Checking if .makemenu is loaded - if not load it
::delmod -l %~nx0 || insmod %0 .makemenu
if not "%MOD%"=="1" delmod -l %~nx0 || insmod %0

if "%DD%"=="1" echo Writing default menu entry
if "%DD%"=="1" echo -e default 0\n#timeout 10\n\n > (md)0x3000+0x50
if exist (bd)/%grub%/AUTO.HDR echo Using default user menu /%grub%/AUTO.HDR...
cat --length=0 (bd)/%grub%/AUTO.HDR && cat (bd)/%grub%/AUTO.HDR > (md)0x3000+0x50
set ME=%0

if "%2"=="" goto :endloop
set DIR=%2
echo Using %DIR% as main folder for boot files
echo set MFOLDER=%DIR% >> (md)0x3000+0x50
echo Looking for files starting at %DIR%
ls %DIR%/ | call :cpa

:endloop
::echo writing 'back to main menu' entry into menu as last item
if "%GFX%"=="" goto :DOHOT
#if not "%LBACKMENU%"=="" echo -e -n \ntitle Boot to first HDD >> (md)0x3000+0x50
#if not "%LBACKMENU%"=="" echo -n \n Boot to the first internal Hard Disk (HDD0). >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" if not exist CD echo -e \nmap (hd0) (hd1) \&\& map (hd1) (hd0) >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" if not exist CD echo -e map --hook >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nchainloader (hd0)+1  >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e rootnoverify (hd0) >> (md)0x3000+0x50

if not "%LBACKMENU%"=="" echo -e -n \ntitle Back to ISO Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -n \n Go back to ISO Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nconfigfile (md)0xA000+0x50 \|\| configfile /%grub%/ISODIR.lst >> (md)0x3000+0x50

if not "%LBACKMENU%"=="" echo -e -n \ntitle Back to Main Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -n \n Go back to the Main Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nconfigfile (md)0xA000+0x50 \|\| configfile /%grub%/main.hdr >> (md)0x3000+0x50

#echo -e -n \ntitle Reboot >> (md)0x3000+0x50
#echo -n \n Reboot the system. >> (md)0x3000+0x50
#echo -e \nreboot >> (md)0x3000+0x50

goto :FINMEN
:DOHOT

#if not "%LBACKMENU%"=="" echo -e -n \ntitle ^F7 Boot to first HDD [F7] >> (md)0x3000+0x50
#if not "%LBACKMENU%"=="" echo -n \n Boot to the first internal Hard Disk (HDD0). >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" if not exist CD echo -e \nmap (hd0) (hd1) \&\& map (hd1) (hd0) >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" if not exist CD echo -e map --hook >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nchainloader (hd0)+1  >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e rootnoverify (hd0) >> (md)0x3000+0x50

if not "%LBACKMENU%"=="" echo -e -n \ntitle Back to ISO Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -n \n Go back to ISO Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nconfigfile (md)0xA000+0x50 \|\| configfile /%grub%/ISODIR.lst >> (md)0x3000+0x50

if not "%LBACKMENU%"=="" echo -e -n \ntitle ^F8 Back to Main Menu [F8] >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -n \n Go back to the Main Menu >> (md)0x3000+0x50
if not "%LBACKMENU%"=="" echo -e \nconfigfile (md)0xA000+0x50 \|\| configfile /%grub%/menu.lst >> (md)0x3000+0x50

#echo -e -n \ntitle \^F9 Reboot            [F9] >> (md)0x3000+0x50
#echo -n \n Reboot the system. >> (md)0x3000+0x50
echo -e \nreboot >> (md)0x3000+0x50

#echo -e -n \ntitle \^F10 Power off         [F10] >> (md)0x3000+0x50
#echo -n \n Switch off the system. >> (md)0x3000+0x50
echo -e \nhalt >> (md)0x3000+0x50
:FINMEN


set DD=
set DIR=
set hlp=
:: must set root back!
root (bd)/
delmod %~nx0 > nul

debug 1
exit

:: ----------------------- SUBROUTINES ----------------------


:.makemenu
if "%DD%"=="1" echo @MAKEMENU
setlocal
if "%DD%"=="1" echo Checking %DIR%/%1
if "%1"=="" endlocal && goto :EOF
::If is a directory ignore it
::ZZZcat --length=0 %DIR%/%1 || goto :EOF
if "##"=="#%~x1#" goto :eof

:: if .txt file then ignore but use as title line
if /i "#.txt#"=="#%~x1#" goto :eof
if /i "#.mnu#"=="#%~x1#" goto :eof
if "#.#"=="#%~x1#" goto :eof
echo Adding %DIR%/%1
echo -e \n >> (md)0x3000+0x50
::ZZZcat --length=0 %DIR%/%~n1.TXT && echo ADDING %DIR%/%~n1.TXT
::ZZZcat --length=0 %DIR%/%~n1.TXT && cat %DIR%/%~n1.TXT >> (md)0x3000+0x50  ! echo title %1\n Boot to %DIR%/%1 >> (md)0x3000+0x50
cat --length=0 (bd)%DIR%/%~n1.TXT && echo ADDING %DIR%/%~n1.TXT && cat %DIR%/%~n1.TXT >> (md)0x3000+0x50  ! echo title %1\n Boot to %DIR%/%1 >> (md)0x3000+0x50
echo -e \n >> (md)0x3000+0x50
#echo /%grub%/QRUN.g4b %DIR%/%1 >> (md)0x3000+0x50
if "%USB%"=="0" && echo /%grub%/QRUNcd.g4b %DIR%/%1 >> (md)0x3000+0x50
if "%USB%"=="1" && echo /%grub%/QRUN.g4b %DIR%/%1 >> (md)0x3000+0x50
echo -e \nboot >> (md)0x3000+0x50
goto :EOF


:cpa
if "%DD%"=="1" echo @CPA: Current Root: %DIR%
if "%DD%"=="1" echo Change source root to %DIR%/
root %DIR%/
ls | call :copyfiles
goto :eof

:copyfiles
if "%DD%"=="1" echo @COPYFILES %1
if "%1"=="" goto :eof
::If is a directory
cat --length=0 /%1 || goto :sub-dir
::if "##"=="#%~x1#" goto :sub-dir

::copy file
if "%DD%"=="1" echo @COPY FILE
call :.makemenu %1
shift
goto :copyfiles

:sub-dir
if "%DD%"=="1" echo @SUB_DIR %1
setlocal
set DIR=%DIR%/%1
call :cpa
endlocal
shift
goto :copyfiles



#328 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 25 June 2013 - 07:32 PM

Easy2Boot Upgrade DPMS package (BETA) now available.

 

This enhances the current 'XP install from ISO' function. If you add the updated E2B files and download and add the DriverPack Mass Storage driver package (approx. 8MB download but 50MB when unzipped) you will have the option to autodetect the correct AHCI/SATA/RAID driver.

 

The installation method is still the same - you must manually use F6 and select the AHCI driver + Firadisk driver ( + WinVBlock driver (optional))  - however usually there will only be one AHCI driver present in the F6 list, so you will not have to guess which one to pick! Also, as the DriverPack contains non-Intel drivers, E2B XP installs from ISO should now work on non-Intel AHCI platforms.

 

If you want to try it, please email me and I will send you the version to test. I will not post it as it is only a BETA and I don't want a flood of complaints from naive users!

There are also bugs in the DriverPack (as I found out!), so it may not always work!

 

cheers

Steve



#329 halikus

halikus

    Frequent Member

  • Advanced user
  • 110 posts
  •  
    Canada

Posted 30 June 2013 - 06:55 PM

I have this simple g4b i adapted to run during menu.lst after adding the auto iso dir.  It scans for an existing Windows install and lists it in the main menu.  If there are none, it exits.  My only problem is that it displays it after the auto iso entries at the bottom.  Is there a way to force them to be first in the final menu?  I do use menu entries in main.hdr so that may be the problem. 

 

!BAT
#/%grub%/DetGrub.g4b
setlocal
debug off
set menu=(md)0x3000+0x50
find --set-root --devices=h makeactive --status || echo No Active Partitions.
find --devices=h call :add_sys ()
if exist nt_ver && configfile (md)0x3000+0x50
echo No Windows OS found on any drives.
exit

:add_sys
call :getver || exit
echo title Microsoft Windows %sys_ver% on %@root%\n\n\t\tWindows %sys_ver% on %@root% >> %menu%
echo command /%grub%/APPS/NTBOOT %nt_ver%=%@root% >> %menu%
#debug off
exit

:getver
map --mem ()/windows/system32/version.dll (rd) || map --mem ()/winnt/system32/version.dll (rd)
calc *0x82d0=*0x82d0+*0x82d8-0x800
calc *0x82d8=0x800
cat --locate=\0\0\x44\0\0\0 --number=1 (rd)+1 | set skip=
set /a skip=0x%skip%-0x30
cat --locate=\0\0\0 --skip=%skip% --number=1 (rd)+1 | set skip=
calc *0x82d0=*0x82d0+0x%skip%+3
call Fn.67 *0x82d0 0x60000 3
cat (md)0x300+1,1 | set nt_ver=NT
cat (md)0x300+1,3 | goto :_
set sys_ver=Unknown System
exit
:_5.0
set sys_ver=2000
exit
:_5.1
set sys_ver=XP
exit
:_5.2
set sys_ver=2003
exit
:_6.1
set sys_ver=7/2008
exit
:_6.2
set sys_ver=8
exit

 

Also, as i don't understand how you find the hex locations to use, is there a good reference listing common offsets?   I have been experimenting with the above script but can't figure out how to alter it.  Im trying a simple scan for grldr in all drives with boot\grub\grldr or menu.lst, and to list them all in the main menu if found (as an example).  It should be easy as i don't need a version check, but the best i could come up with is below, and it is useless.  Is there a simple way to add found files on all drives and add them to the menu?

 

!BAT
setlocal
debug off
set menu=(md)0x3000+0x50
#find --set-root --devices=h makeactive --status || echo No Active Partitions.
find --devices=h call :add_grub ()
if exist grub_ver && configfile (md)0x3000+0x50
echo No grld found on any drives.
exit

:add_grub
call :getgrub || exit
echo title Grub4dos on %@root%\n\n\t\tGrub4dos on %@root% >> %menu%
echo chainload %@root%/boot/grub/grldr= >> %menu%
exit

:getgrub
map --mem ()/boot/grub/grldr (rd) || map --mem ()/boot/grub/grldr (rd)
#calc *0x82d0=*0x82d0+*0x82d8-0x800
#calc *0x82d8=0x800
cat --locate=\0\0\x44\0\0\0 --number=1 (rd)+1 | set skip=
set /a skip=0x%skip%-0x30
cat --locate=\0\0\0 --skip=%skip% --number=1 (rd)+1 | set skip=
#calc *0x82d0=*0x82d0+0x%skip%+3
#call Fn.67 *0x82d0 0x60000 3
#cat (md)0x300+1,1 | set grub_ver=Grub4dos
cat (md)0x300+1,3 | goto :_
exit


#330 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 30 June 2013 - 07:59 PM

I would use (md) not (rd).

 

Then you know what address the file is loaded to. If you don't set a base address for (rd) then it just uses top of memory (and in some cases it just ignores rd-base anyway!)

 

The grub4dos version is in memory at the fixed address 0x8278. Grub loads at 0x6200  or (md)0x31.

 

5D 03 33 01 at 0x2078 in the file  = 0x0133045d = 20120413  which is the date of the version

 

Maybe you can do something with

 

cat --length=4 --skip=0x2078 --hex /grldr | call :getbytes=

 

:getbytes

:: %2 %3 %4 %5 are bytes 5D 03 33 01

:: now add these together (see below)

 

 

or

cat --length=4 --skip=0x2078 --hex /grldr | set a=
echo %a:~10,2% | set b0=
echo %a:~12,2% | set b1=
echo %a:~14,2% | set b2=
echo %a:~16,2% | set b3=.
set /a Tot=0x%b3%%%b2%%%b1%%%b0%

 

should give Tot = 20120413 which is the date  (untested!)



#331 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15183 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 July 2013 - 09:05 AM

I have this simple g4b i adapted to run during menu.lst after adding the auto iso dir.  It scans for an existing Windows install and lists it in the main menu.  If there are none, it exits.  

OT :ph34r:, but not much ;), that batch assumes that Windows is actually installed in a directory named "windows".

 

If you check PassPass:

http://reboot.pro/to...s-the-password/

it has a routine that will try and locate windows installs whatever the directory is named.

 

:cheers:

Wonko



#332 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 05 July 2013 - 12:01 PM

Easy2Boot DPMS2 Update package now available here.

  • Auto-F6 SRS floppies made. Adds [Config.xxx] sections to txtsetup.oem so should work with scsi drives too.
  • If using an E2B USB-HDD and FiraDisk + OEM SRS driver then you need to load the ISO into memory (answer Y to the question just after DPMS2 runs).
  • If using an E2B USB-flash drive and FiraDisk then you don't need to load the ISO into memory (just press Enter or let it timeout).
  • Includes improved (faster) alphabetical menu sort code for E2B.

Tested on 4 VMs and two real systems.

 

cheers

Steve



#333 skooper1895

skooper1895
  • Members
  • 2 posts
  •  
    United States

Posted 18 July 2013 - 05:31 AM

Forgive me if I sound silly, but I tried to follow http://www.rmprepusb...-boot-USB-drive and it didn't work either with the included grldr (which seems to be from Grub4DOS 0.45c 2013-7-10) or the grldr from Grub4DOS 0.46a 2013-6-30 (later versions of 0.46a make the CPU fan really loud when starting up).

 

The computer I used was a HP Pavillion P6000 Series.

 

I extracted Easy2Boot_v1.04.zip to my boot partition, which is the first partition on the internal HDD and is primary, NTFS-formatted, and 107 MB. The only file I didn't extract was menu.lst.

 

Then I manually typed the following in the menu.lst I already had on my boot partition (I'm already using Grub4DOS as my bootloader on this computer):

 

title Easy2Boot
set grub=_ISO/e2b/grub
configfile /%grub%/menu.lst

 

Then I defragged my entire boot partition with WinContig 1.15a (note that I haven't added any payload files or modified any of the files or folders included in Easy2Boot in any way. Also note that if I add any payload files it'll have to be on another partition... there's a section in the tutorial for that when I get to doing it... but anyway...)

 

Then I rebooted and selected the Easy2Boot entry I'd typed in, and this was part of the output (I didn't copy down all of it). I made some notes in brackets:

 

Checking last sector is accessible...

BIOS BAD!

WARNING: THIS BIOS MAY HAVE PROBLEMS ACCESSING FILES ON THIS DRIVE! [***NOTE: Is this the 137GB bug? My HDD is 640GB]

/_ISO/e2b/grub/E2B.cfg is MISSING! [***NOTE: Then how did /_ISO/e2b/grub/menu.lst get loaded? Did the %grub% variable not persist?]

 

Then I hit a key and Easy2Boot tried to go on. It said something about loading a unicode thing and then it said OK. Then it increased the resolution (the text got a lot smaller... that's pretty cool). It tried to load a background and it couldn't. Then it output lines about trying to load some commands and not being able to, interspersed with lines about "Booting Easy2Boot (2)", "Booting Easy2Boot (3)", "Booting Easy2Boot (4)", then it said ERROR... something something PIN table 4 already used (I have 4 primary partitions--does that have anything to do with it? I think I could get rid of one or two of them without much trouble.) Then it dumped me to the Grub4DOS command prompt.

 

I have a USB HDD with Grub4DOS on it that I can try putting Easy2Boot on later to see if that'll work.

 

Thanks for reading this, and I'd appreciate any help on this even if I've been silly. :mellow: 
 


Edited by skooper1895, 18 July 2013 - 05:45 AM.


#334 halikus

halikus

    Frequent Member

  • Advanced user
  • 110 posts
  •  
    Canada

Posted 18 July 2013 - 05:43 AM

The 4 partitions i think will be a problem as E2B uses pt 4 to trick some iso's into booting.  You can temporarily fix it by commenting out line (?) 101 in menu.lst.  Your bios warning about the 137 gig limitation is CheckAccess.g4b, just rename it    for it not to load, or comment out line 24 in menu.lst.  I'm sure Steve can help more in the morning, but this may temporarily get you to the menu in the mean time.  I boot a modified version from my HDD all the time, and everything works except loading Windows ISOs.


Edited by halikus, 18 July 2013 - 05:44 AM.


#335 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 18 July 2013 - 07:30 AM

Hi

The correct version of grldr to use is the one that came with E2B 1.04, however, I suspect that you have installed grub4dos on a different partition or you have your older grub4dos grldr file on a different partition. So you need to overwrite the older version.

 

The BIOS message is usually the 137GB bug - this is very unusual for systems booting from an internal HDD (is the system very old?). It won't affect you as long as all the E2B files are within the first 137GB.

 

The E2B.cfg problem may be to do with the 137GB BIOS problem. When you get to the grub4dos command prompt, try 

 

find

ls /_ISO/e2b/grub/

cat /_ISO/e2b/grub/e2b.cfg

 

 

The partition message is certainly due to you having 4 primary (or 3 primary+1 extended) partition. The Tutorial clearly (I thought!) explains this.

 

Lastly, E2B is intended to be run on an external USB drive. It should work on an internal HDD (mostly) but things like installing XP and some other PE/Recovery ISOs may not work because it is expected that the boot disk (hd0) is not the internal disk and so some commands swap (hd0) with (hd1) so that (hd1) (what E2B thinks is the internal HDD)  becomes (hd0).

If you have any valuable files on the internal hard disk, please don't blame me if there is an accident when running E2B - it is at your own risk if you use it outside it's design parameters!

 

P.S. When you get to the grub4dos console, the version number is displayed at the top.



#336 skooper1895

skooper1895
  • Members
  • 2 posts
  •  
    United States

Posted 19 July 2013 - 09:28 PM

OK I was silly. I fixed my problem by deleting my fourth primary partition.



#337 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 26 July 2013 - 01:17 AM

Hi,

 

I'd like to create a Easy2Boot USB drive which also supports Windows To Go. To make it complicated I want to have 2 partitions for windows. But I just have one additional Partition to work with (because Easy2Boot needs 3 and 4). So I tried 3 different approaches, which all didn't work:
- Windows To Go in .vhd file:
   - works if the Win Bootloader is installed on the partition where the .vhd file is.

   - bluescreens after a few seconds of booting from Easy2Boot. Installed BCD inside of the .vhd to get it this far.
- Windows To Go on a real partition

   - just Windows to go on a primary partition with BCD works fine

   - with Easy2Boot it requires an extended+2logical partitions.

   - couldn't get it to boot (chainload), guess I did something wrong.
- Windows To Go in a .vhd on the Easy2Boot partition, BCD on a 2nd Partition

   - couldn't get it to boot

 

Well... I just got another idea what I could try...

 

Another thing:
Sadly my notebook doesn't support booting from USB3. Would it be possible (without lots of work (drivers...)) to do the following:
- Boot Easy2Boot (grub4dos) from USB2
- Store everything in the RAM
- Replug the Stick into the USB3 port
- Continue booting


Edited by Mimos, 26 July 2013 - 01:22 AM.


#338 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 26 July 2013 - 06:48 AM

A bit short on details!

USB drive is a flash or USB HDD?

Windows to go is Windows 7 or Windows 8?

 

Remember that Windows can only see the first partition of a USB Flash drive (even though grub4dos can see all partitions). So if you are using a USB Flash drive then WinToGo will need to be on the first ptn. Also, if you want to use E2B for things like booting WinPE or Windows Install ISOs that will also need to be on the 1st ptn.

 

So I suggest you just use a large 1st ptn for both WinToGo and E2B. If you must have separate ptns then you will have to accept limited functionality and put some E2B files on a 2nd ptn (see end of Tutorial 72a for details).

 

If you are using a USB HDD then I am not sure why it is not working and you need to give more details.



#339 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15183 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 07:55 AM

Remember that Windows can only see the first partition of a USB Flash drive (even though grub4dos can see all partitions). So if you are using a USB Flash drive then WinToGo will need to be on the first ptn. Also, if you want to use E2B for things like booting WinPE or Windows Install ISOs that will also need to be on the 1st ptn.

Or you need to have a filter driver such as cfadisk.sys or dummydisk.sys installed to the Windows.

Compatibility of those (up to 7) has been confirmed, cannot say about 8.

 

@Mimos

There is the possibility to use/adapt the "XP Kansas City Shuffle" (that has been used in the past to workaround USB1.1 speed in BIOS), but even if it can be used, the disconnection/reconnection of the USB disk would be an issue :(.

 

:cheers:

Wonko



#340 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 26 July 2013 - 01:46 PM

Hi,

 

Thanks for your answers and sorry for the shortage of detail - maybe I should have gone to bed earlier. But I was so excited about it :-).

- I tried Win8, Server 2012 and Server 2012 R2 preview, they all behaved the same.

   - didn't use MS Win To Go, unpacked install.wim with imagex instead. But I could try it for Win8.

- I use a fixed USB flash drive, so Windows recognizes the partitions without any hassle.

 

I didn't think that it was possible to have Easy2Boot and Win To Go (whithout vhd) on the same partition. So it's maybe a bit messier, but also more space efficient. I'll give it a try.

My problem with Win To go on different partitions than the 1st seems to be that I can't get the bootloader to run properly, it always tells me "Disk read error..." Even if I just have a 2nd partition. Is it impossible or am I doing something wrong (seems more likely)?

 

For the USB 3 boot issue:

The BIOS has to initialize all the drives first, so a reconnecdet drive couldn't be recoginzed. So I'd need a 2nd USB drive?



#341 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 26 July 2013 - 01:53 PM

- I use a fixed USB flash drive, so Windows recognizes the partitions without any hassle.

No such thing as a 'fixed' USB FLash drive - unless you mean you ran BootIt to make it appear as a USB Hard Disk?

Again, lack of details....



#342 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15183 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 03:19 PM

No such thing as a 'fixed' USB FLash drive - unless you mean you ran BootIt to make it appear as a USB Hard Disk?

Again, lack of details....

Talking of lack of details :whistling: "Bootit" is a bit vague, most probably you mean the "Lexar BootIt" tool, which however works with a very limited numbers of stick controllers (and I doubt with *any* USB 3.0 ) but of course there are tens of Manufacturers specific tools that can make a "Removable" (as normally set in factory) USB stick into a "Fixed" one alright.

So, if one wants, LOTS of "fixed USB flash drive" ;).

 

:cheers:

Wonko



#343 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 26 July 2013 - 04:51 PM

There is at least one fixed USB flash drives, the Kingston DataTraveler Workspace - that's the one I have.

There are a few others which should be fixed, too:

- Imation IronKey Workspace

- SPYRUS Portable Workplace
- SPYRUS Secure Portable Workplace
- Super Talent RC4
- Super Talent RC8



#344 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 26 July 2013 - 04:57 PM

Again - details. How did you make these fixed

It is just that I don't fully understand what you mean by 'fixed' - please explain...



#345 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 26 July 2013 - 05:38 PM

I didn't make it fixed, it came that way. What I want to say is, that I can use multiple partitions on it out of the box. Kingston calls it fixed, so I thougth it was the correct expression.



#346 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15183 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 06:06 PM

I didn't make it fixed, it came that way. What I want to say is, that I can use multiple partitions on it out of the box. Kingston calls it fixed, so I thougth it was the correct expression.

Yes it is correct :thumbsup:.

But maybe you need some (minimal) background (that will also explain the apparent "diffidence" Steve6375 showed :w00t:).

Since the dawn of time ALL USB stick controllers have the option to be set (by "special software") as EITHER "Fixed" or "Removable".

Due to some senseless choice (as apart from Windows, and only the Windows NT family, no other OS "cares" about this setting, nor does *any* BIOS) by the USB stick assemblers (not the actual chip manufacturers) 99.999% of USB sticks that arrive to the market have been traditionally set in factory as "Removable".

Many, many years ago, when OTi controllers were common, a "Manufacturer Tool" was found, capable of "switching" a stick from "Fixed" to "Removable" and viceversa.

Then, a number of similar tools were "leaked" from the various manufacturers, all more or less originating from China and arrived in the West directly or by means of some of our Russian friends.

These are all (generally) very complex "formatting/setting" tools, very difficult (as they are mostly UNdocumented) to use and potentially capable of killing a stick for good.

At a certain point a tool called "BootIt" leaked from Lexar technical support, providing an easy to use, "secure" (as it does nothing but flipping the "Removable" bit) tool that was compatible not only with Lexar sticks, but with a whole range of other brands (as long as they used a compatible controller).

 

So the people using USB sticks for booting have been traditionally divided in three categories:

  1. those that keep the stick as "Removable" (because it is not compatible with the Lexar BootIt or other "simplified" tool or because they cannot find the proper "full" manufacturer tool or because they don't have the guts ;) to try it) and then if they need more than one partition use software (the filter drivers I mentioned before)
  2. those that have sticks compatible with the Lexar BootIt (or other "simplified" tool) and just flip the bit
  3. those that are reckless, fear nothing and have some familiarity with complex tools and try anyway the "manufacturer tool" and succeed in flipping the bit

Of course the number of people in #1 and #2 are by far more than the ones in #3, or if you prefer it is (was) uncommon/unlikely that a new user joined the board having already a USB stick set to "Fixed", hence the initial doubt :dubbio:.

 

It is (good :thumbup:) news that some brands are now shipping USB sticks already set to "Fixed" in factory :yahoo:.

 

:cheers:

Wonko



#347 steve6375

steve6375

    Platinum Member

  • Developer
  • 7188 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 26 July 2013 - 06:19 PM

Ahh - OK - I didn't realise that they made these! So it acts like a small SSD and appears as a fixed disk to Windows.

 

In that case as long as you get the BCD correct, WinToGo should work from any partition.

 

I read that here that the device is divided - is this just pre-partitioned on delivery?

 

I would put WinToGo on ptn 1 (flat file or VHD) and just try to get that working. Then add E2B to ptn 0.



#348 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15183 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 07:30 PM

@Steve

They are seemingly an "all new" class of devices.

Inside them there is a "plain" USB to SATA bridge and the Sandforce controller (which is a SATA to MLC or however "Flash Memory" controller).

http://thessdreview....h-drive-review/

http://www.eteknix.c...rce-controller/

 

They are more similar to a "common" SATA disk connected through a USB to SATA adapter/converter.

 

:cheers:

Wonko



#349 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 27 July 2013 - 01:55 AM

@Steve
That it comes fixed was the main reason I bought this one. I wanted to be absolutely sure that I could have multiple partitions under Windows.

The other reason is that it is really fast!

On delivery it had one NTFS partition (with 64k cluser size). But it can easily be reformatted in any way you want it.

 

Then I'll try to get Win + BCD running from the 2nd Partition again, maybe I did something wrong the last time. Until now I was only able to install BCD correctly on the 1st partition. Sadly it's the only bootloader which seems to be able to boot .vhds whithout causing bluescreens - or boot Windows at all. At least that's my experience

@Wonko
Another indication for the Sandforce controller is the insane power consumption, it gets really hot quickly if used.



#350 Mimos

Mimos
  • Members
  • 7 posts
  •  
    Germany

Posted 30 July 2013 - 11:25 PM

I finally got it to work. The reason for being unable to boot with bootmgr was the file system's cluster size: you have to use 4k...
I now use the following setup:
1st partition (partition 0), active: Primary, Easy2Boot. Added a few lines in mainmenu.mnu for chainloading to hd(0,1).
2nd partition (partition 1): Windows To Go + bootmgr + BCD. I installed the BCD/bootmgr with EasyBCD. And added two entrys, one for the Win To Go and the other for going back to Easy2Boot
In addition there is a vhd on the 1st partition which I mount in Win To Go for data storage. That way I can use deduplication on this partition.

The reason for having Win on the 2nd partition and not only the bootloader is that I don't want to "endanger" the image files on the 1st partition: they need to be continuous for correct operation.

Thanks again for your help


Edited by Mimos, 30 July 2013 - 11:28 PM.






Also tagged with one or more of these keywords: grub4dos, multiboot, multipass, usb boot, iso

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users