Page 1 of 1

uefi drops into shell

Posted: Sun Feb 15, 2026 8:44 am
by CodePoet2005
Hi fellow devs,

I am currently working on a bootloader for x86_64 bios and uefi.
When i try to boot using qemu, it drops into uefi shell, instead of running the loader.

The iso-image doesnt seem to work at all.
The weird part is: i can successfully manually start the efi app in the hd image.

Why doesnt qemu boot it automatically?
I must be doing something wrong...

Any help or ideas would be highly appericiated.

the repo can be found here.

Cheers,
Codepoet2005

Re: uefi drops into shell

Posted: Mon Feb 16, 2026 3:05 am
by sebihepp
Does it drop into the uefi shell when using the cd image, the hd image or both?

Re: uefi drops into shell

Posted: Mon Feb 16, 2026 6:51 am
by CodePoet2005
sebihepp wrote: ↑Mon Feb 16, 2026 3:05 am Does it drop into the uefi shell when using the cd image, the hd image or both?
Both drop in the uefi shell,
the difference is that i can access the fat filesystem normally on my hd image, i can also manually start /EFI/BOOT/BOOTX64.EFI. I want it to boot automatically instead. From what i understand it should (is this correct?)

The cd image doesnt seem to be working at all (i cannot access the fat fs),

I dont think it has anything to do with the fat images im making, since the hd works ok.

Re: uefi drops into shell

Posted: Mon Feb 16, 2026 11:13 am
by sebihepp
You use "imgr" to create the image. It isn't available on my ubuntu, not even on apt-get, and google only finds image editors, but no manpage. What is that program?

I am not familiar with clang, but are you sure your program is PE and not ELF?

Re: uefi drops into shell

Posted: Mon Feb 16, 2026 12:42 pm
by CodePoet2005
Hi,
sebihepp wrote: ↑Mon Feb 16, 2026 11:13 am You use "imgr" to create the image. It isn't available on my ubuntu, not even on apt-get, and google only finds image editors, but no manpage. What is that program?

I am not familiar with clang, but are you sure your program is PE and not ELF?

Thanks for the suggestion but the output file is a valid PE executable.

Imgr is my own program and can be found here.
In a nutshell: it creates partitions, filesystems and copies files/folders into filesystems.

btw, the fat image made using imgr is verified using some other tools, so it should be good.

Cheers,
Codepoet2005

Re: uefi drops into shell

Posted: Mon Feb 16, 2026 6:57 pm
by Octocontrabass
CodePoet2005 wrote: ↑Sun Feb 15, 2026 8:44 amThe weird part is: i can successfully manually start the efi app in the hd image.
Is OVMF configured to try to boot from your drive? It may not be, if you're reusing a copy of OVMF_VARS from a different QEMU configuration. Try a fresh copy of OVMF_VARS, or check the boot order by pressing ESC during the OVMF splash screen.

Re: uefi drops into shell

Posted: Tue Feb 17, 2026 6:37 am
by CodePoet2005
Octocontrabass wrote: ↑Mon Feb 16, 2026 6:57 pm
CodePoet2005 wrote: ↑Sun Feb 15, 2026 8:44 amThe weird part is: i can successfully manually start the efi app in the hd image.
Is OVMF configured to try to boot from your drive? It may not be, if you're reusing a copy of OVMF_VARS from a different QEMU configuration. Try a fresh copy of OVMF_VARS, or check the boot order by pressing ESC during the OVMF splash screen.
Changing both the firmware image itself and the vars did the trick :D .
I should have checked the firmware beforehand, but i assumed i would "just work", like qemu with bios #-o .

Thanks for the help.


Cheers,
Codepoet2005