Add targets "debug" and "clean".

This commit is contained in:
Alexander Myltsev 2022-09-21 17:37:27 +03:00
parent 298d1be60c
commit 1cc3169cd0
2 changed files with 11 additions and 1 deletions

View File

@ -4,9 +4,19 @@ LD=x86_64-elf-ld
run: mbr.bin run: mbr.bin
qemu-system-i386 -drive format=raw,file=$< qemu-system-i386 -drive format=raw,file=$<
debug: mbr.bin
qemu-system-i386 -drive format=raw,file=$< -s -S &
i386-elf-gdb \
-ex "target remote localhost:1234" \
-ex "set architecture i8086" \
-ex "break *0x7c00" \
-ex "continue"
%.o: %.S %.o: %.S
$(AS) $^ -o $@ $(AS) $^ -o $@
mbr.bin: mbr.o mbr.bin: mbr.o
$(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@ $(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@
clean:
rm *.bin *.o

2
mbr.S
View File

@ -1,6 +1,6 @@
.code16 .code16
.global _start .global _start
_start: #точка входа _start:
mov $banner, %si mov $banner, %si
call print_string call print_string