Changeset 491 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE


Ignore:
Timestamp:
Dec 15, 2012, 2:46:29 PM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Added a new define (USE_UNDOC_INTEL) that enables optimizations possible by using undocumented instructions available on all Intel processors and truly compatible clones. AFAIK the only exceptions are the NEC V-series and the Sony CXQ70108 processors so this option should be safe for use on the AT builds.
  • Building BIOSDRVS or the BIOS without MODULE_STRINGS_COMPRESSED would fail due to the recent code exclusions so I changed them a bit. Also fixed the mistaken change to Main.asm
  • Changed the Tandy specific info in Configuration_FullMode.txt so it matches the info in the Wiki.
  • Optimizations and fixes in general.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device/IDE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm

    r486 r491  
    7474;--------------------------------------------------------------------
    7575TransferBlockToOrFromXTCF:
    76     ; 8-bit DMA transfers must be done withing 64k physical page.
     76    ; 8-bit DMA transfers must be done within 64k physical page.
    7777    ; XT-CF support maximum of 64 sector (32768 bytes) blocks in DMA mode
    7878    ; so we never need to separate transfer to more than 2 separate DMA operations.
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm

    r473 r491  
    5353IdeIO_InputToALfromIdeRegisterInDL:
    5454    xor     dh, dh  ; IDE Register index now in DX
    55 
     55    mov     bx, dx  ; and BX
    5656    mov     al, [di+DPT_ATA.bDevice]
    5757    cmp     al, DEVICE_8BIT_XTIDE_REV2
     
    6363
    6464.InputToALfromMemoryMappedRegisterInDX:
    65     mov     bx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
    66     add     bx, dx
    6765    push    ds
    6866    mov     ds, [di+DPT.wBasePort]  ; Segment for JR-IDE/ISA
    69     mov     al, [bx]
     67    mov     al, [bx+JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET]
    7068    pop     ds
    7169    ret
    7270
    7371.ReverseA0andA3fromRegisterIndexInDX:
    74     mov     bx, dx
    7572    mov     dl, [cs:bx+g_rgbSwapA0andA3fromIdeRegisterIndex]
    7673    SKIP2B  bx  ; Skip shl dx, 1
    7774
    7875.ShlRegisterIndexInDX:
    79     shl     dx, 1
     76    eSHL_IM dx, 1
    8077    ; Fall to .InputToALfromRegisterInDX
    8178
     
    116113.ShlRegisterIndexInDX:
    117114    add     dl, OFFSET_TO_CONTROL_BLOCK_REGISTERS
    118     shl     dx, 1
     115    eSHL_IM dx, 1
    119116    jmp     SHORT OutputALtoRegisterInDX
    120117
     
    164161
    165162.ShlRegisterIndexInDX:
    166     shl     dx, 1
     163    eSHL_IM dx, 1
    167164    ; Fall to OutputALtoRegisterInDX
    168165
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r480 r491  
    231231
    232232    ; Convert ES:SI to physical address
    233     xor     dx, dx
    234     mov     ax, es
     233%ifdef USE_186          ; Bytes EU Cycles(286)
     234    mov     ax, es      ; 2     2
     235    rol     ax, 4       ; 3     9
     236    mov     dx, ax      ; 2     2
     237    and     ax, BYTE 0Fh; 3     3
     238    xor     dx, ax      ; 2     2
     239    add     si, dx      ; 2     2
     240    adc     al, ah      ; 2     2
     241    mov     es, ax      ; 2     2
     242    ;------------------------------------
     243                        ; 18    24
     244%else ; 808x
     245
     246%if 0
     247                        ; Bytes EU Cycles(808x)
     248    mov     al, 4       ; 2     4
     249    mov     dx, es      ; 2     2
     250    xchg    cx, ax      ; 1     3
     251    rol     dx, cl      ; 2     24
     252    mov     cx, dx      ; 2     2
     253    xchg    cx, ax      ; 1     3
     254    and     ax, BYTE 0Fh; 3     4
     255    xor     dx, ax      ; 2     3
     256    add     si, dx      ; 2     3
     257    adc     al, ah      ; 2     3
     258    mov     es, ax      ; 2     2
     259    ;------------------------------------
     260                        ; 21    53
     261;
     262; Judging by the Execution Unit cycle count the above block of code is
     263; apparently slower. However, the shifts and rotates in the block below
     264; execute faster than the Bus Interface Unit on an 8088 can fetch them,
     265; thus causing the EU to starve. The difference in true execution speed
     266; (if any) might not be worth the extra 5 bytes.
     267; In other words, we could use a real world test here.
     268;
     269%endif ; 0
     270                        ; Bytes EU Cycles(808x/286)
     271    xor     dx, dx      ; 2     3/2
     272    mov     ax, es      ; 2     2/2
    235273%rep 4
    236     shl     ax, 1
    237     rcl     dx, 1
     274    shl     ax, 1       ; 8     8/8
     275    rcl     dx, 1       ; 8     8/8
    238276%endrep
    239     add     si, ax
    240     adc     dl, dh
    241     mov     es, dx
     277    add     si, ax      ; 2     3/2
     278    adc     dl, dh      ; 2     3/2
     279    mov     es, dx      ; 2     2/2
     280    ;------------------------------------
     281%endif                  ; 26    29/26
    242282    ret
    243283%endif ; MODULE_8BIT_IDE
     
    266306%ifdef MODULE_8BIT_IDE
    267307        dw      IdePioBlock_ReadFrom8bitDataPort    ; 2, DEVICE_8BIT_ATA
    268         dw      IdePioBlock_ReadFromXtideRev1       ; 3, DEVICE_8BIT_XTIDE_REV1     
     308        dw      IdePioBlock_ReadFromXtideRev1       ; 3, DEVICE_8BIT_XTIDE_REV1
    269309        dw      IdePioBlock_ReadFromXtideRev2       ; 4, DEVICE_8BIT_XTIDE_REV2
    270310        dw      IdePioBlock_ReadFrom8bitDataPort    ; 5, DEVICE_8BIT_XTCF_PIO8
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm

    r489 r491  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    9393;       AL, BX, CX, DX
    9494;--------------------------------------------------------------------
    95 .IdePollBsyAndFlgInAH:
     95PollBsyAndFlgInAH:
    9696    call    IdeIO_InputStatusRegisterToAL       ; Discard contents of first read
    9797
Note: See TracChangeset for help on using the changeset viewer.