Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
- Timestamp:
- Apr 29, 2011, 7:04:13 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r148 r150 22 22 Int13h_DiskFunctionsHandler: 23 23 sti ; Enable interrupts 24 SAVE_AND_GET_INTPACK_TO_SSBP 24 cld ; String instructions to increment pointers 25 SAVE_AND_GET_INTPACK_WITH_EXTRA_WORDS_TO_SSBP EXTRA_WORDS_TO_RESERVE_FOR_INTPACK 25 26 26 27 call RamVars_GetSegmentToDS … … 46 47 ; DL: Translated drive number 47 48 ; DS: RAMVARS segment 48 ; SS:BP: Ptr to I NTPACK49 ; SS:BP: Ptr to IDEPACK 49 50 ; BX, DI: Corrupted on Int13h_DiskFunctionsHandler 50 51 ; Other: Function specific INT 13h parameters … … 58 59 Int13h_DirectCallToAnotherBios: 59 60 call ExchangeCurrentInt13hHandlerWithOldInt13hHandler 60 mov bx, [bp+I NTPACK.bx]61 mov di, [bp+I NTPACK.di]62 mov ds, [bp+I NTPACK.ds]63 push WORD [bp+I NTPACK.flags]61 mov bx, [bp+IDEPACK.intpack+INTPACK.bx] 62 mov di, [bp+IDEPACK.intpack+INTPACK.di] 63 mov ds, [bp+IDEPACK.intpack+INTPACK.ds] 64 push WORD [bp+IDEPACK.intpack+INTPACK.flags] 64 65 popf 65 66 push bp 66 mov bp, [bp+I NTPACK.bp]67 mov bp, [bp+IDEPACK.intpack+INTPACK.bp] 67 68 int BIOS_DISK_INTERRUPT_13h ; Can safely do as much recursion as it wants 68 69 … … 70 71 pop bp ; Standard INT 13h functions never uses BP as return register 71 72 %ifdef USE_386 72 mov [bp+I NTPACK.gs], gs73 mov [bp+I NTPACK.fs], fs73 mov [bp+IDEPACK.intpack+INTPACK.gs], gs 74 mov [bp+IDEPACK.intpack+INTPACK.fs], fs 74 75 %endif 75 mov [bp+I NTPACK.es], es76 mov [bp+I NTPACK.ds], ds77 mov [bp+I NTPACK.di], di78 mov [bp+I NTPACK.si], si79 mov [bp+I NTPACK.bx], bx80 mov [bp+I NTPACK.dh], dh81 mov [bp+I NTPACK.cx], cx82 mov [bp+I NTPACK.ax], ax76 mov [bp+IDEPACK.intpack+INTPACK.es], es 77 mov [bp+IDEPACK.intpack+INTPACK.ds], ds 78 mov [bp+IDEPACK.intpack+INTPACK.di], di 79 mov [bp+IDEPACK.intpack+INTPACK.si], si 80 mov [bp+IDEPACK.intpack+INTPACK.bx], bx 81 mov [bp+IDEPACK.intpack+INTPACK.dh], dh 82 mov [bp+IDEPACK.intpack+INTPACK.cx], cx 83 mov [bp+IDEPACK.intpack+INTPACK.ax], ax 83 84 pushf 84 pop WORD [bp+I NTPACK.flags]85 pop WORD [bp+IDEPACK.intpack+INTPACK.flags] 85 86 call RamVars_GetSegmentToDS 86 87 cmp dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv] 87 88 je SHORT .ExchangeInt13hHandlers 88 mov [bp+I NTPACK.dl], dl ; Something is returned in DL89 mov [bp+IDEPACK.intpack+INTPACK.dl], dl ; Something is returned in DL 89 90 ALIGN JUMP_ALIGN 90 91 .ExchangeInt13hHandlers: … … 98 99 ; Parameters: 99 100 ; AH: BIOS Error code 100 ; SS:BP: Ptr to I NTPACK101 ; SS:BP: Ptr to IDEPACK 101 102 ; Returns: 102 103 ; All registers are loaded from INTPACK … … 104 105 ALIGN JUMP_ALIGN 105 106 Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH: 106 call HError_SetErrorCodeToBdaAndToIntpackInSSBPfromAH107 call Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 107 108 Int13h_ReturnFromHandlerWithoutStoringErrorCode: 108 or WORD [bp+I NTPACK.flags], FLG_FLAGS_IF ; Return with interrupts enabled109 or WORD [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_IF ; Return with interrupts enabled 109 110 mov sp, bp ; Now we can exit anytime 110 RESTORE_INTPACK_ FROM_SSBP111 RESTORE_INTPACK_WITH_EXTRA_WORDS_FROM_SSBP EXTRA_WORDS_TO_RESERVE_FOR_INTPACK 111 112 112 113 … … 146 147 LOAD_BDA_SEGMENT_TO es, di 147 148 mov di, [RAMVARS.fpOldI13h] 149 cli 148 150 xchg di, [es:BIOS_DISK_INTERRUPT_13h*4] 149 151 mov [RAMVARS.fpOldI13h], di … … 152 154 mov [RAMVARS.fpOldI13h+2], di 153 155 pop es 156 sti 157 ret 158 159 160 ;-------------------------------------------------------------------- 161 ; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 162 ; Int13h_SetErrorCodeToIntpackInSSBPfromAH 163 ; Parameters: 164 ; AH: BIOS error code (00h = no error) 165 ; SS:BP: Ptr to IDEPACK 166 ; Returns: 167 ; SS:BP: Ptr to IDEPACK with error condition set 168 ; Corrupts registers: 169 ; DS, DI 170 ;-------------------------------------------------------------------- 171 ALIGN JUMP_ALIGN 172 Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH: 173 ; Store error code to BDA 174 LOAD_BDA_SEGMENT_TO ds, di 175 mov [BDA.bHDLastSt], ah 176 177 ; Store error code to INTPACK 178 Int13h_SetErrorCodeToIntpackInSSBPfromAH: 179 mov [bp+IDEPACK.intpack+INTPACK.ah], ah 180 test ah, ah 181 jnz SHORT .SetCFtoIntpack 182 and BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF 183 ret 184 .SetCFtoIntpack: 185 or BYTE [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_CF 154 186 ret 155 187 … … 224 256 ; dw Int13h_UnsupportedFunction ; 3Fh, 225 257 ; dw Int13h_UnsupportedFunction ; 40h, 226 ; dw Int13h_UnsupportedFunction ; 41h, Check if Extensions Present (EBIOS) 227 ; dw Int13h_UnsupportedFunction ; 42h, Extended Read Sectors (EBIOS) 228 ; dw Int13h_UnsupportedFunction ; 43h, Extended Write Sectors (EBIOS) 229 ; dw Int13h_UnsupportedFunction ; 44h, Extended Verify Sectors (EBIOS) 230 ; dw Int13h_UnsupportedFunction ; 45h, Lock and Unlock Drive (EBIOS) 231 ; dw Int13h_UnsupportedFunction ; 46h, Eject Media Request (EBIOS) 232 ; dw Int13h_UnsupportedFunction ; 47h, Extended Seek (EBIOS) 233 ; dw Int13h_UnsupportedFunction ; 48h, Get Extended Drive Parameters (EBIOS) 234 ; dw Int13h_UnsupportedFunction ; 49h, Get Extended Disk Change Status (EBIOS) 258 ; dw Int13h_UnsupportedFunction ; 41h, Check if Extensions Present (EBIOS)* 259 ; dw Int13h_UnsupportedFunction ; 42h, Extended Read Sectors (EBIOS)* 260 ; dw Int13h_UnsupportedFunction ; 43h, Extended Write Sectors (EBIOS)* 261 ; dw Int13h_UnsupportedFunction ; 44h, Extended Verify Sectors (EBIOS)* 262 ; dw Int13h_UnsupportedFunction ; 45h, Lock and Unlock Drive (EBIOS)*** 263 ; dw Int13h_UnsupportedFunction ; 46h, Eject Media Request (EBIOS)*** 264 ; dw Int13h_UnsupportedFunction ; 47h, Extended Seek (EBIOS)* 265 ; dw Int13h_UnsupportedFunction ; 48h, Get Extended Drive Parameters (EBIOS)* 266 ; dw Int13h_UnsupportedFunction ; 49h, Get Extended Disk Change Status (EBIOS)*** 235 267 ; dw Int13h_UnsupportedFunction ; 4Ah, Initiate Disk Emulation (Bootable CD-ROM) 236 268 ; dw Int13h_UnsupportedFunction ; 4Bh, Terminate Disk Emulation (Bootable CD-ROM) 237 269 ; dw Int13h_UnsupportedFunction ; 4Ch, Initiate Disk Emulation and Boot (Bootable CD-ROM) 238 270 ; dw Int13h_UnsupportedFunction ; 4Dh, Return Boot Catalog (Bootable CD-ROM) 239 ; dw Int13h_UnsupportedFunction ; 4Eh, Set Hardware Configuration (EBIOS) 271 ; dw Int13h_UnsupportedFunction ; 4Eh, Set Hardware Configuration (EBIOS)** 272 ; 273 ; * = Enhanced Drive Access Support (minimum required EBIOS functions) 274 ; ** = Enhanced Disk Drive (EDD) Support 275 ; *** = Drive Locking and Ejecting Support
Note:
See TracChangeset
for help on using the changeset viewer.