Fulgurance wrote:
I have just a question, after I exit the boot services, how I can copy memory to the RAM or use AllocatePool service, because I can't will access to the CopyMem function ... Is there other way with UEFI protocols ?
No there isn't, and you can't use AllocatePool either after ExitBootServices. You should implement your own memory allocator, using pages marked as free from GetMemoryMap.
Fulgurance wrote:
And when i ExitBootServices and i don't alter memory, how can I call UEFI services ?
In theory you can still access all services which are marked RunTime service if you pass the SystemTable pointer to your kernel. But,
a) there aren't many useful runtime services (I dunno, reset perhaps?)
b) all the useful services are boot time services (memory management, file system access, GOP, etc. etc. etc.)
c) you'll notice serious incompatibility issues with different manufacturers
So all in all it's better just to forget about UEFI services after you call ExitBootServices.
Fulgurance wrote:
Is it possible with flat binary code for example ? Or again with PE format?
Absolutely yes. My boot loader can load both PE32+ and ELF64 binaries. Passing the SystemTable to your kernel depends on the ABI you choose for the handover, it has nothing to do with the file format.
Fulgurance wrote:
Do you know some example with some "Hello world kernel" ?
Sure.
x86_64-efi/bootboot.c is where I call ExitBootServices
mykernel is an example, very minimal "Hello world kernel" in C (Rust example also available)
Cheers,
bzt