Commit with some sample code and a working project folder + makefile.
This commit is contained in:
parent
3716741e55
commit
2ede69e8f0
3 changed files with 44 additions and 0 deletions
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#build build, go away...
|
||||
build/
|
||||
|
||||
#swap,tmp,etc
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
22
Makefile
Normal file
22
Makefile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Makefile
|
||||
SRC_DIR = src
|
||||
BUILD_DIR = build
|
||||
BOOTLOADER_SRC = $(SRC_DIR)/boot.asm
|
||||
BOOTLOADER_IMG = $(BUILD_DIR)/boot.img
|
||||
|
||||
QEMU = qemu-system-i386
|
||||
|
||||
all: $(BOOTLOADER_IMG)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $(BUILD_DIR)
|
||||
|
||||
$(BOOTLOADER_IMG): $(BOOTLOADER_SRC) | $(BUILD_DIR)
|
||||
nasm -f bin $(BOOTLOADER_SRC) -o $(BOOTLOADER_IMG)
|
||||
|
||||
run: all
|
||||
$(QEMU) -drive format=raw,file=$(BOOTLOADER_IMG) -display gtk
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
15
src/boot.asm
Normal file
15
src/boot.asm
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
; boot.asm - simple boot sector
|
||||
BITS 16
|
||||
ORG 0x7C00
|
||||
|
||||
start:
|
||||
mov ah, 0x0E
|
||||
mov al, 'H'
|
||||
int 0x10
|
||||
mov al, 'i'
|
||||
int 0x10
|
||||
|
||||
jmp $
|
||||
|
||||
times 510 - ($ - $$) db 0
|
||||
dw 0xAA55
|
||||
Loading…
Reference in a new issue