This commit is contained in:
Alexander Myltsev 2022-11-25 09:57:00 +00:00
parent 2e56f726c3
commit 6ddcf19a06

View File

@ -1,15 +1,18 @@
GDB=gdb
ifeq ($(shell uname -s),Darwin)
AS=x86_64-elf-as
LD=x86_64-elf-ld
CC=x86_64-elf-gcc
GDB=x86_64-elf-gdb
endif
run: image.bin
qemu-system-i386 -drive format=raw,file=$< -serial mon:stdio
debug-preboot: image.bin mbr.elf
qemu-system-i386 -drive format=raw,file=$< -s -S &
x86_64-elf-gdb mbr.elf \
debug-preboot-nox: image.bin mbr.elf
qemu-system-i386 -nographic -drive format=raw,file=$< -s -S &
$(GDB) mbr.elf \
-ex "set architecture i8086" \
-ex "target remote localhost:1234" \
-ex "break *0x7c00" \
@ -17,14 +20,14 @@ debug-preboot: image.bin mbr.elf
debug-boot: image.bin mbr.elf
qemu-system-i386 -drive format=raw,file=$< -s -S &
x86_64-elf-gdb mbr.elf \
$(GDB) mbr.elf \
-ex "target remote localhost:1234" \
-ex "break init_32bit" \
-ex "continue"
debug: image.bin
qemu-system-i386 -drive format=raw,file=$< -s -S &
x86_64-elf-gdb kernel.bin \
$(GDB) kernel.bin \
-ex "target remote localhost:1234" \
-ex "break _start" \
-ex "continue"