From 7da9e56268ec90261be8ef3002cef252c76c826f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 3 Apr 2025 14:39:21 -0400 Subject: grub --- Makefile | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c29b2de..6ff4420 100644 --- a/Makefile +++ b/Makefile @@ -6,16 +6,16 @@ UNAME := $(shell uname) QEMU = qemu-system-x86_64 -QEMUOPTS = -drive file=bin/disk.img,index=0,media=disk,format=raw \ +QEMUOPTS = -cdrom bin/os.iso \ -no-reboot \ -serial mon:stdio \ -m 4G \ -name kern -qemu: bin/disk.img +qemu: bin/os.iso $(QEMU) $(QEMUOPTS) -qemu-gdb: bin/disk.img +qemu-gdb: bin/os.iso $(QEMU) $(QEMUOPTS) -S -gdb tcp::1337 gdb: @@ -28,24 +28,12 @@ clean: build: zig build +bin/os.iso: build + mkdir -p bin/iso/boot/grub + cp grub.cfg bin/iso/boot/grub + cp bin/kernel bin/iso/boot + grub-mkrescue -o bin/os.iso bin/iso + fmt: clang-format -i $(shell find -type f -name "*.[ch]") sed -i 's/[ \t]*$$//' $(shell find -type f -name "*.[chS]" -or -name "*.ld") - -bin/boot.bin: build - cd bin && \ - objcopy -S -O binary -j .text boot boot.bin - -bin/kernel.bin: build - cd bin && \ - objcopy -S -O binary kernel kernel.bin - -bin/user.img: build - cd bin && \ - ./mkblob init idle prog* shell - -bin/disk.img: bin/kernel.bin bin/boot.bin - cd bin && \ - ./BuildImage -d usb -o disk.img -b boot.bin \ - kernel.bin 0x10000 - -- cgit v1.2.3-freya