Jump to content











Photo
- - - - -

can grub4dos chainload on a UEFI or EFI system?


  • Please log in to reply
19 replies to this topic

#1 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 02 August 2011 - 01:35 AM

Hi everyone,

I'm wondering if grub4dos can be used to chainload on systems setup with a UEFI/EFI boot? The documentation that comes with grub4dos has not a single match to "GPT", "UEFI" or "EFI" in the documentation.

I ask because I booted to DOS on an Acer 4830TG and tried to chainload with it not finding any partitions. Quite possibly it was using an UEFI boot setup.

If grub4dos can't chainload on a EFI/UEFI system is there any other DOS software that can?

Thanks!

#2 Wonneproppen

Wonneproppen

    Newbie

  • Members
  • 13 posts
  •  
    Germany

Posted 02 August 2011 - 10:34 AM

Following steps for EFI/UEFI booting

- extract bootmgfw.efi from archiv \sources\Install.wim (like using 7-zip or other)
- you find the file in archiv path \1\Windows\Boot\EFI\
- copying bootmgfw.efi on your USB Device into folder "EFI" (you must create this folder, or copying in the appropriate ISO folder)
- rename bootmgfw.exe into bootx64.efi when use a x64 System, for x86 System you needn`t
- then a UEFI-Windows-Setup from your USB-Device works great, check it out :cheers:

Edited by Wonneproppen, 02 August 2011 - 10:35 AM.

  • Arjun likes this

#3 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 02 August 2011 - 10:39 AM

Following steps for EFI/UEFI booting


I appreciate the response but I'm not looking to do a Win7 USB install. Instead, I wish to boot DOS then have the ability to chainload a UEFI/EFI system. Had hoped grub4dos could do that.

#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 August 2011 - 11:09 AM

I appreciate the response but I'm not looking to do a Win7 USB install. Instead, I wish to boot DOS then have the ability to chainload a UEFI/EFI system. Had hoped grub4dos could do that.

Yes/no. :unsure: :dubbio:
You could probably create in grub4dos a "hybryd" mbr/partition table "on the fly".
Some useful info may be found here (only seemingly unrelated):
http://reboot.pro/11600/
http://www.rodsbooks.com/gdisk/
http://www.rodsbooks...isk/hybrid.html

The thingy is AFAIK called commonly GPT (rather than EFI), see also here:
http://reboot.pro/12915/
and here:
http://www.wensley.org.uk/gpt

GRUB 2 should be compatible, and it should be chainloadable from grub4dos, though to me it is not yet very clear how to do it:
http://reboot.pro/9882/page__st__6
(but things may have changed lately :unsure:)

Maybe you can use a GRUB2 floppy image mounted in grub4dos? :dubbio:

:cheers:
Wonko

#5 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 02 August 2011 - 03:57 PM

thanks Wonko. I did manage to get grub2 booted from grub4dos but have two issues:

(1) the grub2 compressed installation adds another 600K to my 3.7MB package. A sizable increase for UEFI functionality.

(2) I do various PCI fixups that might result in the boot USB drive being clobbered. grub2 looks for /boot/grub/grub.cfg off the boot file. There appears no way to create a ramdrive that could have been setup by grub4dos to contain the necessary files for grub2's use so as to avoid needing to read the USB drive.

WISHLIST: I hope tinybit and chenall can add UEFI/EFI support to grub4dos. It would alleviate the issues above.

#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 August 2011 - 05:38 PM

thanks Wonko. I did manage to get grub2 booted from grub4dos but have two issues:

Well, could you detail HOW you did it :whistling: (it may be useful :)).

Not knowing WHAT is your "3.7 Mb package" is really hard to guess what could be done to "optimize" it. :dubbio:

There appears no way to create a ramdrive that could have been setup by grub4dos to contain the necessary files for grub2's use so as to avoid needing to read the USB drive.

Well no, this should be possible:
http://ubuntuforums....d.php?t=1305475

Also, you may want to explore burg:
http://code.google.com/p/burg/
https://help.ubuntu....community/Burg/
http://reboot.pro/12474/

which is a sort of "bridge" beteen grub4dos and GRUB2

:cheers:
Wonko

#7 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 02 August 2011 - 09:36 PM

Well, could you detail HOW you did it :dubbio: (it may be useful :whistling:).


My boot process is grub2 -> 11.4MB floppy image -> grub4dos (MBR/ntldr/bootmgr) so already had a value grub2 install on my system. It was just a matter of moving that over to my floppy image with:

losetup /dev/loop0 [path to disk image]

mount /dev/loop0 /media/diskimage



# Install the grub2 files on the floppy image. Appears to require the /dev/sda line on the end which rewrites my MBR with my grub2 install

grub-install --no-floppy --root-directory=/media/diskimage/ --grub-setup=/bin/true /dev/sda



# Copy my original grub.cfg to the disk image

cp /boot/grub/grub.cfg /media/diskimage/boot/grub

I editted the grub.cfg file on the disk image with different colors so I new it was using that one when chainloaded. Once I had booted up to my DOS image I can chainload to grub2 using the following, which was working great since it showed my different color scheme. The core.img file can even be on my ramdisk but once it's started the grub2 it appears to look for /boot/grub/grub.cfg on my previous boot media, which was my floppy image mapped as (fd0), and still knows about fd0.

grub --config-file="kernel /boot/grub/core.img"

Also, you may want to explore burg:..which is a sort of "bridge" beteen grub4dos and GRUB2


Had a look at it and was curious when I found a burg4dos package, but really it should be called burg4win since it's a package to allow installation from a Windows system BUT there is no real-mode DOS binary for it. If there was a read-mode DOS binary then it could potentially replace grub4dos.

Edited by nando4, 02 August 2011 - 09:42 PM.


#8 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 03 August 2011 - 06:04 AM

OK, now I am completely lost. :)

I do not understand the setup nor the scope. :cheers:

If you already boot from grub2 why you want grub4dos to load another instance of grub2?

What does this mean?

Appears to require the /dev/sda line on the end which rewrites my MBR with my grub2 install

WHICH MBR?
WHERE?

I thought you were up to making a sort of "portable emergency boot something" based on grub4dos and that you were unable to boot an EFI system. :dubbio:
WHAT has a "read-mode DOS binary" to do with it?

Maybe you could try and explain further both the actual "scope" and the actual "result" you already got? :whistling:

:cheers:
Wonko

#9 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 03 August 2011 - 06:22 AM

OK, now I am completely lost. :dubbio:

I do not understand the setup nor the scope. :whistling:

If you already boot from grub2 why you want grub4dos to load another instance of grub2?


My main focus is to perform some PCI fixups which requires booting to a DOS application. That is done via either a USB drive or a floppy image.

Then the issue is to chainload to the user's preferred OS: Linux/XP/Win7. This all works perfectly on a normal partitioning scheme. Where it fails is on a GPT (UEFI/EFI) installation which appears I need to then chainload grub2 to be able to boot into. It can probably be made to work (I don't have GPT on my test box to confirm), but adds 600k of compressed binaries and possible issues if I use a USB boot process due to clobbered USB controllers. This extra chainloading also adds a fair bit more complexity to the setup which I need to explore.

A best setup would cut out this extra chainloading step and just use a grub4dos with GPT support, or some grub2 binary or derivative (burg) for real-mode DOS that could boot GPT partitions.

Edited by nando4, 03 August 2011 - 06:44 AM.


#10 Arjun

Arjun

    Member

  • Members
  • 30 posts
  • Location:India
  •  
    India

Posted 15 September 2012 - 02:48 PM

I am planning to install Windows 8 RTM. After installation, I want Windows 8 to boot using UEFI

Following steps for EFI/UEFI booting

- extract bootmgfw.efi from archiv sourcesInstall.wim (like using 7-zip or other)
- you find the file in archiv path 1WindowsBootEFI
- copying bootmgfw.efi on your USB Device into folder "EFI" (you must create this folder, or copying in the appropriate ISO folder)
- rename bootmgfw.exe into bootx64.efi when use a x64 System, for x86 System you needn`t
- then a UEFI-Windows-Setup from your USB-Device works great, check it out :)

After I copy the 'bootmgfw.efi' and rename it to 'bootx64.efi, what is the next step?

Should I use grub4dos to boot the usb and add menu entry like

title Windows 8 EFI boot

chainloader /EFI/bootx64.efi

Or can I just install Windows 8 using the below code

title Windows 8 boot

chainloader /bootmgr

and Windows will complete installation and boot using UEFI from next time.?

Edited by Arjun, 15 September 2012 - 02:48 PM.


#11 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 05 November 2012 - 08:37 AM

Any chance of the developers adding the ability for grub4dos to map and use an image on a UEFI/GPT partition? This will become quite an important feature as OEMs implement secure boot with Win8 systems using UEFI. Otherwise will need to boot my FreeDOS image using a USB stick. Thanks.

#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 05 November 2012 - 10:12 AM

Any chance of the developers adding the ability for grub4dos to map and use an image on a UEFI/GPT partition? This will become quite an important feature as OEMs implement secure boot with Win8 systems using UEFI. Otherwise will need to boot my FreeDOS image using a USB stick. Thanks.

You are still completely failing to provide any meaningful detail about:
  • what you are trying to achieve (GOAL)
  • how exactly you have setup your *whatever*
  • what exact issue you are having in the *whatever* you are attempting to do.
You are in the "I'm ill, Doctor. Help!" stage:
http://homepage.ntlw...ard-litany.html

It is unprobable that any developer will spend any time in solving an issue that is not clearly stated/exposed.

Have you checked BURG and grub24dos? (AFAICR the "Win" part is just an installer)

:cheers:
Wonko

#13 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 05 November 2012 - 11:47 AM

Wonko, I would like grub.exe (grub4dos) to be able to map a DOS disk image that is sitting on a UEFI/GPT partition and boot from it. burg4dos or grub24dos may be able to achieve that but there I'd need to package a whole extra product to achieve this one step. Once I've booted my DOS image, do my various PCIe fixups, then I'd be using grub4dos to map a Tianocore floppy image to allow UEFI boot (chainloading) to the desired OS.

So really I just need a mechanism to pass a pointer for my DOS image that is being hosted on a GPT/UEFI partitiion back to grub4dos to be able to direct map it.

Edited by nando4, 05 November 2012 - 11:58 AM.


#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 05 November 2012 - 01:26 PM

Wonko, I would like grub.exe (grub4dos) to be able to map a DOS disk image that is sitting on a UEFI/GPT partition and boot from it. burg4dos or grub24dos may be able to achieve that but there I'd need to package a whole extra product to achieve this one step. Once I've booted my DOS image, do my various PCIe fixups, then I'd be using grub4dos to map a Tianocore floppy image to allow UEFI boot (chainloading) to the desired OS.

So really I just need a mechanism to pass a pointer for my DOS image that is being hosted on a GPT/UEFI partitiion back to grub4dos to be able to direct map it.

Well, I understand this, and I would also like grub4dos grldr.mbr to fit in 1 sector, and to make some coffee, but right now it isn't there/it isn't possible :whistling:.

Maybe it is possible to make on-the-fly a hybrid MBR:
http://www.rodsbooks...isk/hybrid.html
through a grub4dos batch !BAT file, I just wrote a small one and though "limited" (and my knowledge of it even more so :ph34r:) the language is not that bad :thumbsup:.

I thought you had an issue and needed a way to solve it, now I understand how yours was just a "feature request" for the grub4dos developers, my bad.

:cheers:
Wonko

#15 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,676 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 05 November 2012 - 04:28 PM

So really I just need a mechanism to pass a pointer for my DOS image that is being hosted on a GPT/UEFI partitiion back to grub4dos to be able to direct map it.

Off-topic, but: Can you have a dedicated FAT partition with Syslinux on it? I have a version of its chain.c32 that can boot DUET's EfiLdr. (No floppy image required; just contents.) Syslinux can reside on a GPT FAT partition.

Maybe you already have such a FAT partition at the beginning of your disk, since it should be pretty common that GPT disks on UEFI systems have one of those. Now I would guess that you don't have a UEFI system (else why would you use DUET?), but if you have a GPT disk, maybe you should consider making such a FAT partition.

#16 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 05 November 2012 - 04:55 PM

Sha0, you gave a pretty comprehensive reply about using Syslinux to accomplish my aims over a year ago at http://reboot.pro/15387/#entry137279 . Unfortunately it seems neither grub4dos nor syslinux has the full set of capabilities I require (direct map a disk image residing on a GPT partition for read and *write*).

Hence, it would be a desirable feature for the grub4dos developers to consider adding as Wonko points out.

#17 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,676 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 05 November 2012 - 05:41 PM

Sha0, you gave a pretty comprehensive reply about using Syslinux to accomplish my aims over a year ago at http://reboot.pro/15387/#entry137279 . Unfortunately it seems neither grub4dos nor syslinux has the full set of capabilities I require (direct map a disk image residing on a GPT partition for read and *write*).

Hence, it would be a desirable feature for the grub4dos developers to consider adding as Wonko points out.

I'd forgotten about that. Well, more off-topic, but: Syslinux is getting closer to having disk-mapping support, I'm pretty sure!

But if you have the contents of a DUET floppy extracted to a FAT partition, wouldn't that work?

I think it might be possible to load EfiLdr from GRUB4DOS, too, but I could be mistaken.

#18 nando4

nando4

    Frequent Member

  • Advanced user
  • 112 posts
  •  
    Australia

Posted 26 February 2013 - 05:43 PM

Sha0, you mentioned NTFSTEST.EXE will give the sector range of a file on an NTFS partition. The ability to read my disk image off a GPT partition could be accomplished by wee63 *if*  it could be configured to accept the starting sector of my disk image.

 

I wonder if the wee developers could consider adding that as a feature? So instead of using 'find' to internally set the starting sector, use the wee63 install utility to find it from the disk image file that is required to be mapped, and then create the wee63.mbr file (containing ALL config details it needs) that can be chainloaded from the Win7 bootloader.


Edited by nando4, 26 February 2013 - 05:44 PM.


#19 dense

dense

    Member

  • Members
  • 56 posts
  •  
    United States

Posted 26 February 2013 - 08:57 PM

My two cents:

One of the great things about gru4dos is that you can boot an iso with it. I notice, however, that the current fedora 18 will not boot this way. It seems they moved the core. img out of it's usual sort of place into another folder, and the grub4dos can't find it.

  Is grub4dos still being maintained? I noticed it has been moved to "gna.org" which flagts a nasty warning in firefox that this is not a trusted site. It occured to me that a bootloader is an exelent vector for malware.



#20 slothman

slothman

    Newbie

  • Members
  • 24 posts
  •  
    United States

Posted 21 March 2013 - 06:41 PM

My two cents:

One of the great things about gru4dos is that you can boot an iso with it. I notice, however, that the current fedora 18 will not boot this way. It seems they moved the core. img out of it's usual sort of place into another folder, and the grub4dos can't find it.

  Is grub4dos still being maintained? I noticed it has been moved to "gna.org" which flagts a nasty warning in firefox that this is not a trusted site. It occured to me that a bootloader is an exelent vector for malware.

 

Well that sounds like a problem with grub2 trying to find its core.img

 

If this is a regular bios system, I'd just go the grub4dos route manually.  Run bootlace on the disk and copy grldr and menu.lst to the root dir.  Love the simplicity of doing it that way.

 

Grub4dos is still being maintained by chenall, at least.  http://code.google.c...rub4dos-chenall

Just remember, 0.4.5c is the "stable" version and 0.4.6a is the "testing" version.

 

gna.org is a site for developers to host projects.  Shouldn't be any malware there.  If there is, be sure to report it to the site admin.


Edited by slothman, 21 March 2013 - 06:42 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users