Jump to content











Photo
- - - - -

GRUB4DOS for UEFI


  • Please log in to reply
421 replies to this topic

#401 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 25 February 2022 - 03:10 PM

@steve6375

 

I did a test with another 16GB FAT32 flash drive and it works now :)

 

efi\boot\bootx64.efi -> GRUB4DOS UEFI

efi\grub\menu.lst

timeout 5
default 0

title Debian 9 (vmlinuz, initrd.img)
kernel /images/deb9/vmlinuz boot=live live-media-path=/images/deb9/live/ config username=root
initrd /images/deb9/initrd.img

images\deb9\live\filesystem.squashfs

images\deb9\initrd.img and vmlinuz

 

I don't know why, but with a Kingston 1GB SD card in a USB 2.0 reader, GRUB4DOS UEFI does not work.

The same SD card in the USB reader works without any problems in UEFI Shell :confused1:



#402 steve6375

steve6375

    Platinum Member

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

Posted 25 February 2022 - 03:14 PM

Why not report issue on grub4dos github?

CASE A

CASE B

give full and accurate details of system, card reader and SD cards,, esp of how 1GB SD card was prepared and if you can repeat the fail after wiping it.



#403 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 25 February 2022 - 03:44 PM

@steve6375

 

Ok, I will try to report a problem on Github.



#404 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 25 February 2022 - 03:56 PM

1GB may well present a "wrong" geometry to the BIOS rectius UEFI, i.e. a non 255/63 one, like a 64/32 one, maybe it is connected with the issue..

 

:duff:

Wonko



#405 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 25 February 2022 - 05:49 PM

@Wonko the Sane

But the SD card works without a problem under the UEFI Shell:

uefi_shell_SD_card.png

g4d_uefi_no_SD_card.png



#406 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 26 February 2022 - 02:01 AM

Can grub2 recognize your sd card?

#407 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 26 February 2022 - 07:05 AM

@a1ive

Yes, grub2 recognize SD card in UEFI mode:

grub2_uefi.png



#408 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 26 February 2022 - 08:04 AM

OK, everything is working now. What I did:

  • in BootICE, I filled the SD card with zeros
    zero.png

    I formatted the card in FAT32 with the program USB Disk Storage Format
    format.png
  • I installed GRUB4DOS legacy with Grub4Dos Installer 1.1 GUI + grldr (0.4.6a-2022-01-18)
    g4d_legacy_install.png
  • I also copied G4D UEFI to efi/boot as bootx64.efi + efi/grub/menu.lst

Now G4D legacy and G4D UEFI work without a problem from SD card 1GB in USB 2.0 reader :D :lol:



#409 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 February 2022 - 08:38 AM

@Wonko the Sane

But the SD card works without a problem under the UEFI Shell:

attachicon.gif uefi_shell_SD_card.png

attachicon.gif g4d_uefi_no_SD_card.png

Sure :), but that doesn't mean that grub4EFI for *whatever reasons* checks *something* and doesn't like the *whatever* it finds.

 

I have no idea what the UEFI reads, nor what the grub4EFI reads, I was only pointing out what has been in the past a common enough issue with "small" size media, a mismatch in geometry of the device.

 

 

OK, everything is working now.

 

Which plainly means that there was *something wrong* in the previous partitioning (or lack of it) and/or formatting, Q.E.D.

 

:duff:

Wonko



#410 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 02 March 2022 - 07:48 PM

I am trying to run Debian 7 amd64 the same way as in post #401, but I have an error:

g4d_uefi_debian7.png

 

I can run the same system without problems under UEFI using Tiny PXE Server + deb7.ipxe script + iPXE.efi:

tiny.png

#!ipxe

set url http://${dhcp-server}

initrd ${url}/images/deb7/initrd.img
kernel ${url}/images/deb7/vmlinuz initrd=initrd.img boot=live config netboot=nfs ip=dhcp nfsroot=/deb7 vga=ask username=root
boot


#411 steve6375

steve6375

    Platinum Member

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

Posted 02 March 2022 - 08:00 PM

You don't post the menu that you have a problem with!
I have a car which doesn't work, here is a picture of a car that does work - what is wrong with the car that doesn't work?

#412 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 02 March 2022 - 08:11 PM

I'm trying to boot with G4D UEFI Debian 7 instead of Debian 9 the same way as in post #401 - I only replaced 3 files: filesystem.squashfs, initrd.img, vmlinuz



#413 steve6375

steve6375

    Platinum Member

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

Posted 02 March 2022 - 08:19 PM

The problem may be with the grub4efi kernel command. Try help kernel at command prompt. If there are no parameters you can add or no similar kernel command then report the issue on GitHub.

#414 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 03 March 2022 - 06:19 AM

I am trying to boot with the --type=linux option but it doesn't help

 

P.S. I reported on Github



#415 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 05 March 2022 - 02:17 AM

 

I am trying to run Debian 7 amd64 the same way as in post #401, but I have an error:

attachicon.gif g4d_uefi_debian7.png

 

I can run the same system without problems under UEFI using Tiny PXE Server + deb7.ipxe script + iPXE.efi:

attachicon.gif tiny.png

#!ipxe

set url http://${dhcp-server}

initrd ${url}/images/deb7/initrd.img
kernel ${url}/images/deb7/vmlinuz initrd=initrd.img boot=live config netboot=nfs ip=dhcp nfsroot=/deb7 vga=ask username=root
boot

 

grub4dos(uefi) uses the EFI handover protocol to boot linux.

If the kernel is not compiled with this option enabled, it will not boot.

If the kernel has EFI stub enabled, then it can be booted as an EFI executable:

chainloader /path/to/vmlinuz initrd=\path\to\initrd.img your_kernel_cmdline

(vmlinuz and initrd.img should be located in the same ESP partition)



#416 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 March 2022 - 06:38 AM

Kernel has EFI stub enabled:

root@debian:~# cd /boot
root@debian:/boot# dir
config-3.2.0-4-amd64      memtest86+.bin            System.map-3.2.0-4-amd64
initrd.img-3.2.0-4-amd64  memtest86+_multiboot.bin  vmlinuz-3.2.0-4-amd64
root@debian:/boot# grep CONFIG_EFI_STUB config-3.2.0-4-amd64
CONFIG_EFI_STUB=y

menu.lst

timeout 5
default 0

title Debian 7
chainloader /images/deb7/vmlinuz initrd=\images\deb7\initrd.img boot=live live-media-path=/images/deb7/live/ config username=root

It works on a real computer under UEFI64 but there is a error on VMware and Qemu for Windows (-hda \\.\PhysicalDrive1) (Hard disk is USB stick from Host):
error.png

 

In qemu-w64-setup-20160903.exe, I do this:

"C:\Program Files\qemu\qemu-system-x86_64.exe" -bios OVMF-with-csm.fd -m 1024 -hda \\.\PhysicalDrive1

or

"C:\Program Files\qemu\qemu-system-x86_64.exe" -bios OVMF-pure-efi.fd -m 1024 -hda \\.\PhysicalDrive1


#417 a1ive

a1ive

    Member

  • Developer
  • 58 posts
  •  
    China

Posted 05 March 2022 - 01:07 PM

 

It works on a real computer under UEFI64 but there is a error on VMware and Qemu for Windows (-hda \\.\PhysicalDrive1) (Hard disk is USB stick from Host):

attachicon.gif error.png

 

In qemu-w64-setup-20160903.exe, I do this:

"C:\Program Files\qemu\qemu-system-x86_64.exe" -bios OVMF-with-csm.fd -m 1024 -hda \\.\PhysicalDrive1

or

"C:\Program Files\qemu\qemu-system-x86_64.exe" -bios OVMF-pure-efi.fd -m 1024 -hda \\.\PhysicalDrive1

Do VMware and QEMU use 64-bit UEFI firmware?



#418 reboot12

reboot12

    Frequent Member

  • Advanced user
  • 287 posts
  • Interests:WinXP, Debian, OpenWrt, gPXE, iPXE, BIOS, UEFI, Coreboot, MS VirtualPC, VMware
  •  
    Poland

Posted 05 March 2022 - 01:41 PM

Do VMware and QEMU use 64-bit UEFI firmware?

Yes, Debian 9 boot correctly:

deb9_VMware_UEFI.png deb9_Qemu_UEFI.png



#419 Ahmed ELSaman

Ahmed ELSaman
  • Members
  • 1 posts
  •  
    Egypt

Posted 20 October 2022 - 12:52 PM

This thread helped me to successfully load "GRUB 4 UEFI" menu and load installed Windows 10 also:

 

1. rename "EFI/Boot/bootx64.efi" to "EFI/Boot/bootx64_original.efi"

2. Copy from GRUB 4 UEFI "BOOTX64.EFI" to "EFI/Boot/BOOTX64.EFI"

3. Create "EFI/grub" directory.

4. copy "menu.lst" to "EFI/grub/menu.lst".

5. rename "EFI/Microsoft/Boot/bootmgfw.efi" to "EFI/Microsoft/Boot/bootmgfw_original.efi"

 

But I'm facing two issues:

1. I'm not able to load "DOS Floppy Disk Image" into memory using --mem like I used on GRUB4DOS legacy.

2. Setting background and font color doesn't display correctly, I see a mixed color with no clear text.

 

Load "Floppy Disk Image" into memory is the most important topic for me now, Anyone can help please ?



#420 steve6375

steve6375

    Platinum Member

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

Posted 20 October 2022 - 02:14 PM

What happens when you try to load a floppy disk image?

#421 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 October 2022 - 09:09 AM

I believe that DOS (any dos, not only on floppy) simply cannot boot without BIOS, so if you boot in EFI/UEFI and thus you don't have BIOS services, DOS won't boot.

 

If you are booting in BIOS/CSM compatibility mode you can use normal grub4dos.

 

:duff:

Wonko 



#422 steve6375

steve6375

    Platinum Member

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

Posted 21 October 2022 - 11:20 AM

Setting background and font color doesn't display correctly, I see a mixed color with no clear text.

 

 

Give example code so we can reproduce the problem.



#423 VendettaReborn

VendettaReborn
  • Members
  • 9 posts
  •  
    United States

Posted 12 February 2023 - 10:23 PM

I've recently stopped using rEFInd, and start using GRUB4DOS UEFI version to boot my UEFI-capable OSes. So far I have entries for Windows 11 encrypted with BestCrypt Volume, Manjaro Linux, Fedora Linux, reboot, and shutdown/power off.

 

Now, if it's possible, I would like to add an entry for rebooting directly into the UEFI BIOS. What would I need to add in menu.lst?

 

Also, G4E doesn't use my highest native screen resolution, instead it confines it to a square that occupies about 25% of the screen size. The rest is just black on a backlit monitor (laptop). My monitor's max supported res is 3200x1800, that value worked in rEFInd when specified manually in its' config file. I think what I want is called something akin to aspect ratio scaling. Or stretching to fit the entire screen.






4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users