Provide config file via CX (len) and BX (ptr) to kernel entry
This commit is contained in:
parent
a4e6a943b0
commit
80a7b03ddc
32
boot/fat.asm
32
boot/fat.asm
@ -103,30 +103,38 @@ main:
|
|||||||
; clusters start after rootdir
|
; clusters start after rootdir
|
||||||
mov [cluster_offset], ax
|
mov [cluster_offset], ax
|
||||||
|
|
||||||
|
; Load kernel
|
||||||
mov bx, prog
|
mov bx, prog
|
||||||
|
|
||||||
mov ax, kernel_name
|
mov ax, kernel_name
|
||||||
call load_file
|
call load_file
|
||||||
mov bp, 0x3332
|
mov bp, 0x3332
|
||||||
jc error
|
jc error
|
||||||
|
|
||||||
mov si, bx
|
; Load config file after kernel
|
||||||
sub si, prog
|
push bx
|
||||||
|
|
||||||
push si
|
|
||||||
|
|
||||||
mov ax, config_name
|
mov ax, config_name
|
||||||
call load_file
|
call load_file
|
||||||
|
pop bx
|
||||||
|
|
||||||
pop si
|
; Write a null byte after config file
|
||||||
|
mov BYTE [bx+di], 0
|
||||||
|
|
||||||
int3
|
; Setup registers for kernel
|
||||||
|
xor ax, ax
|
||||||
; restore boot drive number
|
; CX is size of config
|
||||||
|
mov cx, di
|
||||||
|
; DL is drive number
|
||||||
|
xor dx, dx
|
||||||
mov dl, [fdc.drv]
|
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
|
; jump into kernel
|
||||||
jmp 0x07C0:0x0000
|
jmp (prog>>4):0
|
||||||
|
|
||||||
; Load a file into memory
|
; Load a file into memory
|
||||||
; IN AX pointer to 8.3 filename
|
; IN AX pointer to 8.3 filename
|
||||||
|
Loading…
Reference in New Issue
Block a user