|
@@ -1,18 +1,23 @@
|
|
|
# disable kvm to debug triple faults
|
|
|
-QEMU_ARGS=-drive file=build/boot.img,format=raw -no-reboot -no-shutdown -enable-kvm #-d cpu_reset,int
|
|
|
+GDB_BIN=gdb
|
|
|
+QEMU_BIN=qemu-system-i386
|
|
|
+QEMU_ACCELERATION_FLAG=-enable-kvm
|
|
|
+QEMU_DEBUG_FLAG=-d cpu_reset,int
|
|
|
+QEMU_ARGS=-drive file=build/boot.img,format=raw -no-reboot -no-shutdown $(QEMU_ACCELERATION_FLAG) #$(QEMU_DEBUG_FLAG)
|
|
|
+CROSS_COMPILE=#--toolchain cross-compile.cmake
|
|
|
.PHONY: run
|
|
|
run: build
|
|
|
- qemu-system-i386 $(QEMU_ARGS) -display curses -S -s
|
|
|
+ $(QEMU_BIN) $(QEMU_ARGS) -display curses -S -s
|
|
|
.PHONY: srun
|
|
|
srun: build
|
|
|
- qemu-system-i386 $(QEMU_ARGS) -display none -S -s -serial mon:stdio
|
|
|
+ $(QEMU_BIN) $(QEMU_ARGS) -display none -S -s -serial mon:stdio
|
|
|
.PHONY: nativerun
|
|
|
nativerun: build
|
|
|
- qemu-system-i386 $(QEMU_ARGS) -display none -serial mon:stdio
|
|
|
+ $(QEMU_BIN) $(QEMU_ARGS) -display none -serial mon:stdio
|
|
|
|
|
|
.PHONY: configure
|
|
|
configure:
|
|
|
- cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
|
|
|
+ cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug $(CROSS_COMPILE)
|
|
|
cp build/compile_commands.json .
|
|
|
|
|
|
.PHONY: build
|
|
@@ -26,7 +31,7 @@ clean:
|
|
|
|
|
|
.PHONY: debug
|
|
|
debug:
|
|
|
- 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'
|
|
|
+ $(GDB_BIN) --symbols=build/kernel.out --init-eval-command 'set pagination off' --init-eval-command 'target remote:1234' --eval-command 'hbr kernel_main' --eval-command 'c'
|
|
|
|
|
|
build/boot.vdi: build/boot.img
|
|
|
-rm build/boot.vdi
|