diff options
| author | Arseney300 <Arseney300@gmail.com> | 2026-04-08 02:32:55 +0700 |
|---|---|---|
| committer | Arseney300 <Arseney300@gmail.com> | 2026-04-08 02:32:55 +0700 |
| commit | 2f95320e0859029f520d46f777591751dcd39634 (patch) | |
| tree | 8959e54b7a33cbcb84dacd79657f75c93994dc4d | |
| parent | 4912796d2e88c6eb5d02fbf0fb9c39f8c9f7cd4c (diff) | |
doc: add information about grub multiboot
| -rw-r--r-- | doc/boot/grub_multiboot.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/boot/grub_multiboot.md b/doc/boot/grub_multiboot.md new file mode 100644 index 0000000..8239674 --- /dev/null +++ b/doc/boot/grub_multiboot.md @@ -0,0 +1,16 @@ +## GRUB multiboot + +So, technically GRUB can load and ELF64 with some moments: + +1) Multiboot requires special header. +2) Special calling convention - Multiboot passes boot info in EAX/EBX (magic + Multiboot info struct pointer). +3) Multiboot1 enters in 32-bit protected mode - Long mode is not set up. We need a 32->64 bit trampoline. +Multiboot2 has a 64-bit EFI handoff tag, but that's a different path. +4) Multiboot is x86-only +5) We haven't BootInfo, like i did in UEFI + +Also Multiboot have stack. When UEFI jumps to kernel, no stack exists for the kernel. Because of it i use asm code to run kernel. +GRUB sets up a basic stack before jump. But, we don't know size and location of this stack. + + +Example of "kernel" that use it: https://github.com/igmunv/kosmos |
