Compare commits

...

2 Commits

Author SHA1 Message Date
Juhani Krekelä 89e377bf2d Print a dot for each loaded sector in bootloader 2021-07-06 21:54:34 +03:00
Juhani Krekelä 283ed06d7e Ignore deleted files in bootloader 2021-07-06 21:50:56 +03:00
1 changed files with 17 additions and 13 deletions

View File

@ -120,14 +120,17 @@ search_root:
cmp byte [si], 0 cmp byte [si], 0
je .end je .end
; Deleted file?
cmp byte [si], 0xe5
je .skipentry
test byte [si + 11], 0x08 + 0x10 test byte [si + 11], 0x08 + 0x10
jnz .skipentry jnz .skipentry
; Make sure the file has non-zero size ; Make sure the file has non-zero size
; File size must be <32K anyways so don't bother with >64K
cmp word [si + 28], 0 cmp word [si + 28], 0
jne .isfile jne .isfile
cmp word [si + 30], 0
jne .isfile
.skipentry: .skipentry:
add si, 32 add si, 32
@ -295,9 +298,8 @@ execute_kernel:
jmp 0:0x500 jmp 0:0x500
; Note: bx will point to after the read data ; Note: bx will point to after the read data
; Note: ax, cx, and di will be clobbered ; Note: ax, cx, dx, and di will be clobbered
loadsectors: loadsectors:
push dx
.loop: .loop:
mov di, 3 + 1 ; Retry thrice, + 1 is since we dec first mov di, 3 + 1 ; Retry thrice, + 1 is since we dec first
@ -342,6 +344,9 @@ loadsectors:
jc .error jc .error
mov ax, 0x0e00 + '.'
int 0x10
pop cx pop cx
pop ax pop ax
@ -350,7 +355,6 @@ loadsectors:
loop .loop loop .loop
pop dx
ret ret
.error: .error:
@ -369,12 +373,12 @@ loadsectors:
jmp .retry jmp .retry
fatal_error: fatal_error:
lodsb mov cx, 9
test al, al .loop:
jz hang lodsb
mov ah, 0xe mov ah, 0xe
int 0x10 int 0x10
jmp fatal_error loop .loop
hang: hang:
hlt hlt
@ -386,8 +390,8 @@ ettinos_kernel_cluster dw 0
ettinos_kernel_name db "SYSTEM BIN" ettinos_kernel_name db "SYSTEM BIN"
notfound_msg db "No kernel", 0 notfound_msg db "No kernel"
diskerror_msg db "Disk error", 0 diskerror_msg db "Disk error"
choose_msg db "(E)ttinOS/Nor86?", 0 choose_msg db "(E)ttinOS/Nor86?", 0
times 510-($-$$) db 0 times 510-($-$$) db 0