Changeset 433 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Jun 19, 2012, 4:24:36 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r376 r433 38 38 ;-------------------------------------------------------------------- 39 39 AH0h_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 42 50 43 51 %ifdef MODULE_SERIAL_FLOPPY … … 61 69 %endif 62 70 71 ; Reset foreign Hard Drives (those handled by other BIOSes) 63 72 test bl, bl ; If we were called with a floppy disk, then we are done, 64 73 jns SHORT .SkipHardDiskReset ; don't do hard disks. 65 66 74 call ResetForeignHardDisks 67 75 … … 80 88 81 89 ;-------------------------------------------------------------------- 82 ; ResetFloppyDrivesWithInt40h83 ; 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, DI89 ;--------------------------------------------------------------------90 ResetFloppyDrivesWithInt40h:91 call GetDriveNumberForForeignHardDiskHandlerToDL92 and dl, 7Fh ; Clear hard disk bit93 xor ah, ah ; Disk Controller Reset94 int BIOS_DISKETTE_INTERRUPT_40h95 jmp SHORT BackupErrorCodeFromTheRequestedDriveToBH96 97 98 ;--------------------------------------------------------------------99 90 ; ResetForeignHardDisks 100 91 ; Parameters: … … 104 95 ; BH: Error code from requested drive (if available) 105 96 ; Corrupts registers: 106 ; AX, DL , DI97 ; AX, DL 107 98 ;-------------------------------------------------------------------- 108 99 ResetForeignHardDisks: 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 111 109 call Int13h_CallPreviousInt13hHandler 112 110 ;;; fall-through to BackupErrorCodeFromTheRequestedDriveToBH … … 130 128 131 129 132 ;--------------------------------------------------------------------133 ; GetDriveNumberForForeignHardDiskHandlerToDL134 ; Parameters:135 ; BL: Requested drive (DL when entering AH=00h)136 ; DS: RAMVARS segment137 ; Returns:138 ; DS:DI: Ptr to DPT if our drive (or Null if foreign drive)139 ; DL: BL if foreign drive140 ; 80h if our drive141 ;--------------------------------------------------------------------142 GetDriveNumberForForeignHardDiskHandlerToDL:143 mov dl, bl144 test di, di145 jz SHORT .Return146 mov dl, 80h ; First possible Hard Disk should be safe value147 .Return:148 ret149 130 131 ; This defines what is called when resetting our drives at the end of drive detection. 150 132 AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization equ ResetHardDisksHandledByOurBIOS.ErrorCodeNotUsed 151 133 … … 165 147 xor bl, bl ; Assume Null IdevarsOffset for now, assuming foreign drive 166 148 test di, di 167 jz .ErrorCodeNotUsed149 jz SHORT .ErrorCodeNotUsed 168 150 mov bl, [di+DPT.bIdevarsOffset] ; replace drive number with Idevars pointer for cmp with dl 169 151 … … 182 164 .loop: 183 165 call FindDPT_ForIdevarsOffsetInDL ; look for the first drive on this controller, if any 184 jc .notFound166 jc SHORT .notFound 185 167 186 168 call AHDh_ResetDrive ; reset master and slave on that controller … … 192 174 193 175 .done: 176 NoForeignDrivesToReset: 194 177 ret
Note:
See TracChangeset
for help on using the changeset viewer.