Okay, I'm making an OS, Casnix OS (search "casnix" on google). My list_directory function, or ls function, is broken, and I can't find what I changed that broke it.
Can someone look at the code below and help me determine if it's a variable in the ls function, or an external variable that could cause this.
list_directory:
mov cx, 0 ; Counter
call os_get_file_list
mov si, dirlist ; external var
mov ah, 0Eh ; BIOS teletype function
.repeat:
lodsb ; Start printing filenames
cmp al, 0 ; Quit if end of string
je .done
cmp al, ',' ; If comma in list string, don't print it
jne .nonewline
pusha
call os_print_newline ; But print a newline instead
popa
jmp .repeat
.nonewline:
int 10h
jmp .repeat
.done:
call os_print_newline
jmp get_cmd
This compiles okay (its part of the CLI module in my kernel), but when I run my OS and get to the command line and type in the command ls
Casnix OS/I version 1.0.1
Built-in commands: ls, cat, ......
$ ls
# prints a new line here, but not the files
$
On the boot disk, there are atleast 8 files, and I can view them in my filemanager.
So, again; Can you help me find the error?