From 7edcfd1336d7b08fa28c88dbcc88c48b15b2f39e Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Fri, 23 Jan 2015 20:26:12 -0800 Subject: [PATCH] It boots and dies, good start --- Makefile | 14 ++++++++++++++ bochsrc | 3 +++ bootloader.S | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 Makefile create mode 100644 bochsrc create mode 100644 bootloader.S diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f39ce57 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +all: boot.img + +boot.bin: bootloader.S + nasm $< -f bin -o $@ + +boot.img: boot.bin + dd if=$< bs=512 of=$@ + +test: boot.img + bochs -f bochsrc -q + +.PHONY: clean +clean: + rm -f boot.bin diff --git a/bochsrc b/bochsrc new file mode 100644 index 0000000..5cba4d6 --- /dev/null +++ b/bochsrc @@ -0,0 +1,3 @@ +display_library: sdl +boot: floppy +floppya: 1_44=boot.img, status=inserted diff --git a/bootloader.S b/bootloader.S new file mode 100644 index 0000000..33672e3 --- /dev/null +++ b/bootloader.S @@ -0,0 +1,7 @@ +[BITS 16] ; 16 bit real mode code +[ORG 0x7C00] ; Origin at 0x7C00 (upper end of memory) + +JMP $ ; hang forever + +TIMES 510 - ($ - $$) db 0 ; fill up to 510 bytes with 0 +DW 0xAA55 ; magic bootloader signature \ No newline at end of file