Makefile 922 B

123456789101112131415161718192021222324252627282930313233
  1. # disable kvm to debug triple faults
  2. QEMU_ARGS=-drive file=build/boot.img,format=raw -no-reboot -no-shutdown -enable-kvm #-d cpu_reset,int
  3. .PHONY: run
  4. run: build
  5. qemu-system-i386 $(QEMU_ARGS) -display curses -S -s
  6. .PHONY: srun
  7. srun: build
  8. qemu-system-i386 $(QEMU_ARGS) -display none -S -s -serial mon:stdio
  9. .PHONY: nativerun
  10. nativerun: build
  11. qemu-system-i386 $(QEMU_ARGS) -display none -serial mon:stdio
  12. .PHONY: configure
  13. configure:
  14. cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
  15. cp build/compile_commands.json .
  16. .PHONY: build
  17. build:
  18. cmake --build build --target boot.img
  19. .PHONY: clean
  20. clean:
  21. -rm -rf build
  22. -rm compile_commands.json
  23. .PHONY: debug
  24. debug:
  25. gdb --symbols=build/kernel.out --init-eval-command 'set pagination off' --init-eval-command 'target remote:1234' --eval-command 'hbr kernel_main' --eval-command 'c'
  26. build/boot.vdi: build/boot.img
  27. -rm build/boot.vdi
  28. VBoxManage convertfromraw $< $@ --format VDI