So i'm trying to develop an os that biot using uefi instead if the normal bootloader. So for now following different source in the internet i'm now able to load a ntfs partion where i load a second uefi imaga that do the load of the operating system.
I'm using windows so i'm using visusl studio for compilation and here is where all the problems begin.
In The second stage loader i'm able to load an pe image that contain the kernel of the os that for now is a just a function like:
Code: Select all
VOID __stdcall EntryPoint (EFI_LOADER_INFO *LoaderInfo)
{
for (; ;)
;
}
Enviroment.
Any way i really cannot understand iwhat i need to for launche the kernel file in the second stage efi bootloader.
As i understand i need to use BS->AllocatePages for getting the efi memory ready for loading my pe image than before run the image i have call BS->ExitBootServices to stop allthe efi services. Of course i gave get the memory map by calling BS->GetMemoryMap.
So can someone help me on how to load an pe image an launch it? I'm able to get tge address of entry point by reading the image but than i don't know what to do.
I compiling in 64bit mode.
Also what are the first think that kernel have to do?
Do the interrupt table is arleady set up on the efi side?
I'm arleady in long mode right?
Thanks for the help, albus95.