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

Fixed bug for new LVM sector load method [v1.1.1-testing]

Getting the LVM_SPT was done before DL was loaded with the correct
BIOS disk number. Fixed.

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

    r147 r149  
    437437;# EFFECTS  : Modifies DAP structure and fills or clears sector buffer
    438438;# ----------------------------------------------------------------------------
    439 ;# IN       : None   - Location info is in [CurPartition_Location]
    440 ;# ----------------------------------------------------------------------------
    441 ;# OUT      : CF=1   - failure, no valid LVM sector was loaded
    442 ;#          : SI     - Points to the sector buffer ([LVMSector])
     439;# IN       : MEM   - Location info is in [CurPartition_Location]
     440;# ----------------------------------------------------------------------------
     441;# OUT      : CF=1  - failure, no valid LVM sector was loaded
     442;#          : SI    - Points to the sector buffer ([LVMSector])
    443443;##############################################################################
    444444DriveIO_LoadLVMSector   Proc Near  Uses ax bx cx dx di
     
    463463        test    byte ptr [CFG_IgnoreLVM], 1     ; ZF=0 means ignore LVM
    464464        jnz     DIOLLVMS_NoLVMSector            ; Quit if so
    465 
    466         ; Calculate the entry in the DISKINFO array for this disk
    467         call    DriveIO_CalcDiskInfoPointer
    468 
    469         ; If the LVM_SPT is ZERO, no LVM info is present and we quit with CY
    470         mov     di, [bx+LocDISKINFO_LVM_Secs]   ; Get LVM_SPT
    471         test    di, di                          ; See if it is 0
    472         jz      DIOLLVMS_NoLVMSector            ; Quit if so
    473465
    474466        ; Load the location of the current partition being acted upon.
     
    485477        mov     cx, wptr cs:[CurPartition_Location+6]   ; BIOS cyl & sec
    486478
     479        ; Calculate the entry in the DISKINFO array for this disk,
     480        ; and put the LVM_SPT in DI
     481        push    bx
     482        call    DriveIO_CalcDiskInfoPointer
     483        mov     di, [bx+LocDISKINFO_LVM_Secs]
     484        pop     bx
     485
     486        ; If the LVM_SPT is ZERO, no LVM info is present and we quit with CY
     487        test    di, di                          ; See if it is 0
     488        jz      DIOLLVMS_NoLVMSector            ; Quit if so
     489
    487490        ; Adjust the location to point to the LVM sector
    488491        add     ax, di      ; Add the LVM sectors-per-track
     
    495498        mov     di, ds                          ; Segment of that buffer
    496499        call    DriveIO_ReadSectorLBA           ; Read the LVM sector
    497         jc      DIOLLVMS_NoLVMSector            ; Quit on error
    498 
    499         ; Check the validity of the LVM sector, quit with CY if invalid
    500         call    LVM_ValidateSector              ; Check signature and CRC
    501         jnc     DIOLLVMS_NoLVMSector            ; Quit if not valid
    502 
    503500
    504501IFDEF   AUX_DEBUG
    505502        IF 1
    506         DBG_TEXT_OUT_AUX    'CurPartition'
     503        DBG_TEXT_OUT_AUX    'LVMSecLoaded'
    507504        PUSHRF
    508505            call    DEBUG_DumpRegisters
     
    513510        ENDIF
    514511ENDIF
     512
     513        jc      DIOLLVMS_NoLVMSector            ; Quit on error
     514
     515        ; Check the validity of the LVM sector, quit with CY if invalid
     516        call    LVM_ValidateSector              ; Check signature and CRC
     517        jnc     DIOLLVMS_NoLVMSector            ; Quit if not valid
    515518
    516519        ; We're done, indicate success and return
Note: See TracChangeset for help on using the changeset viewer.