Ignore:
Timestamp:
Dec 21, 2014, 5:37:53 PM (9 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.