Ignore:
Timestamp:
Apr 29, 2011, 7:04:13 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Redesigned Disk Parameter Tables.
  • Code generalizations for supporting non-IDE devices in the future.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r148 r150  
    1313;               If bit 7 is set all hard disks and floppy disks reset.
    1414;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    15 ;       SS:BP:  Ptr to INTPACK
    16 ;   Returns with INTPACK in SS:BP:
     15;       SS:BP:  Ptr to IDEPACK
     16;   Returns with INTPACK:
    1717;       AH:     Int 13h return status (from drive requested in DL)
    1818;       CF:     0 if succesfull, 1 if error
     
    8989
    9090;--------------------------------------------------------------------
    91 ; ResetHardDisksHandledByOurBIOS
     91; AH0h_ResetHardDisksHandledByOurBIOS
    9292;   Parameters:
    9393;       BL:     Requested drive (DL when entering AH=00h)
    9494;       DS:     RAMVARS segment
     95;       SS:BP:  Ptr to IDEPACK
    9596;   Returns:
    9697;       BH:     Error code from requested drive (if available)
    9798;   Corrupts registers:
    98 ;       AX, CX, DX, DI
     99;       AX, CX, DX, SI, DI
    99100;--------------------------------------------------------------------
    100101ALIGN JUMP_ALIGN
     
    103104    test    dh, dh
    104105    jz      SHORT .AllDrivesReset       ; Return if no drives
    105     mov     dl, [RAMVARS.bFirstDrv]     ; Load number of first our drive
     106    mov     dl, [RAMVARS.bFirstDrv]     ; Load number of our first drive
    106107    add     dh, dl                      ; DH = one past last drive to reset
    107108ALIGN JUMP_ALIGN
     
    132133.BackupErrorCodeFromMasterOrSlaveToBH:
    133134    call    BackupErrorCodeFromTheRequestedDriveToBH
    134     mov     cx, [RAMVARS.wIdeBase]      ; Load base port for resetted drive
    135 
     135    call    GetBasePortToCX             ; Load base port for resetted drive
     136    push    cx
    136137    inc     dx                          ; DL to next drive
    137     call    FindDPT_ForDriveNumber      ; Get DPT to DS:DI, store port to RAMVARS
    138     jnc     SHORT .NoMoreDrivesOrNoSlaveDrive
    139     cmp     cx, [RAMVARS.wIdeBase]      ; Next drive is from same controller?
     138    call    GetBasePortToCX
     139    pop     di
     140    cmp     cx, di                      ; Next drive is from same controller?
    140141    je      SHORT BackupErrorCodeFromTheRequestedDriveToBH
    141142.NoMoreDrivesOrNoSlaveDrive:
    142143    dec     dx
     144    ret
     145
     146;--------------------------------------------------------------------
     147; GetBasePortToCX
     148;   Parameters:
     149;       DL:     Drive number
     150;       DS:     RAMVARS segment
     151;   Returns:
     152;       CX:     Base port address
     153;       CF:     Set if valid drive number
     154;               Cleared if invalid drive number
     155;   Corrupts registers:
     156;       DI
     157;--------------------------------------------------------------------
     158ALIGN JUMP_ALIGN
     159GetBasePortToCX:
     160    xchg    cx, bx
     161    xor     bx, bx
     162    call    FindDPT_ForDriveNumber
     163    jnc     SHORT .DptNotFound
     164    mov     bl, [di+DPT.bIdevarsOffset]
     165    mov     bx, [cs:bx+IDEVARS.wPort]
     166.DptNotFound:
     167    xchg    bx, cx
    143168    ret
    144169
Note: See TracChangeset for help on using the changeset viewer.