Index: trunk/bootcode/regular/driveio.asm
===================================================================
--- trunk/bootcode/regular/driveio.asm	(revision 123)
+++ trunk/bootcode/regular/driveio.asm	(revision 124)
@@ -878,5 +878,5 @@
 ;# ACTION   : Locates the Master LVM sector on the specified disk
 ;# ----------------------------------------------------------------------------
-;# EFFECTS  : None
+;# EFFECTS  : Leaves [Scratch] with last sector read or cleared
 ;# ----------------------------------------------------------------------------
 ;# IN       : DL    - BIOS disk number of drive to search
@@ -909,21 +909,14 @@
         ; This is of course no problem since it is the MBR.
     DriveIO_LocateMasterLVMSector_next:
+        mov     si, offset [Scratch]    ; Use scratch area to load sectors
+        call    ClearSectorBuffer       ; Clear the scratch area
         clc                             ; Indicate Master LVM sector not found
         jcxz    DriveIO_LocateMasterLVMSector_done
 
-        ; Clear the sector buffer
-        mov     bx, cx                  ; Save our precious sector LBA
-        mov     cx, 100h                ; Clear 256 words is 512 bytes
-        mov     di, offset [TmpSector]  ; Offset of buffer
-        xor     ax, ax                  ; Value to sture
-        cld                             ; Increment DI each time
-        rep     stosw                   ; Store the value
-        mov     cx, bx                  ; Restore our precious sector LBA
-
-        ; Now read the LBA sector specified in CX
+        ; Read the LBA sector specified in CX
         mov     ax, cx                  ; LBA low
         xor     bx, bx                  ; LBA high
-        mov     di, ds                  ; Segment of temp buffer
-        mov     si, offset [TmpSector]  ; Offset of temp buffer
+        mov     di, ds                  ; Segment of scratch buffer
+        mov     si, offset [Scratch]    ; Offset of scratch buffer
         call    DriveIO_ReadSectorLBA   ; Read the sector
         lahf                            ; Save CF
@@ -944,5 +937,5 @@
         ; of the SPT value its OS/2 geometery specifies, which, in LBA terms
         ; is LVM SPT-1 -- let's check that...
-        mov     bx, offset [TmpSector]          ; Offset of the loaded LVM sector
+        mov     bx, offset [Scratch]            ; Offset of the loaded LVM sector
         mov     al, [bx+LocLVM_Secs]            ; Get the LVM SPT value (<=255)
         dec     al                              ; Adjust to LVM LBA
@@ -950,5 +943,4 @@
         inc     ah                              ; This one was found here
         cmp     al, ah                          ; If same, LVM LBA location OK
-        call    DEBUG_DumpRegisters
         jne     DriveIO_LocateMasterLVMSector_next
 
Index: trunk/bootcode/regular/other.asm
===================================================================
--- trunk/bootcode/regular/other.asm	(revision 123)
+++ trunk/bootcode/regular/other.asm	(revision 124)
@@ -639,13 +639,14 @@
 ; Check if a loaded sector is all zeros
 ;------------------------------------------------------------------------------
-; IN    : BX pointer to memblock
+; IN    : SI pointer to sector buffer
 ; OUT   : ZF=1 block if all zeros
 ; NOTE  : Segment used is DS
 ;------------------------------------------------------------------------------
-IsSectorZero    Proc    Near    Uses cx
+IsSectorBufferZero  Proc    Near    Uses bx cx
+        mov     bx, si          ; Address of sector buffer
         mov     cx, sector_size ; Normal size of a sector (512 bytes)
         call    IsMemBlockZero  ; Check the memory block
         ret
-IsSectorZero    EndP
+IsSectorBufferZero  EndP
 
 ;------------------------------------------------------------------------------
@@ -685,9 +686,10 @@
 ; Clears a sector buffer
 ;------------------------------------------------------------------------------
-; IN    : BX pointer to sector buffer
+; IN    : SI pointer to sector buffer
 ; OUT   : Nothing
 ; NOTE  : Segment used is DS
 ;------------------------------------------------------------------------------
-ClearSectorBuffer   Proc    Near    Uses cx
+ClearSectorBuffer   Proc    Near    Uses bx cx
+        mov     bx, si              ; Address of sector buffer
         mov     cx, sector_size     ; Normal size of a sector (512 bytes)
         call    ClearMemBlock       ; Clear the sector buffer
Index: trunk/bootcode/special/lvm.asm
===================================================================
--- trunk/bootcode/special/lvm.asm	(revision 123)
+++ trunk/bootcode/special/lvm.asm	(revision 124)
@@ -125,6 +125,5 @@
 ; Destroyed: None
 LVM_CheckSectorCRC              Proc Near   Uses ax bx dx
-        mov     bx, si
-        call    IsSectorZero                ; Zero sector implies bad CRC
+        call    IsSectorBufferZero          ; Zero sector implies bad CRC
         jz      LVMCSCRC_BadCRC
         call    LVM_GetSectorCRC            ; Only use after CRC table is valid
