Загрузчик:
[BITS 16]
ORG 0x7С00
START:
CALL SET_VIDEO_MODE
CALL GO_TO_KERNEL
JMP $
SET_VIDEO_MODE:
MOV AX, 0x4F02
MOV BX, 0x0003
INT 0x0010
RET
GO_TO_KERNEL:
;
SUCESS:
MOV AH, 0x000E
MOV AL, 0x0053
INT 0x0010
JMP $
ERROR:
MOV AH, 0x000E
MOV AL, 0x0045
INT 0x0010
JMP $
TIMES 510 - ($ - $$) DB 0
DW 0xAA55
Ядро:
int main ()
{
return 0;
}
Makefile
all:
nasm src/boot.asm -o build/boot -f bin
i686-elf-gcc -m16 -ffreestanding src/kernel.c -o build/kernel
dd if=/dev/zero of=os.img bs=512 count=2400
dd if=build/boot of=os.img conv=notrunc
dd if=build/kernel of=os.img seek=1 conv=notrunc
run:
qemu-system-i386 -fda os.img
clean:
-rm build/*
-rm os.img
dump:
cat src/*
cat makefile
install-deps:
brew install nasm i686-elf-gcc qemu