Changeset 533 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs


Ignore:
Timestamp:
Apr 3, 2013, 4:12:34 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • P-Cylinders returned by AH=48h are now calculated from L-CHS capacity when RESERVE_DIAGNOSTIC_CYLINDER is defined.
  • Total sector count returned by AH=48h is now always P-Cylinders * P-Heads * P-Sectors per track for drives with less than or equal 15,482,880 LBA sectors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r526 r533  
    118118    mov     [di+DPT.bPchsHeads], bl
    119119%ifdef MODULE_EBIOS
     120    mov     [di+DPT.bPchsSectorsPerTrack], bh
     121
     122%ifdef RESERVE_DIAGNOSTIC_CYLINDER
     123    ; Do not store P-Cylinders, instead calculate it from L-CHS total sector count.
     124    ; Read AH=48h_GetExtendedDriveParameters.asm for more info.
     125    xchg    ax, bx
     126    mul     ah
     127    push    ax                          ; P-Heads * P-Sectors per track
     128    call    AH15h_GetSectorCountToBXDXAX
     129    pop     bx
     130    div     bx                          ; AX = Calculated cylinders
     131%endif ; RESERVE_DIAGNOSTIC_CYLINDER
     132
    120133    mov     [di+DPT.wPchsCylinders], ax
    121     mov     [di+DPT.bPchsSectorsPerTrack], bh
    122134    ; Fall to .StoreNumberOfLbaSectors
    123135
     
    141153    call    StoreLba48AddressingFromCLandTotalSectorCountFromBXDXAX
    142154
     155    ; If we have 15,482,880 or less sectors, we multiply P-CHS values
     156    ; and use that as total sector count.
     157    ; Read AH=48h_GetExtendedDriveParameters.asm for more info.
     158    sub     ax, 4001h
     159    sbb     dx, 0ECh
     160    sbb     bx, BYTE 0
     161    jnc     SHORT .NoNeedToUseCHSsectorCount    ; More than EC4000h
     162
     163    mov     al, [di+DPT.bPchsHeads]
     164    mul     BYTE [di+DPT.bPchsSectorsPerTrack]
     165    mul     WORD [di+DPT.wPchsCylinders]
     166    xor     bx, bx
     167    call    StoreLba48AddressingFromCLandTotalSectorCountFromBXDXAX
     168
    143169    ; Load user defined LBA
     170.NoNeedToUseCHSsectorCount:
    144171    call    GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS
    145172    test    cl, FLG_DRVPARAMS_USERLBA
Note: See TracChangeset for help on using the changeset viewer.