OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 11:37 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GNU-EFI bootx64.efi ELF boot example problems
PostPosted: Thu Feb 01, 2024 9:57 am 
Offline

Joined: Thu Feb 01, 2024 9:41 am
Posts: 1
Hi,

recently I found a piece of code by bassaer@github (https://github.com/bassaer/uefi-bootloader) and rewrote it so that it compiles with gnu-efi(https://github.com/mmarequee/gnu-efi-elf).
I just wanted to ask if this is the correct approach (an EFI application which opens an ELF file, reads the virtual address to which the system jumps in order to transfer control)
or if there's a better way to boot a kernel.
This approach is quite easy to test on real hardware.
Also, writing to framebuffer returned by gop seems to be very slow with the gnu-efi version on real hardware(it seems to be faster with bassaers mingw compiled example),
even if writing is done inside the EFI application(before ExitBootServices).
I'm unable to render the entire font included in zxfont.h, getting garbage on real hardware and nothing gets displayed when using qemu-system-x86_64.


Top
 Profile  
 
 Post subject: Re: GNU-EFI bootx64.efi ELF boot example problems
PostPosted: Mon Feb 12, 2024 6:54 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
mmarequee wrote:
I just wanted to ask if this is the correct approach (an EFI application which opens an ELF file, reads the virtual address to which the system jumps in order to transfer control)
or if there's a better way to boot a kernel.

The better way is to use paging to map the kernel to its desired virtual address so it doesn't depend on available memory at any specific physical address.

mmarequee wrote:
Also, writing to framebuffer returned by gop seems to be very slow with the gnu-efi version on real hardware(it seems to be faster with bassaers mingw compiled example),
even if writing is done inside the EFI application(before ExitBootServices).

Writing to the framebuffer is slow, so any small differences between the binaries can turn into big differences in speed. Enabling compiler optimizations can sometimes help, but you may need to rewrite your code to reduce the number of times it accesses the framebuffer. (Later, you might try programming the MTRRs or PAT to use WC memory for the framebuffer, but that's not something that belongs in a bootloader.)

mmarequee wrote:
I'm unable to render the entire font included in zxfont.h, getting garbage on real hardware and nothing gets displayed when using qemu-system-x86_64.

It sounds like a problem with how your code is linked, but I'm not familiar enough with GNU-EFI to spot any problems there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group