WIP for config.sys parsing
This commit is contained in:
parent
80a7b03ddc
commit
2c2720323c
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
FLOPPY = 360
|
||||
|
||||
PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm))
|
||||
DISTFILES = rdos.sys $(PROGRAMS)
|
||||
DISTFILES = rdos.sys kernel/rconfig.sys $(PROGRAMS)
|
||||
ROMS =
|
||||
|
||||
QEMU_ARCH = $(shell uname -m)
|
||||
|
51
kernel/config.asm
Normal file
51
kernel/config.asm
Normal file
@ -0,0 +1,51 @@
|
||||
config_tokens:
|
||||
.buffers:
|
||||
db 8, "BUFFERS="
|
||||
.drives:
|
||||
db 7, "DRIVES="
|
||||
.files:
|
||||
db 6, "FILES="
|
||||
.none:
|
||||
db 0
|
||||
|
||||
; IN SI offset of needle
|
||||
; DI offset to haystack table
|
||||
; OUT DI found offset in table
|
||||
; ZF zero flag set if match
|
||||
config_search_token:
|
||||
push bp
|
||||
push cx
|
||||
.loop:
|
||||
cmp BYTE [di], 0
|
||||
je .fail
|
||||
push si
|
||||
push di
|
||||
mov bp, di
|
||||
xor ch, ch
|
||||
mov cl, [di]
|
||||
inc di
|
||||
add bp, cx
|
||||
inc bp
|
||||
repe cmpsb
|
||||
pop di
|
||||
pop si
|
||||
je .end
|
||||
mov di, bp
|
||||
jmp .loop
|
||||
.fail:
|
||||
stc
|
||||
.end:
|
||||
pop cx
|
||||
pop cx
|
||||
ret
|
||||
|
||||
config_parse_int:
|
||||
ret
|
||||
|
||||
; IN BX offset to config data
|
||||
config_first_run:
|
||||
mov si, bx
|
||||
mov di, config_tokens
|
||||
call config_search_token
|
||||
int3
|
||||
ret
|
@ -38,6 +38,8 @@ init:
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
call config_first_run
|
||||
|
||||
mov di, kernel_end
|
||||
call drive_setup
|
||||
|
||||
@ -56,5 +58,6 @@ init:
|
||||
hlt
|
||||
jmp .halt
|
||||
|
||||
%include "config.asm"
|
||||
|
||||
kernel_end:
|
||||
|
1
kernel/rconfig.sys
Normal file
1
kernel/rconfig.sys
Normal file
@ -0,0 +1 @@
|
||||
DRIVES=4
|
Loading…
Reference in New Issue
Block a user