Changeset 543 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Apr 16, 2013, 11:41:49 AM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Compatible DPTs can no longer have more than 1024 cylinders.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r526 r543  
    2020; Section containing code
    2121SECTION .text
     22
    2223
    2324;--------------------------------------------------------------------
     
    101102AH8h_GetDriveParameters:
    102103    call    AccessDPT_GetLCHStoAXBLBH
    103 %ifdef RESERVE_DIAGNOSTIC_CYLINDER
    104     dec     ax
    105 %endif
    106     MIN_U   ax, MAX_LCHS_CYLINDERS
     104    call    AH8h_LimitAXtoMaximumLCylinders
    107105    ; Fall to .PackReturnValues
    108106
     
    141139    ret
    142140
     141
     142;--------------------------------------------------------------------
     143; AH8h_LimitAXtoMaximumLCylinders
     144;   Parameters:
     145;       AX:     Number of total L-CHS cylinders (1...1027)
     146;   Returns:
     147;       AX:     Number of usable L-CHS cylinders (1...1024)
     148;   Corrupts registers:
     149;       Nothing
     150;--------------------------------------------------------------------
     151AH8h_LimitAXtoMaximumLCylinders:
     152%ifdef RESERVE_DIAGNOSTIC_CYLINDER
     153    dec     ax
     154%endif
     155    MIN_U   ax, MAX_LCHS_CYLINDERS
     156    ret
     157
     158
    143159%ifdef MODULE_SERIAL_FLOPPY
    144160;
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm

    r542 r543  
    8989;--------------------------------------------------------------------
    9090FillToESDIusingDPTfromDSSI:
     91    mov     ax, [si+DPT.wLchsCylinders]
     92    call    AH8h_LimitAXtoMaximumLCylinders
    9193    test    BYTE [si+DPT.bFlagsLow], MASKL_DPT_TRANSLATEMODE
    9294    jz      SHORT FillStandardDPTtoESDIfromDPTinDSSI
     
    9698; FillTranslatedDPTtoESDIfromDPTinDSSI
    9799;   Parameters:
     100;       AX:     Number of Logical Cylinders
    98101;       CL:     Device Control Byte
    99102;       DS:SI:  Ptr to DPT
     
    106109FillTranslatedDPTtoESDIfromDPTinDSSI:
    107110    xor     dx, dx                      ; Clear for checksum
    108     mov     ax, [si+DPT.wLchsCylinders]
    109     ;MIN_U  ax, MAX_LCHS_CYLINDERS      ; Our DPT can have up to 1027
    110111    call    StoswThenAddALandAHtoDL     ; Bytes 0 and 1 (Logical number of cylinders)
    111112
     
    144145; FillStandardDPTtoESDIfromDPTinDSSI
    145146;   Parameters:
     147;       AX:     Number of Physical Cylinders == Number of Logical Cylinders
    146148;       CL:     Device Control Byte
    147149;       DS:SI:  Ptr to DPT
     
    153155;--------------------------------------------------------------------
    154156FillStandardDPTtoESDIfromDPTinDSSI:
    155     mov     ax, [si+DPT.wLchsCylinders]
    156157    stosw               ; Bytes 0 and 1 (Physical number of cylinders)
    157158    eMOVZX  ax, BYTE [si+DPT.bLchsHeads]
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r542 r543  
    144144    xchg    cx, ax
    145145    div     cx                              ; AX = new P-Cylinders
     146
     147    ; We could remove wPchsCylinders from DPT if we calculate it on AH=48h
     148    ; but that would require extra code so we save ROM space instead.
    146149    mov     [di+DPT.wPchsCylinders], ax
    147150
    148     ; Store CHS sector count as total sector count
     151    ; Store CHS sector count as total sector count. We must not use
     152    ; LBA sector count if it is 15,482,880 or less.
    149153    mul     cx
    150154    xor     bx, bx
    151     xor     cx, cx                          ; Clear LBA48 flag
    152     jmp     SHORT .StoreTotalSectorsFromBXDXAXandLBA48flagFromCL
     155    jmp     SHORT .StoreTotalSectorsFromBXDXAX
    153156    ; Fall to .StoreNumberOfLbaSectors
    154157
     
    167170    ; Store LBA 28/48 total sector count
    168171    call    AtaGeometry_GetLbaSectorCountToBXDXAXfromAtaInfoInESSI
    169 .StoreTotalSectorsFromBXDXAXandLBA48flagFromCL:
    170     or      [di+DPT.bFlagsLow], cl
     172    or      [di+DPT.bFlagsLow], cl      ; LBA48 flag
     173.StoreTotalSectorsFromBXDXAX:
    171174    mov     [di+DPT.twLbaSectors], ax
    172175    mov     [di+DPT.twLbaSectors+2], dx
Note: See TracChangeset for help on using the changeset viewer.