reactos/boot/freeldr
Hermès Bélusca-Maïto 840d39b9d0
[FREELDR] i386/pc/pcdisk.c: Fix LBA reads retry loop (#7367)
When the Int 13h AH=42h "Extended read" function fails, the disk address
packet's LBA block count is reset to the number of blocks that have been
successfully transferred. This is more or less fine, unless one wants to
ensure the exact number of sectors gets read.

If the function fails so that zero sectors were read, the retry loop is
restarted, but with the packet's LBA block count member reset, as per
the documentation. (In this example, it is reset to zero.) Then, at the
next retry attempt, zero sectors are requested to be read, and this time
of course, the call succeeds... Wrongly, of course, this is not what's
expected.

Therefore, for each retry, the LBA block count member should be set
again to the correct number of sectors to read. There are maximum 3
retries, so the retry loop will stop anyway, but the LBA read will now
correctly fail and return FALSE, as expected.

This problem doesn't exist in the retry loop for the Int 13h, AH=02h
"Read Disk Sectors" CHS function, because here, the call is made only
using registers, and we use a pair of RegsIn/RegsOut. RegsOut receives
the modified register values, but the input RegsIn stays unchanged.
2024-09-25 13:24:08 +02:00
..
bootsect [BOOTSECT][FREELDR] Support booting from NTFS partitions (#3416) 2023-08-17 15:07:59 +02:00
fdebug [TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513) 2022-05-20 15:38:24 +03:00
freeldr [FREELDR] i386/pc/pcdisk.c: Fix LBA reads retry loop (#7367) 2024-09-25 13:24:08 +02:00
install [FREELDR][INSTALL][FDEBUG] Include FreeLDR tools in LiveCD and HybridCD (#2550) 2020-04-15 12:37:21 +02:00
tools Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
CMakeLists.txt Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
FREELDR.INI [FREELDR] Merge boot-drive and partition functionalities together (#6760) 2024-04-19 21:45:41 +02:00
notes.txt Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00