Changeset 433 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


Ignore:
Timestamp:
Jun 19, 2012, 4:24:36 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Cleaned AH=00h a bit.
Location:
trunk/XTIDE_Universal_BIOS
Files:
4 edited

Legend:

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

    r417 r433  
    4242    .bLastTimeoutUpdate resb    1
    4343
    44     .wDrvCntAndFirst:
     44    .wFirstDrvAndCount:
    4545    .bFirstDrv          resb    1   ; Number of first drive for this BIOS
    4646    .wDrvCntAndFlopCnt:             ; Both the hard disk and floppy counts in one word
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r376 r433  
    3838;--------------------------------------------------------------------
    3939AH0h_HandlerForDiskControllerReset:
    40     eMOVZX  bx, dl                      ; Copy requested drive to BL, zero BH to assume no errors
    41     call    ResetFloppyDrivesWithInt40h
     40    ; Reset Floppy Drives with INT 40h
     41    xor     bx, bx                      ; Zero BH to assume no errors
     42    or      bl, dl                      ; Copy requested drive to BL
     43    eCMOVS  dl, bh                      ; Reset Floppy Drive 00h since DL has Hard Drive number
     44
     45    xor     ah, ah                      ; Disk Controller Reset
     46    int     BIOS_DISKETTE_INTERRUPT_40h
     47    call    BackupErrorCodeFromTheRequestedDriveToBH
     48    ; We do not reset Hard Drives if DL was 0xh on entry
     49
    4250
    4351%ifdef MODULE_SERIAL_FLOPPY
     
    6169%endif
    6270
     71    ; Reset foreign Hard Drives (those handled by other BIOSes)
    6372    test    bl, bl                                      ; If we were called with a floppy disk, then we are done,
    6473    jns     SHORT .SkipHardDiskReset                    ; don't do hard disks.
    65 
    6674    call    ResetForeignHardDisks
    6775
     
    8088
    8189;--------------------------------------------------------------------
    82 ; ResetFloppyDrivesWithInt40h
    83 ;   Parameters:
    84 ;       BL:     Requested drive (DL when entering AH=00h)
    85 ;   Returns:
    86 ;       BH:     Error code from requested drive (if available)
    87 ;   Corrupts registers:
    88 ;       AX, DL, DI
    89 ;--------------------------------------------------------------------
    90 ResetFloppyDrivesWithInt40h:
    91     call    GetDriveNumberForForeignHardDiskHandlerToDL
    92     and     dl, 7Fh                     ; Clear hard disk bit
    93     xor     ah, ah                      ; Disk Controller Reset
    94     int     BIOS_DISKETTE_INTERRUPT_40h
    95     jmp     SHORT BackupErrorCodeFromTheRequestedDriveToBH
    96 
    97 
    98 ;--------------------------------------------------------------------
    9990; ResetForeignHardDisks
    10091;   Parameters:
     
    10495;       BH:     Error code from requested drive (if available)
    10596;   Corrupts registers:
    106 ;       AX, DL, DI
     97;       AX, DL
    10798;--------------------------------------------------------------------
    10899ResetForeignHardDisks:
    109     call    GetDriveNumberForForeignHardDiskHandlerToDL
    110     xor     ah, ah                      ; Disk Controller Reset
     100    ; If there are drives after our drives, those are already reset
     101    ; since our INT 13h was called by some other BIOS.
     102    ; We only need to reset drives from the previous INT 13h handler.
     103    ; There could be more in chain but let the previous one handle them.
     104    mov     dl, 80h
     105    cmp     [RAMVARS.bFirstDrv], dl
     106    je      SHORT NoForeignDrivesToReset
     107
     108    xor     ah, ah                  ; Disk Controller Reset
    111109    call    Int13h_CallPreviousInt13hHandler
    112110;;; fall-through to BackupErrorCodeFromTheRequestedDriveToBH
     
    130128
    131129
    132 ;--------------------------------------------------------------------
    133 ; GetDriveNumberForForeignHardDiskHandlerToDL
    134 ;   Parameters:
    135 ;       BL:     Requested drive (DL when entering AH=00h)
    136 ;       DS:     RAMVARS segment
    137 ;   Returns:
    138 ;       DS:DI:  Ptr to DPT if our drive (or Null if foreign drive)
    139 ;       DL:     BL if foreign drive
    140 ;               80h if our drive
    141 ;--------------------------------------------------------------------
    142 GetDriveNumberForForeignHardDiskHandlerToDL:
    143     mov     dl, bl
    144     test    di, di
    145     jz      SHORT .Return
    146     mov     dl, 80h             ; First possible Hard Disk should be safe value
    147 .Return:
    148     ret
    149130
     131; This defines what is called when resetting our drives at the end of drive detection.
    150132AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization equ ResetHardDisksHandledByOurBIOS.ErrorCodeNotUsed
    151133
     
    165147    xor     bl, bl                                      ; Assume Null IdevarsOffset for now, assuming foreign drive
    166148    test    di, di
    167     jz      .ErrorCodeNotUsed
     149    jz      SHORT .ErrorCodeNotUsed
    168150    mov     bl, [di+DPT.bIdevarsOffset]                 ; replace drive number with Idevars pointer for cmp with dl
    169151
     
    182164.loop:
    183165    call    FindDPT_ForIdevarsOffsetInDL                ; look for the first drive on this controller, if any
    184     jc      .notFound
     166    jc      SHORT .notFound
    185167
    186168    call    AHDh_ResetDrive                             ; reset master and slave on that controller
     
    192174
    193175.done:
     176NoForeignDrivesToReset:
    194177    ret
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r376 r433  
    4343; Check Our Hard Disks
    4444;
    45     mov     ax, [RAMVARS.wDrvCntAndFirst]       ; Drive count to AH, First number to AL
     45    mov     ax, [RAMVARS.wFirstDrvAndCount]     ; Drive count to AH, First number to AL
    4646    add     ah, al                              ; One past last drive to AH
    4747
     
    9797
    9898%ifdef MODULE_SERIAL_FLOPPY
    99     mov     ax, [RAMVARS.wDrvCntAndFirst]
     99    mov     ax, [RAMVARS.wFirstDrvAndCount]
    100100
    101101    test    dl, dl
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r417 r433  
    188188ALIGN JUMP_ALIGN
    189189RamVars_GetCountOfKnownDrivesToAX:
    190     mov     ax, [RAMVARS.wDrvCntAndFirst]
     190    mov     ax, [RAMVARS.wFirstDrvAndCount]
    191191    add     al, ah
    192192    and     ax, BYTE 7fh
Note: See TracChangeset for help on using the changeset viewer.