Provide config file via CX (len) and BX (ptr) to kernel entry

This commit is contained in:
Nero 2019-09-24 21:33:04 +00:00
parent a4e6a943b0
commit 80a7b03ddc

View File

@ -103,30 +103,38 @@ main:
; clusters start after rootdir
mov [cluster_offset], ax
; Load kernel
mov bx, prog
mov ax, kernel_name
call load_file
mov bp, 0x3332
jc error
mov si, bx
sub si, prog
push si
; Load config file after kernel
push bx
mov ax, config_name
call load_file
pop bx
pop si
; Write a null byte after config file
mov BYTE [bx+di], 0
int3
; restore boot drive number
; Setup registers for kernel
xor ax, ax
; CX is size of config
mov cx, di
; DL is drive number
xor dx, dx
mov dl, [fdc.drv]
; BX is offset of config
sub bx, prog
; the pointers are 0
xor bp, bp
xor si, si
xor di, di
; jump into target
jmp 0x07C0:0x0000
; jump into kernel
jmp (prog>>4):0
; Load a file into memory
; IN AX pointer to 8.3 filename