uefi drops into shell

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
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

uefi drops into shell

Post 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
sebihepp
Member
Member
Posts: 256
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: uefi drops into shell

Post by sebihepp »

Does it drop into the uefi shell when using the cd image, the hd image or both?
User avatar
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

Re: uefi drops into shell

Post 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.
sebihepp
Member
Member
Posts: 256
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: uefi drops into shell

Post 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?
User avatar
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

Re: uefi drops into shell

Post 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
Octocontrabass
Member
Member
Posts: 6247
Joined: Mon Mar 25, 2013 7:01 pm

Re: uefi drops into shell

Post 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.
User avatar
CodePoet2005
Posts: 17
Joined: Sat Dec 28, 2024 1:02 pm
Libera.chat IRC: CodePoet2005
Location: Always @ Home
GitHub: https://codeberg.org/CodePoet2005

Re: uefi drops into shell

Post 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
Post Reply