
modified: src/bootloader/bootloader.asm new file: src/include/kernel.h modified: src/include/libc.h modified: src/include/paging.h new file: src/include/panic.h modified: src/kernel/kernel.c modified: src/kernel/libc.c modified: src/kernel/page.c new file: src/kernel/panic.c modified: src/link.ld modified: src/makefile modified: tools/page/page.py
41 lines
599 B
NASM
41 lines
599 B
NASM
bios_disk:
|
|
.load_sectors:
|
|
pusha
|
|
mov es, dx
|
|
|
|
; TODO when our kernel gets to big to fit in one track, we need to just switch over to LHS with extended bios functions.
|
|
|
|
mov ah, 0x02 ; read disc sectors
|
|
mov ch, 0x00 ; track 0
|
|
mov dh, 0x00 ; head 0
|
|
mov dl, [stage0.boot_device]
|
|
|
|
int 0x13
|
|
|
|
jc .failed
|
|
|
|
mov ah, 0
|
|
popa
|
|
ret
|
|
|
|
.failed:
|
|
debug:
|
|
mov bx, .loadsectors_error
|
|
mov cx, 0
|
|
call bios_print
|
|
|
|
push 0
|
|
mov al, ah
|
|
mov ah, 0 ; you need to clean up the bios print function!
|
|
push ax
|
|
mov cx, 1
|
|
mov bx, sp
|
|
call bios_print
|
|
|
|
|
|
mov ah, 1
|
|
popa
|
|
ret
|
|
|
|
.loadsectors_error: db "Error loading sectors: ", 0
|