EFI GRUB x86-64 entry point

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
MrWiggels
Posts: 3
Joined: Sun May 20, 2012 4:35 pm

EFI GRUB x86-64 entry point

Post by MrWiggels »

I was just wondering how the entry works for an efi-grub 64-bit loaded kernel would look like. I searched all over google, but everytime I get results for how to get EFI to work with this and that linux, nothing solid on how to creat a kernel entry point.

Also, when grub gives you control, is the processor in 64-bit mode?
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: EFI GRUB x86-64 entry point

Post by Casm »

I can't say I know much about Grub, but it is not immediately obvious that the manner in which Grub was loaded, and then interacted with the firmware - whether through EFI or BIOS - should necessarily have any effect upon its handover to the kernel.

If the version of Grub you are using is 64 bit, the processor would already have been running in 64 bit mode, with paging enabled and memory identity mapped, when Grub was loaded by EFI. Shortly before handing over control to your kernel, Grub would have called ExitBootServices() at which point EFI would have given up control of memory. So you should probably have a look at the memory map, and try to figure out where the page tables once were, so that you don't overwrite them before your own temporary or permanent paging mechanism is in place.
MrWiggels
Posts: 3
Joined: Sun May 20, 2012 4:35 pm

Re: EFI GRUB x86-64 entry point

Post by MrWiggels »

Ok thanx for clearing that up!!! :D also, the other thing is, if I compile my executable into a x86-64 .elf file and place that as a start point for grub, will it call the correct entry point declared inside the elf header?
Post Reply