boot32: fix very old bug, init high byte of fat_secshift

It turned out that this loader was severely broken for many years,
at least since 2012 (the git repo's creation). This variable was
read as a word to set cx for a loop, but only the low byte had
been written. The high byte happened to be 0EEh so cn_loop would
always zero out the FAT sector to read.

This _happened_ to work if the first root directory cluster and
all the kernel file clusters were all referenced in the first
sector of the FAT. Otherwise it would blow up.
This commit is contained in:
E. C. Masloch 2024-01-19 21:40:51 +01:00 committed by Kenneth J Davis
parent 52136b27d6
commit 3415ad93c9

View File

@ -144,7 +144,7 @@ secshift: inc ax
shr cx, 1
cmp cx, 1
jne secshift
mov byte [fat_secshift], al
mov word [fat_secshift], ax
dec cx
; FINDFILE: Searches for the file in the root directory.