Jump to content











Photo
- - - - -

UEFI Boot from grub4dos

clover uefi grub4dos

  • Please log in to reply
9 replies to this topic

#1 steve6375

steve6375

    Platinum Member

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

Posted 16 May 2014 - 05:15 PM

I have found a way to boot from grub4dos to Clover (and then UEFI boot).

 

No utilities are required (other than a recent version 2013/2014 of grub4dos).

 

Here is a menu.lst - it assumes you have a FAT32 grub4dos USB drive which has grub4dos MBR bootcode installed.

iftitle [cat --locate="FAT32" --length=10 --skip=0x50 ()+1 > nul] Run Clover UEFI Boot Menu\n Run this if you wish to use Clover to UEFI boot
set CL=0
## boot7 is default boot file
cat --locate="BOOT7" --length=10 --skip=0x58 ()+1 > nul && set /a CL=%CL%+1 > nul
if "%CL%"=="1" echo Information: Clover is already installed to the PBR
## configfile /menu.lst
echo ffffffffff > (md)0x350+1
dd if=(hd0,0)+1 of=(md)0x350+1 > nul
dd if=()/clover/boot1f32alt7 of=(md)0x350+1 skip=87 seek=87 bs=1 > nul
dd if=()/clover/boot1f32alt7 of=(md)0x350+1 count=3 bs=1 > nul
#cat --hex (md)0x350+1 && pause
if not "%CL%"=="1" cat --locate="SYSLINUX" --length=10 --skip=0x2 ()+1 > nul && pause PROBLEM: SYSLINUX PBR DETECTED - Cannot install Clover to PBR... && configfile /menu.lst
if not "%CL%"=="1" dd if=(md)0x350+1 of=(hd0,0)+1 > nul && pause --wait=2 PBR updated with Clover boot code
chainloader /clover/boot0md || chainloader /clover/boot0ss || chainloader /clover/boot0af
# User can press 2 for 3 for 32-bit UEFI, 6 for 64-bit UEFI or 1 for Chameleon - within 2 seconds
# boot0md gives a boot0 message and is slower - boot0ss is silent with no message

Full details in my blog post here.

The code still needs tidying up, but I thought I would post to get comments. Using this you can UEFI boot directly from grub4dos.

I created the boot1f32alt7 file myself - it is not a standard Clover file (the standard boot1f32alt file loads the file \boot which we cannot have if the Windows \BOOT folder is in the same partition).

The dd code could probably be simplified to directly patch the PBR, but I wanted to be able to check it first before I allowed it to patch the PBR!

Attached Files


  • alacran likes this

#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 May 2014 - 05:28 PM

I think qemu can do EFI/UEFI and x64 fine. :unsure:

 

JFYI:

http://straightedgel.../howto/efi.html

http://sourceforge.n....php?title=OVMF

 

:duff:

Wonko



#3 steve6375

steve6375

    Platinum Member

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

Posted 16 May 2014 - 05:36 PM

There is a 64-bit version of QEMU, but the one in RMPrepUSB is 32-bit.

The 64-bit version of QEMU will not boot Windows x64. I tried a recent version and it still crashes...



#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 May 2014 - 06:31 PM

A 32bit Qemu, running under a 32 bit OS can emulate a x64 system, whether such a VM will be able to boot a Windows x64 through a UEFI bios, is another thing.
It has worked for years with "normal" BIOS:
http://reboot.pro/to...tualization-vt/

Maybe the issue is the CPU emulation that you chose (or failed to choose or that is available in the specific Qemu build that you are using) see also this (only seemingly unrelated):
http://reboot.pro/to...inpe-ram-usage/
http://reboot.pro/to...usage/?p=184116
and a few posts below by erwan.l

AND, please review the previously given links about OVMF.

:duff:
Wonko

#5 steve6375

steve6375

    Platinum Member

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

Posted 22 May 2014 - 08:06 AM

By copying the PBR to a file, we can remove the restriction of not installing Clover if the PBR already contains syslinux boot code

 

e.g.

create a file of length 1024 bytes (or more) - any contents will do. Name = \PBR.BIN.

place this code at the top of your menu.lst file to make a copy of the PBR

# backup PBR if not Clover PBR
cat --locate="BOOT7" --length=10 --skip=0x58 ()+1 > nul || dd if=()+2 of=()/PBR.BIN > nul

To boot to syslinux, use

chainloader /PBR.BIN


#6 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 24 June 2014 - 03:34 PM

Steve, this is something I've wanted for a long time. Thank you for posting. I too confirm that booting a FAT32-install of Clover created via  BootDiskUtility.exe  does then allow booting a UEFI Win8.1 installation.

 

Now my grub4dos installation is slightly different to yours. I have a FreeDOS boot image that gets copied to a USB stick using RMPrepUSB. I then boot into a USB FreeDOS environment from which I'd like to chainload out to a UEFI Win8.x partition via Clover.

 

Problem is that applying your code above sees the PBR being overwritten by the following code, preventing any subsequent boot into my FreeDOS USB stick.

if not "%CL%"=="1" dd if=(md)0x350+1 of=(hd0,0)+1 > nul && pause --wait=2 PBR updated with Clover boot code

Can you suggest any workaround? Seems that you are using syslinux.



#7 steve6375

steve6375

    Platinum Member

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

Posted 24 June 2014 - 06:21 PM

What I do is copy the PBR to a file (e.g. PBR.BIN) first and then chainload /PBR.BIN when I want to boot from the code that was originally in the PBR.

 

e.g. at top of menu.lst

# backup PBR if not already Clover PBR
cat --locate="BOOT7" --length=10 --skip=0x58 ()+1 > nul || dd if=()+2 of=()/PBR.BIN > nul

Now you have the original PBR saved and can boot from it whenever you like

title Boot freedos
chainloader /PBR.BIN

If using NTFS (which I guess you aren't as your using FreeDos), make sure the PBR.BIN file is approx 1K or larger



#8 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 25 June 2014 - 01:26 AM

Steve, I changed my MBR to use wee instead, 'find --set-root /kernel.sys; /kernel.sys', allowing me to change the PBR. Got around that problem OK.

 

Only one remaining unsolved problem. What are the exact steps that you are using to add Clover to your USB stick? 

 

BootDIskUtility creates a Clover USB stick that boots fine. I copied those files directly over to my FreeDOS USB stick. I then added a /clover directory with the boot* files extracted from the Clover.ISO as your menu.lst requires. 

 

Problem is while it all looks OK and there's no complaints from grub4dos with your menu.lst, selecting the "Boot UEFI" option freezes the system.



#9 steve6375

steve6375

    Platinum Member

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

Posted 25 June 2014 - 07:35 AM

Did you press 7 just as Clover is booting?

 

If you read my posts you will see I used a special boot file boot1f32alt7 - did you use that?

 

I can't comment on why it doesn't work without seeing your menu.lst and what files you have on the stick.

 

Why not download the MPI Tool Pack from my Easy2Boot site and you will have the exact files and menu.lst that I use.

 

Also read my blog as given in post #1



#10 staruser

staruser
  • Members
  • 1 posts
  •  
    China

Posted 17 May 2015 - 12:16 PM

hi:

sorry for my bad english.

When the USB disk is divided into two partitions, can not boot from usb.

it will Direct boot HDD clover

please  help me!

thank you!

 







Also tagged with one or more of these keywords: clover, uefi, grub4dos

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users