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


Ignore:
Timestamp:
Dec 21, 2014, 5:37:53 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • SerDrive: Using named pipe mode (serdrive -p) now works under Windows XP/2000/Server 2003.
  • checksum.pl: Added a compatibility fix for 3Com 3C503 cards.
  • XTIDECFG will now scan every possible segment address to find and load the BIOS and/or its settings from EEPROM. This should simplify things for people using combined option ROMs.
  • Fixed a bug from r521 in BootSector.asm where the BIOS would not display a timeout error if it failed to load the boot sector from harddrive.
  • Fixed a bug from r541 in CompatibleDPT.asm where CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI would generate an invalid checksum in the DPTE.
  • Optimizations and other fixes.
Location:
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs
Files:
4 edited

Legend:

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

    r567 r568  
    5858
    5959%ifdef USE_UNDOC_INTEL
    60     eSALC   ; Clears AL using CF while preserving flags
     60    salc    ; Clears AL using CF while preserving flags
    6161%endif
    6262
     
    163163;--------------------------------------------------------------------
    164164AccessDPT_GetIdevarsToCSBX:
    165     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]
     165    eMOVZX  bx, [di+DPT.bIdevarsOffset]
    166166    ret
    167167
    168 
    169 ;--------------------------------------------------------------------
    170 ; ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
    171 ;   Parameters:
    172 ;       DS:DI:  Ptr to Disk Parameter Table
    173 ;   Returns:
    174 ;       AX:     Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)
    175 ;               unshifted (still shifted where it is in bFlagsLow)
    176 ;       ZF:     Set based on value in AL
    177 ;   Corrupts registers:
    178 ;       Nothing
    179 ;--------------------------------------------------------------------
    180 ;
    181 ; Converted to a macro since only called in two places, and the call/ret overhead
    182 ; is not worth it for these two instructions (4 bytes total)
    183 ;
    184 %macro ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 0
    185     mov     al, [di+DPT.bFlagsLow]
    186     and     ax, BYTE MASKL_DPT_TRANSLATEMODE
    187 %endmacro
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r567 r568  
    142142; GetSectorCountToDXAXfromCHSinAXBLBH
    143143;   Parameters:
    144 ;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    145144;       AX:     Number of cylinders (1...16383)
    146145;       BL:     Number of heads (1...255)
     
    328327    cmp     ax, cx
    329328    jbe     SHORT .NumberOfHeadsNowInCX
    330     eSHL_IM cl, 1                       ; Double number of heads
    331     jnz     SHORT .CompareNextValidNumberOfHeads    ; Reached 256 heads?
    332     dec     cl                          ;  If so, limit heads to 255
     329    eSHL_IM cx, 1                       ; Double number of heads
     330    jpo     SHORT .CompareNextValidNumberOfHeads    ; Reached 256 heads?
     331    dec     cx                          ;  If so, limit heads to 255
    333332.NumberOfHeadsNowInCX:
    334333    mov     bx, cx                      ; Number of heads are returned in BL
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm

    r558 r568  
    114114;--------------------------------------------------------------------
    115115FillTranslatedDPTtoESDIfromDPTinDSSI:
    116     xor     dx, dx                      ; Clear for checksum
     116    cwd                                 ; Clear for checksum
    117117    call    StoswThenAddALandAHtoDL     ; Bytes 0 and 1 (Logical number of cylinders)
    118118
    119     mov     al, BYTE [si+DPT.bLchsHeads]
     119    mov     al, [si+DPT.bLchsHeads]
    120120    mov     ah, TRANSLATED_DPT_SIGNATURE
    121121    call    StoswThenAddALandAHtoDL     ; Bytes 2 (Logical number of heads) and 3 (Axh signature to indicate Translated DPT)
    122122
    123     eMOVZX  ax, BYTE [si+DPT.bPchsSectorsPerTrack]
     123    eMOVZX  ax, [si+DPT.bPchsSectorsPerTrack]
    124124    call    StoswThenAddALandAHtoDL     ; Bytes 4 (Physical sectors per track) and 5 (Write Precompensation Cylinder low)
    125125
    126     mov     al, ah
    127     call    StoswThenAddALandAHtoDL     ; Bytes 6 (Write Precompensation Cylinder high) and 7
    128 
    129     xchg    ax, cx                      ; Device Control byte to AL
     126    mov     al, ah                      ; Zero AX
     127    stosw                               ; Bytes 6 (Write Precompensation Cylinder high) and 7
     128
     129    xchg    cx, ax                      ; Device Control byte to AL, zero to CX
    130130    mov     ah, [si+DPT.wPchsCylinders]
    131131    call    StoswThenAddALandAHtoDL     ; Bytes 8 (Drive Control Byte) and 9 (Physical number of cylinders low)
     
    135135    call    StoswThenAddALandAHtoDL     ; Bytes 10 (Physical number of cylinders high) and 11 (Physical number of heads)
    136136
    137     xor     ax, ax
    138     call    StoswThenAddALandAHtoDL     ; Bytes 12 and 13 (Landing Zone Cylinder)
     137    xchg    cx, ax                      ; Zero to AX
     138    stosw                               ; Bytes 12 and 13 (Landing Zone Cylinder)
    139139
    140140    mov     al, [si+DPT.bLchsSectorsPerTrack]
     
    158158;       DI:     Incremented by 2
    159159;   Corrupts registers:
    160 ;       Nothing
     160;       AH
    161161;--------------------------------------------------------------------
    162162StoswALandChecksumFromDL:
     
    182182FillStandardDPTtoESDIfromDPTinDSSI:
    183183    stosw               ; Bytes 0 and 1 (Physical number of cylinders)
    184     eMOVZX  ax, BYTE [si+DPT.bLchsHeads]
     184    eMOVZX  ax, [si+DPT.bLchsHeads]
    185185    stosw               ; Bytes 2 (Physical number of heads) and 3
     186%ifdef USE_UNDOC_INTEL
     187%ifdef USE_386
     188    xor     al, al      ; Zero AX and clear CF
     189%else
     190    salc                ; Zero AX (CF cleared by eMOVZX above)
     191%endif
     192%else
    186193    mov     al, ah      ; Zero AX
     194%endif
    187195    stosw               ; Bytes 4 and 5 (Write Precompensation Cylinder low)
    188196    stosw               ; Bytes 6 (Write Precompensation Cylinder high) and 7
    189197    mov     al, cl      ; Device control byte to AL
    190198    stosw               ; Bytes 8 (Drive Control Byte) and 9
     199%ifdef USE_UNDOC_INTEL
     200    salc                ; Zero AX (CF cleared above)
     201%else
    191202    mov     al, ah      ; Zero AX
     203%endif
    192204    stosw               ; Bytes 10 and 11
    193205    stosw               ; Bytes 12 and 13 (Landing Zone Cylinder)
     
    208220;       ES:BX:  Ptr to Device Parameter Table Extension (DPTE)
    209221;   Corrupts registers:
    210 ;       AX, CX, DX, DI
     222;       AX, CX, DL, DI
    211223;--------------------------------------------------------------------
    212224CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI:
    213     call    GetTemporaryBufferForDPTEtoESDI ; valid until next AH=48h call
     225    call    GetTemporaryBufferForDPTEtoESDI ; Valid until next AH=48h call
    214226
    215227    ; Set 32-bit flag for 32-bit controllers
     
    218230    eCMOVE  cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE
    219231
     232    xor     dl, dl                          ; Clear DL for checksum
     233
    220234    ; DPTE.wBasePort
    221235    mov     ax, [si+DPT.wBasePort]
     
    223237
    224238    ; DPTE.wControlBlockPort
    225     eMOVZX  bx, BYTE [si+DPT.bIdevarsOffset]
     239    eMOVZX  bx, [si+DPT.bIdevarsOffset]
    226240    mov     ax, [cs:bx+IDEVARS.wControlBlockPort]
    227241    call    StoswThenAddALandAHtoDL         ; Bytes 2 and 3
     
    244258    ; DPTE.bDmaChannelAndType and DPTE.bPioMode
    245259    xor     ax, ax
    246 %ifdef MODULE_ADVANCED_ATA
     260%ifndef MODULE_ADVANCED_ATA
     261    stosw                                   ; Bytes 8 and 9
     262%else
    247263    or      ah, [si+DPT_ADVANCED_ATA.bPioMode]
    248264    jz      SHORT .DoNotSetFastPioFlag
    249     cmp     WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0
    250     je      SHORT .DoNotSetFastPioFlag
    251     inc     cx      ; FLG_FAST_PIO_ENABLED
     265    cmp     WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 1
     266    sbb     cl, -1  ; FLG_FAST_PIO_ENABLED (if .wControllerID > 0)
    252267.DoNotSetFastPioFlag:
    253 %endif
    254268    call    StoswThenAddALandAHtoDL         ; Bytes 8 and 9
     269%endif
    255270
    256271    ; Set CHS translation flags and store DPTE.wFlags
     
    261276    test    al, FLGL_DPT_ASSISTED_LBA
    262277    jz      SHORT .NoChsTranslationOrBitShiftTranslationSet
    263     or      cx, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION
     278    or      ch, LBA_ASSISTED_TRANSLATION << (TRANSLATION_TYPE_FIELD_POSITION - 8)
    264279.NoChsTranslationOrBitShiftTranslationSet:
    265280    xchg    ax, cx
     
    268283    ; DPTE.wReserved (must be zero)
    269284    xor     ax, ax
    270     call    StoswThenAddALandAHtoDL         ; Bytes 12 and 13
     285    stosw                                   ; Bytes 12 and 13
    271286
    272287    ; DPTE.bRevision and DPTE.bChecksum
    273288    mov     al, DPTE_REVISION
    274     call    StoswALandChecksumFromDL        ; Bytes 14 and 15
    275     lea     bx, [di-DPTE_size]
    276     ret
     289    lea     bx, [di+2-DPTE_size]            ; The +2 compensates for the last WORD yet to be stored
     290    jmp     StoswALandChecksumFromDL        ; Bytes 14 and 15
    277291%endif ; MODULE_EBIOS
    278292
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r567 r568  
    116116    jnz     SHORT .NothingToChange
    117117
    118 .LimitHeadsForLargeAddressingMode:
    119118    ; We cannot have 16 P-Heads heads in Revised ECHS mode (8193 or more cylinders)
    120119    ; but 16 heads are allowed when there are 8192 or less cylinders (ECHS).
    121120    ; Both of these are LARGE modes so do not confuse with NORMAL mode.
    122121    call    AtaGeometry_IsDriveSmallEnoughForECHS
    123     jc      SHORT .NothingToChange
    124     dec     bx                      ; Adjust 16 P-Heads to 15
     122    adc     bx, -1                  ; Adjust 16 P-Heads to 15 if needed
    125123
    126124.NothingToChange:
Note: See TracChangeset for help on using the changeset viewer.