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?
EFI GRUB x86-64 entry point
Re: EFI GRUB x86-64 entry point
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.
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.
Re: EFI GRUB x86-64 entry point
Ok thanx for clearing that up!!! 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?