Ignore:
Timestamp:
Apr 8, 2017, 12:27:24 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Use SI instead of BX for actions on sector buffers [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/regular/driveio.asm

    r123 r124  
    878878;# ACTION   : Locates the Master LVM sector on the specified disk
    879879;# ----------------------------------------------------------------------------
    880 ;# EFFECTS  : None
     880;# EFFECTS  : Leaves [Scratch] with last sector read or cleared
    881881;# ----------------------------------------------------------------------------
    882882;# IN       : DL    - BIOS disk number of drive to search
     
    909909        ; This is of course no problem since it is the MBR.
    910910    DriveIO_LocateMasterLVMSector_next:
     911        mov     si, offset [Scratch]    ; Use scratch area to load sectors
     912        call    ClearSectorBuffer       ; Clear the scratch area
    911913        clc                             ; Indicate Master LVM sector not found
    912914        jcxz    DriveIO_LocateMasterLVMSector_done
    913915
    914         ; Clear the sector buffer
    915         mov     bx, cx                  ; Save our precious sector LBA
    916         mov     cx, 100h                ; Clear 256 words is 512 bytes
    917         mov     di, offset [TmpSector]  ; Offset of buffer
    918         xor     ax, ax                  ; Value to sture
    919         cld                             ; Increment DI each time
    920         rep     stosw                   ; Store the value
    921         mov     cx, bx                  ; Restore our precious sector LBA
    922 
    923         ; Now read the LBA sector specified in CX
     916        ; Read the LBA sector specified in CX
    924917        mov     ax, cx                  ; LBA low
    925918        xor     bx, bx                  ; LBA high
    926         mov     di, ds                  ; Segment of temp buffer
    927         mov     si, offset [TmpSector]  ; Offset of temp buffer
     919        mov     di, ds                  ; Segment of scratch buffer
     920        mov     si, offset [Scratch]    ; Offset of scratch buffer
    928921        call    DriveIO_ReadSectorLBA   ; Read the sector
    929922        lahf                            ; Save CF
     
    944937        ; of the SPT value its OS/2 geometery specifies, which, in LBA terms
    945938        ; is LVM SPT-1 -- let's check that...
    946         mov     bx, offset [TmpSector]          ; Offset of the loaded LVM sector
     939        mov     bx, offset [Scratch]            ; Offset of the loaded LVM sector
    947940        mov     al, [bx+LocLVM_Secs]            ; Get the LVM SPT value (<=255)
    948941        dec     al                              ; Adjust to LVM LBA
     
    950943        inc     ah                              ; This one was found here
    951944        cmp     al, ah                          ; If same, LVM LBA location OK
    952         call    DEBUG_DumpRegisters
    953945        jne     DriveIO_LocateMasterLVMSector_next
    954946
Note: See TracChangeset for help on using the changeset viewer.