The first sector ptr is in bs->NextSector not in the array in
the patch_area. And actually the ADV sectors counting is wrong for a
while ...
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
mov bx,[DataSectors]
shl bx,2
mov ecx,[bsHidden]
- mov eax,[bx+SectorPtrs] ; First ADV sector
- mov edx,[bx+SectorPtrs+4] ; Second ADV sector
+ mov eax,[bx+SectorPtrs-4]; First ADV sector
+ mov edx,[bx+SectorPtrs] ; Second ADV sector
add eax,ecx
add edx,ecx
mov [ADVSec0],eax
nptrs = get_16(&patcharea->secptrcnt);
memset(wp, 0, nptrs * 4);
- while (nsect--)
+ while (--nsect) /* the first sector in bs->NextSector */
set_32(wp++, *sectp++);
/* Poke in the base directory path */
get_16_sl(&patcharea->secptroffset));
nptrs = get_16_sl(&patcharea->secptrcnt);
- while (nsect--) {
+ while (--nsect) { /* the first sector is in bs->NextSector */
set_32_sl(wp++, *sectors++);
nptrs--;
}