Jump to content











Photo
- - - - -

GRUB4DOS for UEFI


  • Please log in to reply
421 replies to this topic

#26 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 02 November 2020 - 07:59 PM

It is not so mysteriously, since computer can use \EFI\Microsoft\Boot\bootmgfw.efi which file is exactly equal to the normal efi bootfile \EFI\Boot\bootx64.efi

 

I have used booting from USB with UEFI Grub4dos and not tried yet booting from internal EFI drive

 

I tried to use UEFI Grub4dos on internal EFI Drive, but indeed it fails to boot with Grub4dos and boots straight with Windows.

But I must say I can only try in UEFI Secure mode and probably UEFI Grub4dos is not compatible with Secure mode.

 

Booting from USB made with USB_FORMAT-50 or UEFI_MULTI-50 with addon and using Super UEFI Grub2 as Setting works for me.

I replaced EFI\Boot\org-bootx64.efi with UEFI Grub4dos BOOTx64.EFI renamed as org-bootx64.efi

I can boot in UEFI Secure mode from USB and select in Grub2 Menu org-bootx64 to boot UEFI Secure with Grub4dos Menu



#27 Vortex

Vortex

    Frequent Member

  • Advanced user
  • 299 posts

Posted 02 November 2020 - 08:20 PM

Hi wimb,

 

\EFI\Microsoft\Boot\bootmgfw.efi, this was the trick. I renamed this file to -bootmgfw.efi. After copied the grub4dos loader to this folder and renamed itto bootmgfw.efi. The menu.lst file moved to the root partition S: to beside the EFI folder. I was able to boot the Win10XPE.iso file using the new grub4dos loader.  Returning back to the original Windows 10 installation was a bit problematic, I had to undo the renamings. Thanks wimb

 

Hi alacran,

 

Also are you sure you disabled Fast Boot, and totally switch off the equipment, and then boot?

 

 

Thanks for your reply.  In my case, there was no need to disable Fast Boot. As I mentioned above, the successfull boot experiment is based on renaming the file S:\EFI\Microsoft\Boot\bootmgfw.efi and copying bootx64.efi ( grub4dos file ) as bootmgfw.efi to the same folder.

 

My timeout parameter is set to 10 and there is no problem.


  • alacran and Atari800XL like this

#28 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 07:38 AM

 In my case, there was no need to disable Fast Boot. As I mentioned above, the successfull boot experiment is based on renaming the file S:\EFI\Microsoft\Boot\bootmgfw.efi and copying bootx64.efi ( grub4dos file ) as bootmgfw.efi to the same folder.

 

 

I assume Safe Boot Secure Boot was disabled, as grub4dos for UEFI is not signed and MS approved.

 

Please confirm what was your setting on this parameter. to have the complete info of your test, for future reference.

 

Thanks in advance.

 

alacran



#29 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 07:39 AM

With UEFI Grub4dos I can load VHD into memory (I can see the progress counter running fine)

But the VHD with SVBus driver does not boot. Also I cannot make use of --top ---mem but only --mem is working.

Tried several ways to boot the VHD loaded into memory, but it fails ......

 

@a1ive

Booting Mini10x64 VHD with normal Grub4dos only works for me using map --top --mem so the --top is essential and map --mem does not work

UEFI Grub4dos does not allow me to map the VHD using --top but I can mount VHD only using map --mem as described here

But in that case the VHD fails to boot from RAMDISK just as is the case for normal Grub4dos without using --top

 

I think when UEFI Grub4dos would support using map --top --mem then It might be possible to boot Mini10x64 VHD from RAMDISK

What do you think ?



#30 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 07:52 AM

 

\EFI\Microsoft\Boot\bootmgfw.efi, this was the trick. I renamed this file to -bootmgfw.efi. After copied the grub4dos loader to this folder and renamed itto bootmgfw.efi. The menu.lst file moved to the root partition S: to beside the EFI folder. I was able to boot the Win10XPE.iso file using the new grub4dos loader.  Returning back to the original Windows 10 installation was a bit problematic, I had to undo the renamings. Thanks wimb

 

 

Good  :)

 

On Internal SSD_EFI Drive:

I found that UEFI Grub4dos does not support UEFI Secure booting since in that case I get Boot Violation due to unsigned file.

But I found a way to overcome this problem by booting first with Super UEFI Grub2 and then chainloader UEFI Grub4dos as done in UEFI_MULT-50 plus addon

 

It turns out that after booting with UEFI Grub4dos then the disk numbering is unexpected since in that case my GPT disk nr 0 is seen by UEFI Grub4dos as hd3

 

grub\grub.cfg

set timeout=10
set default=0

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set prefix=($root)/grub

set iso_drive=""

if [ "${grub_platform}" == "efi" ]; then

	if [ -e "/efi/boot/bootx64_win.efi" ]; then
	menuentry "Windows EFI BootManager - efi/boot/bootx64_win.efi" {
	  chainloader /efi/boot/bootx64_win.efi
	}
	fi

	if [ -e "/efi/boot/bootx64_g4d.efi" ]; then
	menuentry "UEFI Grub4dos efi/boot/bootx64_g4d.efi" {
	  chainloader /efi/boot/bootx64_g4d.efi
	}
	fi

	if [ -e "/efi/boot/grubfmx64.efi" ]; then
	menuentry "grubfm x64 EFI Boot Manager of a1ive" {
	  chainloader /efi/boot/grubfmx64.efi
	}
	fi
fi

menu.lst

color white/blue  black/light-gray white/black white/black
timeout 10
default 0

title Win10XPE - (hd3,1)/Win10XPE/Win10XPE_x64.ISO
map (hd3,1)/Win10XPE/Win10XPE_x64.ISO (0xff)
chainloader (0xff)

title Win10XPE - Find Win10XPE_x64.ISO
find --set-root /Win10XPE/Win10XPE_x64.ISO
map /Win10XPE/Win10XPE_x64.ISO (0xff)
chainloader (0xff)

title Grub2 - /efi/boot/grubx64_real.efi
chainloader /efi/boot/grubx64_real.efi

title ^Ctrl+d commandline
commandline

title [F3] reboot
reboot

title halt
halt


  • alacran likes this

#31 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 08:01 AM

I'm agree the map --top --mem may/could be necessary to properly allocate the VHD on the best place on Ram, but from the info on the spoiler of my post: http://reboot.pro/to...fi/#entry216931

 

 

Firadisk and svbus do not search memory, but directly read from the interrupt

vector table.

     intVector = ((INTERRUPT_VECTOR*)(VOID*)(virtAddr))[0x13];

 

So the answer is NO, as there is not int13h on UEFI, the driver is not capable to find the VHD once loaded on Ram so far.

 

By the way from your post No. 26

 

 

I replaced EFI\Boot\org-bootx64.efi with UEFI Grub4dos BOOTx64.EFI renamed as org-bootx64.efi

I can boot in UEFI Secure mode from USB and select in Grub2 Menu org-bootx64 to boot UEFI Secure with Grub4dos Menu

 

It was a good trick for testing, but IMHO it will be better you start thinking in give to grub4dos UEFI a new distinctive name and edit the Grub2 config on a future version of your program.

 

EDIT: I was writing when you posted. Just saw your new Grub2 config file on your last post and you already take care of the new name for grub4dos UEFI, well done my friend!.

 

 

if [ -e "/efi/microsoft/boot/bootx64_g4d.efi" ]; then
    menuentry "UEFI Grub4dos efi/microsoft/boot/bootx64_g4d.efi" {
     chainloader /efi/microsoft/boot/bootx64_g4d.efi

 

alacran



#32 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 09:19 AM

Summary of relevant latest info about VHD Rambooting under UEFI environment, on wuyou.net http://bbs.wuyou.net...ead&tid=422652:

 

Spoiler

 

alacran



#33 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 10:24 AM

A difficulty is still to return from UEFI Grub4dos menu to Grub2 menu

 

I can return to Grub2 commandline, but disk numbering has changed.

title Grub2 - /efi/boot/grubx64_real.efi
chainloader /efi/boot/grubx64_real.efi

In grub2 then echo $root gives root is hd0 which must be changed using

set root=hd0,gpt1
set prefix=($root)/grub
configfile $prefix/grub.cfg

And then I return to Grub2 Menu with all entries ...

 

How to automate this from UEFI Grub4dos environment ?



#34 Vortex

Vortex

    Frequent Member

  • Advanced user
  • 299 posts

Posted 03 November 2020 - 10:25 AM

Hi alacran,

 

I assume Safe Boot was disabled, as grub4dos for UEFI is not signed and MS approved.

 

 

Exactly. Secure boot is disabled.



#35 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 10:57 AM

@ Vortex

 

Thanks, it was just to keep all info together for future readers, as here on this topic we are witnesses of the beginning of a new age.
Once the Ramboot of VHDs become a fact this thread may be visited by many people.

 

By the way I said Safe Boot, but the term is really Secure Boot.

 

alacran



#36 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 12:48 PM

@ wimb

 

Doesn't this work?

 

title Grub2
find --set-root /core.img   >>> or the actual path to core.img
kernel /core.img   >>> or the actual path to core.img

 

alacran


  • wimb likes this

#37 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 03 November 2020 - 01:07 PM

In case the previous works, you can automate it further, running it from a keyboard Key:

 

setmenu --hotkey -B [F6] Grub2  >>> or your prefered key, and this will call the Grub2 title, just as on example on first post.

 

 

setmenu --hotkey -A [F4] commandline
 

 

alacran



#38 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 01:19 PM

Doesn't this work?

 

title Grub2
find --set-root /core.img   >>> or the actual path to core.img
kernel /core.img   >>> or the actual path to core.img

 

 

 

Thanks, it does not work (core.img is used in MBR booting)

 

Thanks to your remark I tried to find a1ive Grub2 FileManager and that works  :magic:

 

Now I can return from UEFI Grub4dos menu back to Grub2 FileManager where I can select Windows Boot Manager and everything else ...

 

Added in menu.lst

title grubfm x64 EFI Boot Manager of a1ive
find --set-root /efi/boot/grubfmx64.efi
chainloader /efi/boot/grubfmx64.efi


So the UEFI Grub4dos sequence is complete now .....

 

UEFI Secure Boot > Super UEFI > Grub2 Menu > UEFI Grub4dos is working OK

UEFI Secure Boot > Super UEFI > Grub2 Menu > Windows Boot Manager is working OK

UEFI Secure Boot > Super UEFI > Grub2 Menu > a1ive Grub2 File Manager is working OK

 

Return from UEFI Grub4dos to .....

UEFi Grub4dos > a1ive Grub2 File Manager > F3 allows to select Windows Boot Manager is working OK

 

I still think that booting Mini10x64.vhd from UEFI Grub4dos might be possible when map --top --mem is supported


  • alacran likes this

#39 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 02:09 PM

*
POPULAR

UEFI Secure booting UEFI Grub4dos located on internal SSD EFI drive Z:

 

menu.lst

color white/blue  black/light-gray white/black white/black
timeout 10
default 0

title Win10XPE - (hd3,1)/Win10XPE/Win10XPE_x64.ISO
map (hd3,1)/Win10XPE/Win10XPE_x64.ISO (0xff)
chainloader (0xff)

title Win10XPE - Find Win10XPE_x64.ISO
find --set-root /Win10XPE/Win10XPE_x64.ISO
map /Win10XPE/Win10XPE_x64.ISO (0xff)
chainloader (0xff)

title grubfm x64 EFI Boot Manager of a1ive - Return to Grub2 and Windows Boot Manager
find --set-root /efi/boot/grubfmx64.efi
chainloader /efi/boot/grubfmx64.efi

title Grub2 Commandline - chainloader /efi/boot/grubx64_real.efi
find --set-root /grub/grub.cfg
chainloader /efi/boot/grubx64_real.efi

title commandline
commandline

title reboot
reboot

title halt
halt

grub\grub.cfg

 

Spoiler

 

 

UEFI_G4D_2020-11-03_145039.jpg


  • alacran, Atari800XL and fi-zilal like this

#40 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 02:18 PM

UEFI_G4D_1_IMG_20201103_143817.jpg == UEFI_G4D_2_IMG_20201103_144102.jpg == UEFI_G4D_3_IMG_20201103_144151.jpg ==UEFI_G4D_4_IMG_20201103_144228.jpg == UEFI_G4D_5_IMG_20201103_144303.jpg



#41 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 03 November 2020 - 03:02 PM

There is no need to modify EFI\Microsoft\Boot\bootmgfw.efi

 

That is also unwanted since Windows Update can overrule the new bootmgfw.efi file .....

 

What I did is use BOOTICE to create UEFI entry for booting Grub2 with bootfile EFI\Boot\BOOTx64.EFI of Super Grub2

 

To modify content of EFI drive I used WinNTSetup to auto mount EFI drive as drive Z:

 

- Use R-mouse menu to run as administrator Explorer-x64.exe of Explorer++ - More Info 

 

UEFI_G4D_BOOTICE_2020-11-03_155700.jpg

 

:cheers:


  • fi-zilal likes this

#42 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 November 2020 - 02:42 AM

@ a1ive

 

Hi, any good news about VHD Ramboot?

 

Perhaps we may help making some test.

 

alacran



#43 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 12 November 2020 - 12:54 PM

*
POPULAR

https://drive.google...iew?usp=sharing

Now you can test with SVBus.


  • wimb, alacran and Atari800XL like this

#44 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 12 November 2020 - 03:11 PM

https://drive.google...iew?usp=sharing

Now you can test with SVBus.

 

Thank you for new version of Grub4dos for UEFI

 

What is your menu.lst entry for loading VHD into RAMDISK and then booting from RAMDISK using SVBus driver ?



#45 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 13 November 2020 - 09:56 AM

Thank you for new version of Grub4dos for UEFI

 

What is your menu.lst entry for loading VHD into RAMDISK and then booting from RAMDISK using SVBus driver ?

Same as the previous build.



#46 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 13 November 2020 - 10:19 AM

Same as the previous build.

 

There was no working menu.lst entry yet for loading Mini10x64.vhd loading into RAMDISK and then booting with UEFI Grub4dos and using SVBus driver  :unsure:

 

I can boot with UEFI Grub4dos, but I fail to boot such VHD with UEFI Grub4dos and may be you have a working menu.lst entry for this case  :unsure:



#47 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 13 November 2020 - 10:51 AM

I haven't started any experiments with UEFI grub4dos yet, but...

 

1. 'UEFI grub4dos' is a ridiculous name!  Even the old grub4dos name is outdated since it is usually used to boot Linux and Windows these days!  I suggest the new UEFI grub4dos is called   grub4efi.

 

2. The search path for menu.lst is currently the same as for MBR grub4dos. This causes difficulties when you create a FAT32 USB drive which contains both MBR and UEFI versions of grub4dos. Perhaps \efi\grub4efi\menu.lst would be better?

 

I don't think we should add any more confusion between 'grub', 'grub2', GRUB and 'grub4dos' than we have to and so should avoid using these strings within grub4efi!

 

P.S. incl. changing the command prompt to grubefi> instead of grub>


Edited by steve6375, 13 November 2020 - 10:54 AM.


#48 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 13 November 2020 - 11:34 AM

may be you have a working menu.lst entry for this case  :unsure:

I don't use VHD RamOS.

Maybe you could use the following commands:

map --mem /xxx.vhd (hd)
chainloader (hd-1)


#49 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 13 November 2020 - 11:54 AM

 

I don't use VHD RamOS.

Maybe you could use the following commands:

map --mem /xxx.vhd (hd)
chainloader (hd-1)

 

UEFI Grub4dos is most interesting for booting VHD from RAMDISK in UEFI mode and using SVBus driver.

UEFI Grub4dos is not needed for booting as FILEDISK since we have for that case the better solution using Windows Boot Manager and using Microsoft build-in vhdmp.sys driver.

 

I just tried your proposal and VHD is loading into memory, but booting fails with this Screenshot

In normal Grub4dos booting we need to use --top switch which is not available in UEFI Grub4dos and might be part of the boot problem .....

 

UEFI_Grub4dos_IMG_20201113_124201X.jpg



#50 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 13 November 2020 - 12:29 PM

UEFI Grub4dos is most interesting for booting VHD from RAMDISK in UEFI mode and using SVBus driver.
UEFI Grub4dos is not needed for booting as FILEDISK since we have for that case the better solution using Windows Boot Manager and using Microsoft build-in vhdmp.sys driver.
 
I just tried your proposal and VHD is loading into memory, but booting fails with this Screenshot
In normal Grub4dos booting we need to use --top switch which is not available in UEFI Grub4dos and might be part of the boot problem .....
 
attachicon.gifUEFI_Grub4dos_IMG_20201113_124201X.jpg

Does the VHD have a valid ESP partition and bootx64.efi?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users