It boots and dies, good start
This commit is contained in:
14
Makefile
Normal file
14
Makefile
Normal file
@@ -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
|
||||||
3
bochsrc
Normal file
3
bochsrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
display_library: sdl
|
||||||
|
boot: floppy
|
||||||
|
floppya: 1_44=boot.img, status=inserted
|
||||||
7
bootloader.S
Normal file
7
bootloader.S
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user