A potentially viable method to boot a 64-bit kernel on GRUB

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
charadrinktea
Posts: 1
Joined: Sat Apr 06, 2024 1:28 am

A potentially viable method to boot a 64-bit kernel on GRUB

Post by charadrinktea »

Hello,
as it's known, GRUB can only boot an ELF32 format Multiboot kernel, and I've thought of a method: create an ELF32 format Multiboot-compatible boot stub and then embed the entire actual ELF64 kernel into one of its sections. The boot stub will extract the kernel, load it, and execute it.
This two-stage booting process already exists. The previous method was: to store the kernel and Loader separately, use the Loader as the 'kernel' and the actual kernel as a Multiboot module. I don't like this approach because it doesn't seem intuitive, and the Loader, being a part that is highly related to the kernel, is suitable to be directly integrated into the kernel.
Post Reply