Remove command line parsing from bootloader

This commit is contained in:
Nero 2019-09-23 20:25:39 +00:00
parent e94059c625
commit 705cd5c725
2 changed files with 3 additions and 54 deletions

View file

@ -5,7 +5,6 @@
%define psp (prog - 0x100)
%define prog 0x07C00
%define filename (psp + 0x5C + 1)
%define arguments (psp + 0x81)
org self
@ -104,8 +103,6 @@ main:
; clusters start after rootdir
mov [cluster_offset], ax
call parse_cmdline
call load_file
mov bp, 0x3332
jc error
@ -258,56 +255,8 @@ error:
int 0x16
int 0x19
parse_cmdline:
mov si, cmdline
mov di, filename
.cleanout:
push di
mov cx, 0x0A
mov al, 0x20
rep stosb
pop di
.base_loop:
call .read
cmp al, 0x2E
je .ext_start
cmp al, 0x20
je .args_start
stosb
jmp .base_loop
.ext_start:
mov di, (filename + 8)
.ext_loop:
call .read
cmp al, 0x20
je .args_start
stosb
jmp .ext_loop
.args_start:
mov di, (psp + 0x81)
.args_loop:
lodsb
test al, al
jz .args_end
stosb
jmp .args_loop
.args_end:
mov ax, di
sub ax, (psp + 0x81)
mov [psp+0x80], al
mov al, 0x0D
stosb
ret
.read:
lodsb
test al, al
jnz .ret
pop ax
.ret:
ret
cmdline:
db CMDLINE, 0
filename:
db "KERNEL COM"
times (0x1FE - ($-$$)) db 0