From 705cd5c7252705f449450905b5c31348cf478ac1 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Mon, 23 Sep 2019 20:25:39 +0000 Subject: [PATCH] Remove command line parsing from bootloader --- Makefile | 2 +- boot/fat.asm | 55 ++-------------------------------------------------- 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/Makefile b/Makefile index db1ea66..1446b3b 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ debug.rom: debug/*.asm lib/*.asm nasm -s -o $@ -I lib -I debug debug/main.asm && scripts/fix-rom.sh $@ boot/%.bs: boot/%.asm - nasm -s -DFLOPPY=$(FLOPPY) -DCMDLINE='"KERNEL.COM"' -o $@ $< + nasm -s -DFLOPPY=$(FLOPPY) -o $@ $< programs/%.com: programs/%.asm nasm -s -I lib -o $@ $< diff --git a/boot/fat.asm b/boot/fat.asm index 321454f..aeb8d35 100644 --- a/boot/fat.asm +++ b/boot/fat.asm @@ -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