Load kernel from reserved sectors in fatfs

This commit is contained in:
Nero 2020-09-17 05:57:46 +00:00
parent 1ee0637eab
commit 8e87cf0f75
3 changed files with 36 additions and 18 deletions

View file

@ -7,11 +7,12 @@
; kernel stack size in words
%define stacksize 512
jmp init
jmp near init
times ( 0x0B - ($-$$) ) db " "
db "LOVELAIN"
times bpb_size db 0
; mformat writes stuff until 0x3E
params: times ( 0x3E - ($-$$) ) nop
init: cli
xor ax, ax
@ -20,11 +21,31 @@ init: cli
mov ss, ax
mov sp, ( stack+stacksize )
mov ax, [params+bpb.sectoroffset]
mov dx, [params+bpb.sectoroffset+2]
mov ax, 0x0201
mov cx, 0x0002
mov dh, 0
mov bx, 0x7E00
int 0x13
mov ax, [0x7E00]
mov cx, [0x7E02]
mov dx, [0x7E04]
int 3
hlt: hlt
jmp hlt
times (0x1FE - ($-$$)) db 0
dw 0xAA55
db "rdos kernel"
end: align 512
section .bss
stack: resb stacksize

View file

@ -131,7 +131,7 @@ part1: db 0x80
db 0x01
db 0xFF, 0xFF, 0xFF
dd 1
dd (FLOPPY * 2)
dd (1440 * 2)
times (0x1FE - ($-$$)) db 0