Changeset 560 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Jul 3, 2013, 6:56:05 PM (11 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm
r559 r560 22 22 SECTION .text 23 23 24 TEMPORARY_VECTOR_FOR_SYSTEM_INT13h EQU 2 1h ; MS-DOS24 TEMPORARY_VECTOR_FOR_SYSTEM_INT13h EQU 20h ; MS-DOS so BIOSes most likely do not use this 25 25 26 26 27 ;-------------------------------------------------------------------- 28 ; Int 13h software interrupt handler. 29 ; This handler captures boot sector read from foreign drive when our 30 ; INT 19h is not called. This way we can for XTIDE Universal BIOS 31 ; initialization even without INT 19h being called. 32 ; 33 ; Int13hBiosInit_Handler 34 ; Parameters: 35 ; AH: Bios function 36 ; READ_SECTORS_INTO_MEMORY will initialize XTIDE Universal BIOS 37 ;-------------------------------------------------------------------- 27 38 Int13hBiosInit_Handler: 39 ; Initialize XTIDE Universal BIOS only if Int13hBiosInit_Handler is still at 40 ; vector 13h. Otherwise some other BIOS has hooked us and our very late 41 ; initialization is not possible. 42 push ds 43 push ax 44 LOAD_BDA_SEGMENT_TO ds, ax 45 pop ax 46 cmp WORD [BIOS_DISK_INTERRUPT_13h*4], Int13hBiosInit_Handler 47 pop ds 48 jne SHORT .VeryLateInitFailed ; XTIDE Universal BIOS does not work 49 28 50 ; Ignore all but read command (assumed to read boot sector) 29 51 cmp ah, READ_SECTORS_INTO_MEMORY 30 j ne SHORT .MainBiosStillInInitializationMode52 je SHORT Int19h_BootLoaderHandler 31 53 32 LOAD_BDA_SEGMENT_TO ds, ax 33 34 ; Now install our handler and call 19h since non-standard motherboard BIOS did not 35 ; do that or our INT 19h hander was replaced by other BIOS. 36 mov WORD [BIOS_BOOT_LOADER_INTERRUPT_19h*4], Int19h_BootLoaderHandler 37 mov [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs 38 int BIOS_BOOT_LOADER_INTERRUPT_19h ; Does not return 39 40 ; Main BIOS might reset floppy drives etc. so let's wait longer 41 ; before installing our INT 19h handler. 42 .MainBiosStillInInitializationMode: 54 ; Call system INT 13h since not trying to read boot sector 43 55 int TEMPORARY_VECTOR_FOR_SYSTEM_INT13h 44 56 retf 2 45 57 46 47 ;-------------------------------------------------------------------- 48 ; Int13hBiosInit_RestoreSystemHandler 49 ; Parameters: 50 ; Nothing 51 ; Returns: 52 ; Nothing 53 ; Corrupts registers: 54 ; AX, DS, ES 55 ;-------------------------------------------------------------------- 56 Int13hBiosInit_RestoreSystemHandler: 57 LOAD_BDA_SEGMENT_TO ds, ax 58 59 ; Is our very late init handler in place 60 cmp WORD [BIOS_DISK_INTERRUPT_13h*4], Int13hBiosInit_Handler 61 jne SHORT .SystemHandlerAlreadyInPlace 62 63 les ax, [TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4] 64 mov [BIOS_DISK_INTERRUPT_13h*4], ax 65 mov [BIOS_DISK_INTERRUPT_13h*4+2], es 66 .SystemHandlerAlreadyInPlace: 67 ret 58 .VeryLateInitFailed: 59 mov ah, RET_HD_INVALID 60 stc 61 retf 2 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r556 r560 31 31 sti ; Enable interrupts 32 32 cld ; String instructions to increment pointers 33 %ifndef USE_AT34 call Int13hBiosInit_RestoreSystemHandler ; Needed if initialization was started on INT 13h instead on 19h35 %endif36 33 LOAD_BDA_SEGMENT_TO es, ax ; Load BDA segment (zero) to ES 34 %ifdef MODULE_VERY_LATE_INITIALIZATION 35 lds ax, [es:TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4] 36 mov [es:BIOS_DISK_INTERRUPT_13h*4], ax 37 mov [es:BIOS_DISK_INTERRUPT_13h*4+2], ds 38 %endif 37 39 ; Fall to .PrepareBootLoaderStack 38 40
Note:
See TracChangeset
for help on using the changeset viewer.