From 0f2ad47bfbca5c46443bf7d55fb503e2e137959c Mon Sep 17 00:00:00 2001 From: Brian Palmer Date: Wed, 28 Aug 2002 04:46:17 +0000 Subject: [PATCH] Fix for disk error while Loading FreeLoader... discovered by Dave Albert In ReadSectorsCHS it was pop'ing values off the stack that hadn't been push'ed svn path=/trunk/; revision=3417 --- freeldr/bootsect/fat.asm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/freeldr/bootsect/fat.asm b/freeldr/bootsect/fat.asm index 5ce48287a7d..389de0576a1 100644 --- a/freeldr/bootsect/fat.asm +++ b/freeldr/bootsect/fat.asm @@ -338,6 +338,7 @@ ReadSectorsLBA: ; CarryFlag set on error ReadSectorsCHS: popa +ReadSectorsCHSLoop: pusha xchg ax,cx xchg ax,dx @@ -351,8 +352,8 @@ ReadSectorsCHS: mov dh,dl ; Head to DH, drive to DL mov dl,[BYTE bp+BootDrive] ; Drive number mov ch,al ; Cylinder in CX - ror ah,1 ; Low 8 bits of cylinder in CH, high 2 bits - ror ah,1 ; in CL shifted to bits 6 & 7 + ror ah,2 ; Low 8 bits of cylinder in CH, high 2 bits + ; in CL shifted to bits 6 & 7 or cl,ah ; Or with sector number mov ax,0201h int 13h ; DISK - READ SECTORS INTO MEMORY @@ -375,7 +376,7 @@ NoCarryCHS: mov es,bx pop bx ; Increment read buffer for next sector - loop ReadSectorsCHS ; Read next sector + loop ReadSectorsCHSLoop ; Read next sector ret