Page 1 of 1

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

Posted: Fri Apr 12, 2024 11:40 pm
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.