Changeset 442 in xtideuniversalbios


Ignore:
Timestamp:
Aug 21, 2012, 5:17:11 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • ATA ID validation now compares heads to correct maximum number of heads.
  • Added XTCF 8-bit mode transfer functions.
Location:
trunk/XTIDE_Universal_BIOS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc

    r376 r442  
    2323
    2424;--------------------------------------------------------------------
     25; UNROLL_SECTORS_IN_CX_TO_DWORDS
    2526; UNROLL_SECTORS_IN_CX_TO_QWORDS
    2627;   Parameters:
    2728;       CX:     Number of sectors in block
    2829;   Returns:
    29 ;       CX:     Number of QWORDs in block
     30;       CX:     Number of DWORDs or QWORDs in block
    3031;   Corrupts registers:
    3132;       Nothing
    3233;--------------------------------------------------------------------
     34%macro UNROLL_SECTORS_IN_CX_TO_DWORDS 0
     35%ifdef USE_186
     36    shl     cx, 7
     37%else
     38    xchg    cl, ch      ; Sectors to WORDs (SHL CX, 8)
     39    shr     cx, 1
     40%endif
     41%endmacro
     42
    3343%macro UNROLL_SECTORS_IN_CX_TO_QWORDS 0
    3444%ifdef USE_186
    3545    shl     cx, 6
    3646%else
    37     xchg    cl, ch      ; Sectors to WORDs (SHL CX, 8)
    38     shr     cx, 1
     47    UNROLL_SECTORS_IN_CX_TO_DWORDS
    3948    shr     cx, 1
    4049%endif
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r439 r442  
    7575
    7676    ; Wait until drive motors have reached max speed
    77     cmp     bp, BYTE ROMVARS.ideVars0
     77    cmp     bp, BYTE ROMVARS.ideVars0       ; First controller?
    7878    jne     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    79     test    bh, FLG_DRVNHEAD_DRV
     79    test    bh, FLG_DRVNHEAD_DRV            ; Wait already done for Master
    8080    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    8181    call    AHDh_WaitUnilDriveMotorHasReachedFullSpeed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r421 r442  
    273273%endif
    274274
     275;--------------------------------------------------------------------
     276ALIGN JUMP_ALIGN
     277ReadBlockFromXTCF:
     278    UNROLL_SECTORS_IN_CX_TO_DWORDS
     279ALIGN JUMP_ALIGN
     280.ReadNextDword:
     281    in      al, dx      ; Read 1st BYTE
     282    stosb               ; Store 1st BYTE to [ES:DI]
     283    in      al, dx
     284    stosb
     285
     286    in      al, dx
     287    stosb
     288    in      al, dx
     289    stosb
     290    loop    .ReadNextDword
     291    ret
     292
    275293%endif  ; MODULE_8BIT_IDE
    276294
     
    352370;--------------------------------------------------------------------
    353371ALIGN JUMP_ALIGN
    354 WriteBlockToFastXtide:
    355     UNROLL_SECTORS_IN_CX_TO_QWORDS
     372WriteBlockToXTCF:
     373    UNROLL_SECTORS_IN_CX_TO_DWORDS
    356374    push    ds
    357375    push    es
    358376    pop     ds
    359     or      dl, (1<<4)  ; Writes need A4 set
    360 ALIGN JUMP_ALIGN
    361 .ReadNextQword:
    362     lodsw               ; Load 1st WORD from [DS:SI]
    363     out     dx, ax      ; Write 1st WORD
    364     lodsw
    365     out     dx, ax      ; 2nd
    366     lodsw
    367     out     dx, ax      ; 3rd
    368     lodsw
    369     out     dx, ax      ; 4th
    370     loop    .ReadNextQword
     377ALIGN JUMP_ALIGN
     378.WriteNextDword:
     379    lodsb               ; Load 1st BYTE from [DS:SI]
     380    out     dx, al      ; Write 1st BYTE
     381    lodsb
     382    out     dx, al
     383
     384    lodsb
     385    out     dx, al
     386    lodsb
     387    out     dx, al
     388    loop    .WriteNextDword
    371389    pop     ds
    372390    ret
     
    404422%ifdef MODULE_8BIT_IDE
    405423        dw      0                           ; 0, DEVICE_8BIT_JRIDE_ISA
     424        dw      ReadBlockFromXTCF           ; 1, DEVICE_8BIT_XTCF
    406425    %ifdef USE_186
    407         dw      ReadBlockFrom16bitDataPort  ; 1, DEVICE_FAST_XTIDE
    408426        dw      ReadBlockFrom16bitDataPort  ; 2, DEVICE_8BIT_XTIDE_REV2
    409427    %else
    410         dw      ReadBlockFromXtideRev2      ; 1, DEVICE_FAST_XTIDE
    411428        dw      ReadBlockFromXtideRev2      ; 2, DEVICE_8BIT_XTIDE_REV2
    412429    %endif
     
    425442%ifdef MODULE_8BIT_IDE
    426443        dw      0                           ; 0, DEVICE_8BIT_JRIDE_ISA
    427         dw      WriteBlockToFastXtide       ; 1, DEVICE_FAST_XTIDE
     444        dw      WriteBlockToXTCF            ; 1, DEVICE_8BIT_XTCF
    428445        dw      WriteBlockToXtideRev2       ; 2, DEVICE_XTIDE_REV2
    429446        dw      WriteBlockToXtideRev1       ; 3, DEVICE_XTIDE_REV1
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r441 r442  
    4545
    4646    add     bx, BYTE ATA1.wHeadCnt - ATA1.wCylCnt
    47     mov     cl, MAX_VALID_PCHS_HEADS
     47    mov     cx, MAX_VALID_PCHS_HEADS
    4848    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
    4949
     
    9696    jbe     SHORT .ValidPCHorSinOffsetBX
    9797.InvalidPCHorSinOffsetBX:
    98     add     sp, 2           ; Clear return address for this function
     98    add     sp, BYTE 2      ; Clear return address for this function
    9999.FailedToVerifyAtaID:
    100100    stc                     ; Set carry to indicate invalid ATA-ID
Note: See TracChangeset for help on using the changeset viewer.