diff --git a/Makefile b/Makefile index f5a9e7a0..f9f6b903 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ ISODIR=$(shell pwd)/iso ISO=astral.iso LIMINEDIR=$(shell pwd)/host-pkgs/limine/usr/local/share/limine/ KERNEL=pkgs/astral/boot/astral +QEMUFLAGS=-cdrom $(ISO) -m 2G -smp cpus=2 -monitor stdio -debugcon file:/dev/stdout -serial file:/dev/stdout # hacky but works :') .PHONY: all kernel clean clean-kernel iso @@ -20,9 +21,9 @@ $(ISO): limine.cfg liminebg.bmp $(KERNEL) xorriso -as mkisofs -b limine-cd.bin -no-emul-boot -boot-load-size 4 -boot-info-table --efi-boot limine-cd-efi.bin -efi-boot-part --efi-boot-image --protective-msdos-label $(ISODIR) -o $(ISO) kernel: - rm builds/astral.configured - rm builds/astral.installed - rm builds/astral.built + rm -f builds/astral.configured + rm -f builds/astral.installed + rm -f builds/astral.built ./jinx build astral clean-kernel: @@ -32,3 +33,9 @@ clean: make clean-kernel ./jinx clean rm jinx + +run: + qemu-system-x86_64 $(QEMUFLAGS) + +run-kvm: + qemu-system-x86_64 $(QEMUFLAGS) -enable-kvm -cpu host diff --git a/kernel-src/Makefile b/kernel-src/Makefile index ac1f4791..cf85020b 100644 --- a/kernel-src/Makefile +++ b/kernel-src/Makefile @@ -5,7 +5,7 @@ TARGET=x86-64 INCDIR=$(shell pwd)/include ARCHDIR=$(shell pwd)/arch/$(TARGET)/ LDFLAGS=-ffreestanding -nostdlib -lgcc -Wl,-T,"$(ARCHDIR)/kernel.ld" -debug -CFLAGS=-ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -nostdlib -nostdinc -I "${INCDIR}" +CFLAGS=-ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -nostdlib -I "${INCDIR}" ASFLAGS=-felf64 astral: $(OBJS)