From 256dc5b3d3a23a71f47decea114e68685dd35d81 Mon Sep 17 00:00:00 2001 From: vanten-s Date: Wed, 27 Mar 2024 15:44:49 +0100 Subject: [PATCH] Forgot to add GRUB --- log/2024-03-26.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/log/2024-03-26.md b/log/2024-03-26.md index 09c5bd6..a57607a 100644 --- a/log/2024-03-26.md +++ b/log/2024-03-26.md @@ -350,6 +350,15 @@ fn panic(_info: &core::panic::PanicInfo) -> ! { # Building the kernel To build the kernel I just run `cargo build` in the `kernel` directory. This will produce a binary called `kernel/target/i686-bare-metal/debug/kernel.elf`. I now have a multiboot enabled kernel :) +# Grub +Now to turn the kernel into a ISO file with a bootloader, I used grub. To configure grub I needed to create a directory for it. I made `build/isodir/boot/grub/grub.cfg` containing this: +``` +menuentry "geos" { + multiboot /boot/geos.bin +} +``` +Then I copied `kernel/target/i686-bare-metal/debug/kernel.elf` to `isodir/boot/geos.bin`. Then I ran `grub-mkrescue -o build/geos.iso build/isodir` to make an ISO containing my OS and grub. Yippee + # File structure ``` geos/