diff --git a/Makefile b/Makefile index 79aec12..3be925f 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,19 @@ LD=x86_64-elf-ld run: mbr.bin 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 $(AS) $^ -o $@ mbr.bin: mbr.o $(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@ +clean: + rm *.bin *.o diff --git a/mbr.S b/mbr.S index 4aceb13..419ec05 100644 --- a/mbr.S +++ b/mbr.S @@ -1,6 +1,6 @@ .code16 .global _start -_start: #точка входа +_start: mov $banner, %si call print_string