Changeset 421 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools


Ignore:
Timestamp:
May 9, 2012, 7:12:53 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Addressing modes are now NORMAL, LARGE and LBA.
  • L-CHS parameters are now generated differently for drives with 8192 or less cylinders.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools
Files:
2 edited

Legend:

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

    r376 r421  
    4747
    4848;---------------------------------------------------------------------
    49 ; Converts LCHS parameters to IDE P-CHS parameters.
     49; Converts LARGE addressing mode LCHS parameters to IDE P-CHS parameters.
    5050; PCylinder = (LCylinder << n) + (LHead / PHeadCount)
    5151; PHead     = LHead % PHeadCount
    5252; PSector   = LSector
    5353;
    54 ; Address_ConvertLCHStoPCHS:
     54; ConvertLargeModeLCHStoPCHS:
    5555;   Parameters:
    5656;       BL:     Sector number (1...63)
    57 ;       BH:     Head number (0...255)
     57;       BH:     Head number (0...239)
    5858;       CX:     Cylinder number (0...1023)
    5959;       DS:DI:  Ptr to Disk Parameter Table
     
    6666;--------------------------------------------------------------------
    6767ALIGN JUMP_ALIGN
    68 ConvertLCHStoPCHS:
     68ConvertLargeModeLCHStoPCHS:
    6969    ; LHead / PHeadCount and LHead % PHeadCount
    7070    eMOVZX  ax, bh                  ; Copy L-CHS Head number to AX
     
    8282DoNotConvertLCHS:
    8383    ret
     84
    8485
    8586;--------------------------------------------------------------------
     
    102103Address_OldInt13hAddressToIdeAddress:
    103104        call    Address_ExtractLCHSparametersFromOldInt13hAddress
     105        ACCESSDPT__GET_UNSHIFTED_ADDRESS_MODE_TO_AXZF
    104106
    105         AccessDPT_GetUnshiftedAddressModeToALZF
     107;;; 0: ADDRESSING_MODE_NORMAL
     108        jz      SHORT DoNotConvertLCHS
    106109
    107 ;;; 0: ADDR_DPT_LCHS
    108         jz      DoNotConvertLCHS
     110;;; 1: ADDRESSING_MODE_LARGE
     111        test    al, FLGL_DPT_ASSISTED_LBA
     112        jz      SHORT ConvertLargeModeLCHStoPCHS
    109113
    110 ;;; 1: ADDR_DPT_PCHS
    111         ;
    112         ; Since we are only checking for zero, we can do our math in the high order bits,
    113         ; in this case effectively subtracting 1 from the address mode.
    114         ;
    115         sub     al,(1<<ADDRESSING_MODE_FIELD_POSITION)
    116         jz      ConvertLCHStoPCHS
     114;;; 2: ADDRESSING_MODE_ASSISTED_LBA
     115        ; Fall through to ConvertAssistedLBAModeLCHStoLBARegisterValues
    117116
    118 ;;; 2: ADDR_DPT_LBA28 and 3: ADDR_DPT_LBA48
    119         ; Fall through to ConvertLCHStoLBARegisterValues
    120117
    121118;---------------------------------------------------------------------
     
    125122;
    126123; Returned address is in same registers that
    127 ; Address_DoNotConvertLCHS and Address_ConvertLCHStoPCHS returns.
     124; DoNotConvertLCHS and ConvertLargeModeLCHStoPCHS returns.
    128125;
    129 ; ConvertLCHStoLBARegisterValues:
     126; ConvertAssistedLBAModeLCHStoLBARegisterValues:
    130127;   Parameters:
    131128;       BL:     Sector number (1...63)
    132 ;       BH:     Head number (0...255)
     129;       BH:     Head number (0...254)
    133130;       CX:     Cylinder number (0...1023)
    134131;       DS:DI:  Ptr to Disk Parameter Table
     
    141138;       AX, DX
    142139;--------------------------------------------------------------------
    143 ALIGN JUMP_ALIGN
    144 ConvertLCHStoLBARegisterValues:
     140ConvertAssistedLBAModeLCHStoLBARegisterValues:
    145141    ; cylToSeek*headsPerCyl (18-bit result)
     142    ; Max = 1023 * 255 = 260,865 = 3FB01h
    146143    mov     ax, LBA_ASSIST_SPT      ; Load Sectors per Track
    147144    xchg    cx, ax                  ; Cylinder number to AX, Sectors per Track to CX
    148 
    149145%ifdef USE_386
    150     movzx   dx, [di+DPT.bLbaHeads]
     146    movzx   dx, [di+DPT.bLchsHeads]
    151147%else
    152148    cwd
    153     mov     dl, [di+DPT.bLbaHeads]
     149    mov     dl, [di+DPT.bLchsHeads]
    154150%endif
    155151    mul     dx                      ; DX:AX = cylToSeek*headsPerCyl
    156152
    157153    ; +=headToSeek (18-bit result)
     154    ; Max = 260,865 + 254 = 261,119 = 3FBFFh
    158155    add     al, bh                  ; Add Head number to DX:AX
    159156    adc     ah, dh                  ; DH = Zero after previous multiplication
     
    161158
    162159    ; *=sectPerTrack (18-bit by 6-bit multiplication with 24-bit result)
     160    ; Max = 261,119 * 63 = 16,450,497 = FB03C1h
    163161    xchg    ax, dx                  ; Hiword to AX, loword to DX
    164162    mul     cl                      ; AX = hiword * Sectors per Track
     
    169167
    170168    ; +=sectToSeek-1 (24-bit result)
     169    ; Max = 16,450,497 + 63 - 1 = 16,450,559 = FB03FFh
    171170    xor     bh, bh                  ; Sector number now in BX
    172171    dec     bx                      ; sectToSeek-=1
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r413 r421  
    5353    ; Get EBIOS command index to BX
    5454    ; LBA28 or LBA48 command
    55     cwd
    56     mov     al, [es:si+DAP.qwLBA+3] ; Load LBA48 byte 3 (bits 24...31)
    57     and     al, 0F0h                ; Clear LBA28 bits 24...27
    58     or      ax, [es:si+DAP.qwLBA+4] ; Set bits from LBA bytes 4 and 5
    59     cmp     dx, ax                  ; Set CF if any of bits 28...47 set
    60     rcl     dx, 1                   ; DX = 0 for LBA28, DX = 1 for LBA48
    6155    call    Prepare_GetOldInt13hCommandIndexToBX
    62     or      bx, dx                  ; Set block mode / single sector bit
     56    mov     al, [di+DPT.bFlagsLow]
     57    shl     al, 1                   ; Set CF if LBA48 supported
     58    adc     bl, bh                  ; LBA48 EXT commands
    6359    ret
    64 %endif
     60%endif ; MODULE_EBIOS
    6561
    6662
     
    116112;       Nothing
    117113;--------------------------------------------------------------------
    118 ALIGN JUMP_ALIGN
    119114Prepare_ByValidatingSectorsInALforOldInt13h:
    120115    test    al, al
Note: See TracChangeset for help on using the changeset viewer.