UEFI "hello world" won't boot on physical hardware

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
zaval
Member
Member
Posts: 658
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: UEFI "hello world" won't boot on physical hardware

Post by zaval »

unfortunately, it looks like incompliant, buggy FW you faced. the only thing to suggest, is to try the same on another test machine. is there an option "boot from file" in the boot manager's UI of the FW, when you interrupt the boot flow? if it is, try to run your executable this way, if it shows you path to it, of course, (it might, even not considering the drive bootable, actually, UEFI doesn't have such a notion). if it runs successfully, then the FW is picky on what part of the spec to support, if it fails, maybe you have some errors inside and FW deletes bad boot option.
does this machine have other storage devices? HDD? if you put it there, say \efi\glidix\myloader.efi?
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
User avatar
~
Member
Member
Posts: 1227
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: UEFI "hello world" won't boot on physical hardware

Post by ~ »

Probably your machine only has normal BIOS, or is in BIOS mode instead of UEFI mode.

I would prefer to have a regular BIOS computer and implement myself only the functions that make up what I need for UEFI to boot my code, to check that I'm understanding every detail of how it works.

Plus, it would make new software bootable in very old computers having a custom UEFI patch as a bootloader on top of the BIOS.

UEFI is like LILO or GRUB, or even like DPMI for 32/64 bits, so why not make my own in any case as part of my OS even if it's already present to port to more machines? They could probably be modified to implement a custom UEFI fast.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
Octocontrabass
Member
Member
Posts: 5580
Joined: Mon Mar 25, 2013 7:01 pm

Re: UEFI "hello world" won't boot on physical hardware

Post by Octocontrabass »

64MB is awfully small. The firmware might expect a bigger partition than that. Microsoft recommends at least 100MB.

Have you tried letting some other OS create the EFI system partition and simply copying your binary to it?
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: UEFI "hello world" won't boot on physical hardware

Post by Ethin »

Not hard:

Code: Select all

parted -s /dev/<device> mklabel gpt mkpart boot fat32 0% 100MB set 1 esp on
Or something like that. Then format it as fat32 and put your files in the proper places.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: UEFI "hello world" won't boot on physical hardware

Post by Ethin »

mariuszp wrote:
Ethin wrote:Not hard:

Code: Select all

parted -s /dev/<device> mklabel gpt mkpart boot fat32 0% 100MB set 1 esp on
Or something like that. Then format it as fat32 and put your files in the proper places.
Do you know if it's somehow possible to also create another partition, with a custom type GUID? (to mark it as the Glidix FS).
I don't think parted supports that.
Post Reply