EFI Loading and jumping to x64 kernel (edk2)
Posted: Thu Apr 27, 2017 12:08 am
Hi this is my first post here!
Right now i'm working on a bootloader in uefi and it's going quite fine. I'm able to draw a nice background gradient, load a logo and draw that as well. Right now i'm busy trying to load a kernel image (in ELF format) and handing control over to this kernel.
I have a few questions about this process:
- Paging is turned on in uefi, but do i need to alter the page tables before i load the kernel, or can the kernel take care of this?
- When loading the kernel, can i just load the full image or do i need to allocate diffrent areas for example for stack etc?
- When the kernel is loaded in memory and ExitBootServices() is called, how the heck do i jump to the kernel? Can this happen via an efi function (not likely), a pointer, inline assembly, or an assembly file linked to my EFI file?
- After i've succesfuly handed control to the kernel, just for confirmation, i need to setup the paging table again and call x64 functions via inline assembly?
Thanks in advance for your help!
Right now i'm working on a bootloader in uefi and it's going quite fine. I'm able to draw a nice background gradient, load a logo and draw that as well. Right now i'm busy trying to load a kernel image (in ELF format) and handing control over to this kernel.
I have a few questions about this process:
- Paging is turned on in uefi, but do i need to alter the page tables before i load the kernel, or can the kernel take care of this?
- When loading the kernel, can i just load the full image or do i need to allocate diffrent areas for example for stack etc?
- When the kernel is loaded in memory and ExitBootServices() is called, how the heck do i jump to the kernel? Can this happen via an efi function (not likely), a pointer, inline assembly, or an assembly file linked to my EFI file?
- After i've succesfuly handed control to the kernel, just for confirmation, i need to setup the paging table again and call x64 functions via inline assembly?
Thanks in advance for your help!