Changeset 417 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- May 5, 2012, 4:01:03 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r414 r417 23 23 ;-------------------------------------------------------------------- 24 24 ; Int 13h software interrupt handler. 25 ; This handler changes stack to top of stolen conventional memory 26 ; and then calls the actual INT 13h handler (Int13h_DiskFunctionsHandler). 27 ; 28 ; Int13h_DiskFunctionsHandlerWithStackChange 29 ; Parameters: 30 ; AH: Bios function 31 ; DL: Drive number 32 ; Other: Depends on function 33 ; Returns: 34 ; Depends on function 35 ;-------------------------------------------------------------------- 36 %ifdef RELOCATE_INT13H_STACK 37 ALIGN JUMP_ALIGN 38 Int13h_DiskFunctionsHandlerWithStackChange: 39 push ds 40 push di 41 call RamVars_GetSegmentToDS 42 43 ; Store entry registers to RAMVARS 44 mov [RAMVARS.fpInt13hEntryStack], sp 45 mov [RAMVARS.fpInt13hEntryStack+2], ss 46 pop WORD [RAMVARS.wStackChangeDI] 47 pop WORD [RAMVARS.wStackChangeDS] 48 49 ; Load new stack and restore DS and DI 50 mov di, ds ; We do not want to overwrite DS and DI in stack 51 mov ss, di 52 mov sp, [RAMVARS.wNewStackOffset] 53 lds di, [RAMVARS.dwStackChangeDSDI] 54 55 ; Call INT 13h 56 pushf 57 push cs 58 call Int13h_DiskFunctionsHandler 59 60 ; Restore stack (we must not corrupt FLAGS!) 61 cli 62 %ifdef USE_386 63 lss sp, [ss:RAMVARS.fpInt13hEntryStack] 64 %else 65 mov sp, [ss:RAMVARS.fpInt13hEntryStack] 66 mov ss, [ss:RAMVARS.fpInt13hEntryStack+2] 67 %endif 68 pop di ; DI before stack change 69 pop ds ; DS before stack change 70 retf 2 ; Skip FLAGS from stack 71 %endif ; RELOCATE_INT13H_STACK 72 73 74 ;-------------------------------------------------------------------- 75 ; Int 13h software interrupt handler. 25 76 ; Jumps to specific function defined in AH. 26 77 ; … … 40 91 cld ; String instructions to increment pointers 41 92 CREATE_FRAME_INTPACK_TO_SSBP EXTRA_BYTES_FOR_INTPACK 42 43 93 call RamVars_GetSegmentToDS 44 94 … … 47 97 mov [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl 48 98 %endif 49 50 99 call FindDPT_ForDriveNumberInDL ; DS:DI points to our DPT, or NULL if not our drive 51 100 jc SHORT .NotOurDrive ; DPT not found so this is not one of our drives … … 56 105 shl bx, 1 57 106 cmp ah, 25h ; Possible EBIOS function? 58 %ifdef MODULE_EBIOS 107 %ifndef MODULE_EBIOS 108 ja SHORT UnsupportedFunction 109 jmp [cs:bx+g_rgw13hFuncJump] ; Jump to BIOS function 110 111 %else ; If using MODULE_EBIOS 59 112 ja SHORT .JumpToEbiosFunction 60 %else61 ja SHORT Int13h_UnsupportedFunction62 %endif63 113 jmp [cs:bx+g_rgw13hFuncJump] ; Jump to BIOS function 64 114 65 %ifdef MODULE_EBIOS66 ; Jump to correct EBIOS function67 115 ALIGN JUMP_ALIGN 68 116 .JumpToEbiosFunction: 69 117 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 70 jz SHORT Int13h_UnsupportedFunction ; No eINT 13h for CHS drives118 jz SHORT UnsupportedFunction ; No eINT 13h for CHS drives 71 119 sub bl, 41h<<1 ; BX = Offset to eINT 13h jump table 72 jb SHORT Int13h_UnsupportedFunction120 jb SHORT UnsupportedFunction 73 121 cmp ah, 48h 74 ja SHORT Int13h_UnsupportedFunction122 ja SHORT UnsupportedFunction 75 123 jmp [cs:bx+g_rgwEbiosFunctionJumpTable] 76 %endif 124 %endif ; MODULE_EBIOS 125 77 126 78 127 ALIGN JUMP_ALIGN … … 91 140 ; Fall to Int13h_DirectCallToAnotherBios 92 141 93 ;-------------------------------------------------------------------- 94 ; Int13h_UnsupportedFunction 142 143 ;-------------------------------------------------------------------- 144 ; UnsupportedFunction 95 145 ; Int13h_DirectCallToAnotherBios 96 146 ; Parameters: … … 106 156 ;-------------------------------------------------------------------- 107 157 ALIGN JUMP_ALIGN 108 Int13h_UnsupportedFunction:158 UnsupportedFunction: 109 159 Int13h_DirectCallToAnotherBios: 110 160 call ExchangeCurrentInt13hHandlerWithOldInt13hHandler … … 156 206 %endif 157 207 208 158 209 %ifdef MODULE_SERIAL_FLOPPY 159 210 ;-------------------------------------------------------------------- … … 166 217 Int13h_ReturnSuccessForFloppy: 167 218 test dl, dl 168 js short Int13h_UnsupportedFunction219 js SHORT UnsupportedFunction 169 220 xor ah, ah 170 jmp short Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 171 %endif 221 jmp SHORT Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 222 %endif 223 172 224 173 225 ;-------------------------------------------------------------------- … … 185 237 ; Fall to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 186 238 239 187 240 ;-------------------------------------------------------------------- 188 241 ; Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH … … 190 243 ; Parameters: 191 244 ; AH: BIOS Error code 245 ; DS: RAMVARS segment 192 246 ; SS:BP: Ptr to IDEPACK 193 247 ; Returns: … … 206 260 207 261 Int13h_ReturnFromHandlerWithoutStoringErrorCode: 208 or WORD [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_IF ; Return with interrupts enabled 209 mov sp, bp ; Now we can exit anytime 262 ; Always return with interrupts enabled since there are programs that rely 263 ; on INT 13h to enable interrupts. 264 or BYTE [bp+IDEPACK.intpack+INTPACK.flags+1], (FLG_FLAGS_IF>>8) 265 mov sp, bp ; This makes possible to exit anytime, no matter what is on stack 210 266 RESTORE_FRAME_INTPACK_FROM_SSBP EXTRA_BYTES_FOR_INTPACK 211 267 … … 280 336 LOAD_BDA_SEGMENT_TO ds, di 281 337 mov [bx], ah 338 ; Fall to Int13h_SetErrorCodeToIntpackInSSBPfromAH 339 282 340 %else 283 341 Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH: … … 285 343 LOAD_BDA_SEGMENT_TO ds, di 286 344 mov [BDA.bHDLastSt], ah 345 ; Fall to Int13h_SetErrorCodeToIntpackInSSBPfromAH 287 346 %endif 288 347 … … 302 361 ALIGN WORD_ALIGN 303 362 g_rgw13hFuncJump: 304 dw AH0h_HandlerForDiskControllerReset 305 dw AH1h_HandlerForReadDiskStatus 306 dw AH2h_HandlerForReadDiskSectors 307 dw AH3h_HandlerForWriteDiskSectors 308 dw AH4h_HandlerForVerifyDiskSectors 363 dw AH0h_HandlerForDiskControllerReset ; 00h, Disk Controller Reset (All) 364 dw AH1h_HandlerForReadDiskStatus ; 01h, Read Disk Status (All) 365 dw AH2h_HandlerForReadDiskSectors ; 02h, Read Disk Sectors (All) 366 dw AH3h_HandlerForWriteDiskSectors ; 03h, Write Disk Sectors (All) 367 dw AH4h_HandlerForVerifyDiskSectors ; 04h, Verify Disk Sectors (All) 309 368 %ifdef MODULE_SERIAL_FLOPPY 310 dw Int13h_ReturnSuccessForFloppy 311 %else 312 dw Int13h_UnsupportedFunction; 05h, Format Disk Track (XT, AT, EISA)313 %endif 314 dw Int13h_UnsupportedFunction; 06h, Format Disk Track with Bad Sectors (XT)315 dw Int13h_UnsupportedFunction; 07h, Format Multiple Cylinders (XT)316 dw AH8h_HandlerForReadDiskDriveParameters 317 dw AH9h_HandlerForInitializeDriveParameters 318 dw Int13h_UnsupportedFunction; 0Ah, Read Disk Sectors with ECC (XT, AT, EISA)319 dw Int13h_UnsupportedFunction; 0Bh, Write Disk Sectors with ECC (XT, AT, EISA)320 dw AHCh_HandlerForSeek 321 dw AHDh_HandlerForResetHardDisk 322 dw Int13h_UnsupportedFunction; 0Eh, Read Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2)323 dw Int13h_UnsupportedFunction; 0Fh, Write Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2)324 dw AH10h_HandlerForCheckDriveReady 325 dw AH11h_HandlerForRecalibrate 326 dw Int13h_UnsupportedFunction; 12h, Controller RAM Diagnostic (XT)327 dw Int13h_UnsupportedFunction; 13h, Drive Diagnostic (XT)328 dw Int13h_UnsupportedFunction; 14h, Controller Internal Diagnostic (All)329 dw AH15h_HandlerForReadDiskDriveSize 330 dw Int13h_UnsupportedFunction; 16h,331 dw Int13h_UnsupportedFunction; 17h,332 dw Int13h_UnsupportedFunction; 18h,333 dw Int13h_UnsupportedFunction; 19h, Park Heads (PS/2)334 dw Int13h_UnsupportedFunction; 1Ah, Format ESDI Drive (PS/2)335 dw Int13h_UnsupportedFunction; 1Bh, Get ESDI Manufacturing Header (PS/2)336 dw Int13h_UnsupportedFunction; 1Ch, ESDI Special Functions (PS/2)337 dw Int13h_UnsupportedFunction; 1Dh,338 dw Int13h_UnsupportedFunction; 1Eh,339 dw Int13h_UnsupportedFunction; 1Fh,340 dw Int13h_UnsupportedFunction; 20h,341 dw Int13h_UnsupportedFunction; 21h, Read Disk Sectors, Multiple Blocks (PS/1)342 dw Int13h_UnsupportedFunction; 22h, Write Disk Sectors, Multiple Blocks (PS/1)343 dw AH23h_HandlerForSetControllerFeatures 344 dw AH24h_HandlerForSetMultipleBlocks 345 dw AH25h_HandlerForGetDriveInformation 369 dw Int13h_ReturnSuccessForFloppy ; 05h, Format Disk Track (XT, AT, EISA) 370 %else 371 dw UnsupportedFunction ; 05h, Format Disk Track (XT, AT, EISA) 372 %endif 373 dw UnsupportedFunction ; 06h, Format Disk Track with Bad Sectors (XT) 374 dw UnsupportedFunction ; 07h, Format Multiple Cylinders (XT) 375 dw AH8h_HandlerForReadDiskDriveParameters ; 08h, Read Disk Drive Parameters (All) 376 dw AH9h_HandlerForInitializeDriveParameters ; 09h, Initialize Drive Parameters (All) 377 dw UnsupportedFunction ; 0Ah, Read Disk Sectors with ECC (XT, AT, EISA) 378 dw UnsupportedFunction ; 0Bh, Write Disk Sectors with ECC (XT, AT, EISA) 379 dw AHCh_HandlerForSeek ; 0Ch, Seek (All) 380 dw AHDh_HandlerForResetHardDisk ; 0Dh, Alternate Disk Reset (All) 381 dw UnsupportedFunction ; 0Eh, Read Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2) 382 dw UnsupportedFunction ; 0Fh, Write Sector Buffer (XT, PS/1), ESDI Undocumented Diagnostic (PS/2) 383 dw AH10h_HandlerForCheckDriveReady ; 10h, Check Drive Ready (All) 384 dw AH11h_HandlerForRecalibrate ; 11h, Recalibrate (All) 385 dw UnsupportedFunction ; 12h, Controller RAM Diagnostic (XT) 386 dw UnsupportedFunction ; 13h, Drive Diagnostic (XT) 387 dw UnsupportedFunction ; 14h, Controller Internal Diagnostic (All) 388 dw AH15h_HandlerForReadDiskDriveSize ; 15h, Read Disk Drive Size (AT+) 389 dw UnsupportedFunction ; 16h, 390 dw UnsupportedFunction ; 17h, 391 dw UnsupportedFunction ; 18h, 392 dw UnsupportedFunction ; 19h, Park Heads (PS/2) 393 dw UnsupportedFunction ; 1Ah, Format ESDI Drive (PS/2) 394 dw UnsupportedFunction ; 1Bh, Get ESDI Manufacturing Header (PS/2) 395 dw UnsupportedFunction ; 1Ch, ESDI Special Functions (PS/2) 396 dw UnsupportedFunction ; 1Dh, 397 dw UnsupportedFunction ; 1Eh, 398 dw UnsupportedFunction ; 1Fh, 399 dw UnsupportedFunction ; 20h, 400 dw UnsupportedFunction ; 21h, Read Disk Sectors, Multiple Blocks (PS/1) 401 dw UnsupportedFunction ; 22h, Write Disk Sectors, Multiple Blocks (PS/1) 402 dw AH23h_HandlerForSetControllerFeatures ; 23h, Set Controller Features Register (PS/1) 403 dw AH24h_HandlerForSetMultipleBlocks ; 24h, Set Multiple Blocks (PS/1) 404 dw AH25h_HandlerForGetDriveInformation ; 25h, Get Drive Information (PS/1) 346 405 347 406 %ifdef MODULE_EBIOS 348 407 g_rgwEbiosFunctionJumpTable: 349 dw AH41h_HandlerForCheckIfExtensionsPresent 350 dw AH42h_HandlerForExtendedReadSectors 351 dw AH43h_HandlerForExtendedWriteSectors 352 dw AH44h_HandlerForExtendedVerifySectors 353 dw Int13h_UnsupportedFunction; 45h, Lock and Unlock Drive (EBIOS)***354 dw Int13h_UnsupportedFunction; 46h, Eject Media Request (EBIOS)***355 dw AH47h_HandlerForExtendedSeek 356 dw AH48h_HandlerForGetExtendedDriveParameters 357 ; dw Int13h_UnsupportedFunction; 49h, Get Extended Disk Change Status (EBIOS)***358 ; dw Int13h_UnsupportedFunction; 4Ah, Initiate Disk Emulation (Bootable CD-ROM)359 ; dw Int13h_UnsupportedFunction; 4Bh, Terminate Disk Emulation (Bootable CD-ROM)360 ; dw Int13h_UnsupportedFunction; 4Ch, Initiate Disk Emulation and Boot (Bootable CD-ROM)361 ; dw Int13h_UnsupportedFunction; 4Dh, Return Boot Catalog (Bootable CD-ROM)362 ; dw Int13h_UnsupportedFunction; 4Eh, Set Hardware Configuration (EBIOS)**408 dw AH41h_HandlerForCheckIfExtensionsPresent ; 41h, Check if Extensions Present (EBIOS)* 409 dw AH42h_HandlerForExtendedReadSectors ; 42h, Extended Read Sectors (EBIOS)* 410 dw AH43h_HandlerForExtendedWriteSectors ; 43h, Extended Write Sectors (EBIOS)* 411 dw AH44h_HandlerForExtendedVerifySectors ; 44h, Extended Verify Sectors (EBIOS)* 412 dw UnsupportedFunction ; 45h, Lock and Unlock Drive (EBIOS)*** 413 dw UnsupportedFunction ; 46h, Eject Media Request (EBIOS)*** 414 dw AH47h_HandlerForExtendedSeek ; 47h, Extended Seek (EBIOS)* 415 dw AH48h_HandlerForGetExtendedDriveParameters ; 48h, Get Extended Drive Parameters (EBIOS)* 416 ; dw UnsupportedFunction ; 49h, Get Extended Disk Change Status (EBIOS)*** 417 ; dw UnsupportedFunction ; 4Ah, Initiate Disk Emulation (Bootable CD-ROM) 418 ; dw UnsupportedFunction ; 4Bh, Terminate Disk Emulation (Bootable CD-ROM) 419 ; dw UnsupportedFunction ; 4Ch, Initiate Disk Emulation and Boot (Bootable CD-ROM) 420 ; dw UnsupportedFunction ; 4Dh, Return Boot Catalog (Bootable CD-ROM) 421 ; dw UnsupportedFunction ; 4Eh, Set Hardware Configuration (EBIOS)** 363 422 ; 364 423 ; * = Enhanced Drive Access Support (minimum required EBIOS functions) -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
r376 r417 47 47 jmp Int13h_ReturnFromHandlerWithoutStoringErrorCode 48 48 .EbiosNotSupported: 49 jmp Int13h_ UnsupportedFunction49 jmp Int13h_DirectCallToAnotherBios -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r414 r417 126 126 call HotkeyBar_GetPrimaryBootDriveNumberToDL 127 127 %else 128 call GetPrimaryBootDriveToDLwhenNotUsingModuleHotkeys128 xor dl, dl ; Try to boot from Floppy Drive A 129 129 %endif ; MODULE_HOTKEYS 130 130 … … 137 137 call HotkeyBar_GetSecondaryBootDriveNumberToDL 138 138 %else 139 call GetPrimaryBootDriveToDLwhenNotUsingModuleHotkeys 140 xor dl, 80h 139 mov dl, 80h ; Try to boot from Hard Drive C 141 140 %endif 142 141 call TryToBootFromPrimaryOrSecondaryBootDevice … … 213 212 jmp BootSector_TryToLoadFromDriveDL 214 213 %endif 215 216 217 ;--------------------------------------------------------------------218 ; GetPrimaryBootDriveToDLwhenNotUsingModuleHotkeys219 ; Parameters220 ; Nothing221 ; Returns:222 ; DL: Drive to boot from (00h or 80h)223 ; Corrupts registers:224 ; Nothing225 ;--------------------------------------------------------------------226 %ifndef MODULE_HOTKEYS227 GetPrimaryBootDriveToDLwhenNotUsingModuleHotkeys:228 mov dl, [cs:ROMVARS.bBootDrv]229 and dl, 80h ; Only 00h and 80h allowed when not using MODULE_HOTKEYS230 ret231 %endif
Note:
See TracChangeset
for help on using the changeset viewer.