Changeset 472 in xtideuniversalbios


Ignore:
Timestamp:
Oct 2, 2012, 6:28:46 PM (9 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Implemented AH=1Eh, XT-CF Features.
Location:
trunk/XTIDE_Universal_BIOS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc

    r471 r472  
    5858
    5959;--------------------------------------------------------------------
    60 ; IS_XTCF_IN_PORT_CX
    61 ;   Parameters:
    62 ;       CX:     Port to search XT-CF from (can be anything)
    63 ;   Returns:
    64 ;       AH:     RET_HD_SUCCESS if XT-CF is found from port
    65 ;               RET_HD_INVALID if XT-CF is not found
    66 ;--------------------------------------------------------------------
    67 IS_XTCF_IN_PORT_CX                  EQU     1
    68 
    69 ;--------------------------------------------------------------------
    7060; READ_XTCF_CONTROL_REGISTER_TO_DH
    7161;   Parameters:
     
    7464;       DH:     XT-CF Control Register contents
    7565;--------------------------------------------------------------------
    76 READ_XTCF_CONTROL_REGISTER_TO_DH    EQU     2
     66READ_XTCF_CONTROL_REGISTER_TO_DH    EQU     1
    7767
    7868;--------------------------------------------------------------------
     
    8272;       DL:     Drive Number
    8373;--------------------------------------------------------------------
    84 WRITE_DH_TO_XTCF_CONTROL_REGISTER   EQU     3
     74WRITE_DH_TO_XTCF_CONTROL_REGISTER   EQU     2
    8575
    8676
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r437 r472  
    2323
    2424; Base DPT for all device types
    25 struc DPT   ; 10 or 18 bytes
    26     ; General Disk Parameter Table related
     25struc DPT
     26    ; General Disk Parameter Table related (Bytes 0...3)
    2727    .wFlags:
    2828    .bFlagsLow              resb    1
     
    3131    .bInitError             resb    1   ; Flags for AH=09h initialization errors
    3232
    33     ; CHS variables
     33    ; CHS variables (Bytes 4...8)
    3434    .wLchsCylinders         resb    2   ; (1...1027, yes 1027)
    3535    .wLchsHeadsAndSectors:
     
    4343    .wPchsCylinders         resb    2
    4444    .twLbaSectors           resb    6   ; 48-bit sector count for LBA addressing
    45 %else
    46                             resb    1   ; Alignment
    4745%endif
     46
     47%ifdef MODULE_8BIT_IDE
     48    .wXTCFport              resb    2   ; Autodetected XT-CF port
     49%endif
     50                            alignb  2   ; WORD alignent for DPT_SERIAL or DPT_ATA
    4851endstruc
    4952
     
    115118    .wMinPioCycleTime       resb    2   ; Minimum PIO Cycle Time in ns
    116119    .bPioMode               resb    1   ; Best supported PIO mode
    117                             resb    1
     120                            alignb  2
    118121endstruc
    119122%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm

    r471 r472  
    3838;--------------------------------------------------------------------
    3939AH1Eh_HandlerForXTCFfeatures:
    40     eMOVZX  bx, al  ; Subcommand to BX
     40    xor     ah, ah      ; Subcommand now in AX
    4141%ifndef USE_186
    42     call    AH1Eh_ProcessXTCFsubcommandFromBX
     42    call    AH1Eh_ProcessXTCFsubcommandFromAX
    4343    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    4444%else
    4545    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    46     ; Fall to AH1Eh_ProcessXTCFsubcommandFromBX
     46    ; Fall to AH1Eh_ProcessXTCFsubcommandFromAX
    4747%endif
    4848
    4949
    5050;--------------------------------------------------------------------
    51 ; AH1Eh_ProcessXTCFsubcommandFromBX
     51; AH1Eh_ProcessXTCFsubcommandFromAX
    5252;   Parameters:
    53 ;       BX:     XT-CF subcommand (see XTCF.inc for more info)
     53;       AX:     XT-CF subcommand (see XTCF.inc for more info)
    5454;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    5555;       SS:BP:  Ptr to IDEPACK
     
    6060;       AL, BX, CX, DX
    6161;--------------------------------------------------------------------
    62 AH1Eh_ProcessXTCFsubcommandFromBX:
     62AH1Eh_ProcessXTCFsubcommandFromAX:
     63    ; IS_THIS_DRIVE_XTCF. We check this for all commands.
     64    dec     ax      ; Subcommand
     65    mov     dx, [di+DPT.wXTCFport]
     66    test    dx, dx  ; Never zero for XT-CF, Always zero for other devices
     67    jz      SHORT XTCFnotFound
     68
     69    ; READ_XTCF_CONTROL_REGISTER_TO_DH
     70    add     dl, XTCF_CONTROL_REGISTER   ; DX to Control Register
     71    dec     ax      ; Subcommand
     72    jnz     SHORT .SkipReadXtcfControlRegisterToDH
     73    in      al, dx
     74    mov     [bp+IDEPACK.intpack+INTPACK.dh], al
     75    jmp     SHORT .ReturnWithSuccess
     76.SkipReadXtcfControlRegisterToDH:
     77
     78    ; WRITE_DH_TO_XTCF_CONTROL_REGISTER
     79    dec     ax      ; Subcommand
     80    jnz     SHORT XTCFnotFound          ; Invalid subcommand
     81    mov     al, [bp+IDEPACK.intpack+INTPACK.dh]
     82    out     dx, al
     83.ReturnWithSuccess:
     84    xor     ah, ah
     85    ret
     86
     87
     88;--------------------------------------------------------------------
     89; AH1Eh_DetectXTCFwithBasePortInDX
     90;   Parameters:
     91;       DX:     Base I/O port address to check
     92;   Returns:
     93;       AH:     RET_HD_SUCCESS if XT-CF is found from port
     94;               RET_HD_INVALID if XT-CF is not found
     95;       CF:     Cleared if XT-CF found
     96;               Set if XT-CF not found
     97;   Corrupts registers:
     98;       AL, DX
     99;--------------------------------------------------------------------
     100AH1Eh_DetectXTCFwithBasePortInDX:
     101    add     dl, XTCT_CONTROL_REGISTER_INVERTED_in   ; set DX to XT-CF config register (inverted)
     102    in      al, dx      ; get value
     103    mov     ah, al      ; save in ah
     104    inc     dx          ; set DX to XT-CF config register (non-inverted)
     105    in      al, dx      ; get value
     106    not     al          ; invert it
     107    sub     ah, al      ; do they match? (clear AH if they do)
     108    jz      SHORT XTCFfound
     109
     110XTCFnotFound:
     111    stc                 ; set carry flag since XT-CF not found
     112    mov     ah, RET_HD_INVALID
     113XTCFfound:
     114    ret                 ; and return
Note: See TracChangeset for help on using the changeset viewer.