Changeset 560 in xtideuniversalbios
- Timestamp:
- Jul 3, 2013, 6:56:05 PM (11 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 5 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 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r558 r560 37 37 sti ; Enable interrupts for keystrokes 38 38 push ds 39 40 %ifdef USE_AT41 push BYTE 042 pop ds43 %else44 39 push ax ; We use AX to install very late init handler 45 40 LOAD_BDA_SEGMENT_TO ds, ax 46 %endif47 41 48 42 test BYTE [BDA.bKBFlgs1], (1<<2) ; Clears ZF if CTRL is held down … … 53 47 mov [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs 54 48 55 ; Very late initialization for XT builds only 56 %ifndef USE_AT 49 %ifdef MODULE_VERY_LATE_INITIALIZATION 57 50 push es 58 51 ; Install special INT 13h hander that initializes XTIDE Universal BIOS … … 67 60 68 61 .SkipRomInitialization: 69 %ifndef USE_AT70 62 pop ax 71 %endif72 63 pop ds 73 64 popf -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r559 r560 218 218 219 219 ; Boot loader 220 %ifdef MODULE_VERY_LATE_INITIALIZATION 221 %include "Int13hBiosInit.asm" 222 %endif 220 223 %include "Int19h.asm" ; For Int 19h, Boot Loader 221 224 %include "BootSector.asm" ; For loading boot sector … … 254 257 255 258 ; INT 13h Hard Disk BIOS functions 256 %ifndef USE_AT257 %include "Int13hBiosInit.asm"258 %endif259 259 %include "Int13h.asm" ; For Int 13h, Disk functions 260 260 %include "AH0h_HReset.asm" -
trunk/XTIDE_Universal_BIOS/makefile
r558 r560 27 27 # MODULE_SERIAL_FLOPPY Virtual floppy drives using serial port (requires MODULE_SERIAL) # 28 28 # MODULE_STRINGS_COMPRESSED Use compressed strings to save space # 29 # MODULE_VERY_LATE_INITIALIZATION Initialize on INT 13h if our INT 19h handler is not called # 29 30 # MODULE_FEATURE_SETS Power Management support # 30 31 # # … … 100 101 # Assembler preprocessor defines. # 101 102 ################################################################# 102 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_ FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER103 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_VERY_LATE_INITIALIZATION MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER 103 104 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES 104 105
Note:
See TracChangeset
for help on using the changeset viewer.