added back grub

This commit is contained in:
rami 2024-06-28 16:01:28 -04:00
parent a7209c2e9f
commit 1f4195225e
2 changed files with 13 additions and 6 deletions

View File

@ -10,9 +10,11 @@ KOBJ := $(addprefix $(BUILDDIR)/, \
$(patsubst %.asm,%.o, $(patsubst %.c,%.o, $(KSRC))))) $(patsubst %.asm,%.o, $(patsubst %.c,%.o, $(KSRC)))))
KIMG := kernel.bin KIMG := kernel.bin
ISO := Hazel.iso
CFLAGS := -ffreestanding -Wall -Wextra -Werror -I $(INCLUDEDIR) CFLAGS := -ffreestanding -Wall -Wextra -Werror -I $(INCLUDEDIR)
LDFLAGS := -ffreestanding -nostdlib -lgcc -T kernel/kernel.ld LDFLAGS := -ffreestanding -nostdlib -lgcc -T kernel/kernel.ld
QEMUFLAGS := -kernel $(BUILDDIR)/$(KIMG) \ QEMUFLAGS := -cdrom $(BUILDDIR)/$(ISO) \
-serial stdio -serial stdio
$(BUILDDIR)/$(KIMG): $(KOBJ) $(BUILDDIR)/$(KIMG): $(KOBJ)
@ -24,12 +26,12 @@ $(BUILDDIR)/%.o: */%.c
kernel: $(BUILDDIR)/$(KIMG) kernel: $(BUILDDIR)/$(KIMG)
$(BUILDDIR)/Hazel.iso: kernel $(BUILDDIR)/$(ISO): kernel
cp $(BUILDDIR)/kernel.bin boot/kernel.bin cp $(BUILDDIR)/$(KIMG) boot/$(KIMG)
grub-mkrescue -o $(BUILDDIR)/Hazel.iso . grub-mkrescue -o $(BUILDDIR)/$(ISO) .
iso: $(BUILDDIR)/$(ISO)
qemu: kernel qemu: iso
qemu-system-i386 $(QEMUFLAGS) qemu-system-i386 $(QEMUFLAGS)
clean: clean:
rm build/* boot/*.bin rm build/* boot/*.bin

5
boot/grub/grub.cfg Normal file
View File

@ -0,0 +1,5 @@
default=0
timeout=0
menuentry "Hazel" {
multiboot /boot/kernel.bin
}