boot, oemboot: fix to abort properly on file not found

Prior to this commit the first cluster specified from the last
compared directory entry would be used if the file is not found.
Fix the wrong (boot.asm) or missing (oemboot.asm) jump to the
error handler so that on file not found an error is displayed.

Reference: https://sourceforge.net/p/freedos/bugs/97/
"Bugs in FAT12/16 boot sector loaders if file not found"
This commit fixes the most crucial bug of this 2012-09-27 report.
This commit is contained in:
C. Masloch 2021-07-29 13:22:43 +02:00 committed by Kenneth J Davis
parent f267341281
commit 858934f152
2 changed files with 2 additions and 1 deletions

View File

@ -266,7 +266,7 @@ next_entry: mov cx, 11
cmp byte [es:di], 0 ; if the first byte of the name is 0,
jnz next_entry ; there is no more files in the directory
jc boot_error ; fail if not found
jmp boot_error ; fail if not found
ffDone:
push ax ; store first cluster number

View File

@ -353,6 +353,7 @@ next_entry: mov cx, 11
jc boot_error ; fail if not found and si wraps
cmp byte [si], 0 ; if the first byte of the name is 0,
jnz next_entry ; there are no more files in the directory
jmp boot_error
ffDone:
mov [first_cluster], ax ; store first cluster number