X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=kern%2FMakefile;fp=kern%2FMakefile;h=44d9d66a40251c33dce5d47965a24c22a4f37c75;hb=426ed1c5006c82261fee2eea3feafe3282b2b862;hp=0000000000000000000000000000000000000000;hpb=a7e2224fbb33e0662d6fd3fe21e91f5fe185fd4b;p=eightysix diff --git a/kern/Makefile b/kern/Makefile new file mode 100644 index 0000000..44d9d66 --- /dev/null +++ b/kern/Makefile @@ -0,0 +1,38 @@ +disk_numsec = 720 +#disk_numsec = 2880 + +bin = bootldr +img = bootldr.img + +CC = ia16-elf-gcc +LD = ia16-elf-ld + +CFLAGS = -march=i8088 -mtune=i8088 + +$(img): $(bin) + dd if=/dev/zero of=$@ bs=512 count=$(disk_numsec) + dd if=$< of=$@ bs=512 conv=notrunc + +$(bin): boot/boot.o boot/boot2.o boot/main.o + $(LD) -T boot.ld -Map boot.map -o $@ $^ + +%.o: %.asm + nasm -o $@ -f elf $< + +.PHONY: clean +clean: + rm -f boot/*.o $(bin) + + +.PHONY: run +run: $(img) + qemu-system-i386 -fda $(img) -serial file:serial.log + +.PHONY: debug +debug: $(img) + qemu-system-i386 -fda $(img) -serial file:serial.log -s -S + +.PHONY: disasm +disasm: $(bin) + ndisasm -o 0x7c00 $< >dis1 + ndisasm -o 0x80000 -e 512 $< >dis2