Ignore:
Timestamp:
Jul 3, 2013, 6:56:05 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Very late init handler is now in MODULE_VERY_LATE_INITIALIZATION
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm

    r559 r560  
    2222SECTION .text
    2323
    24 TEMPORARY_VECTOR_FOR_SYSTEM_INT13h      EQU     21h ; MS-DOS
     24TEMPORARY_VECTOR_FOR_SYSTEM_INT13h      EQU     20h ; MS-DOS so BIOSes most likely do not use this
    2525
    2626
     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;--------------------------------------------------------------------
    2738Int13hBiosInit_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
    2850    ; Ignore all but read command (assumed to read boot sector)
    2951    cmp     ah, READ_SECTORS_INTO_MEMORY
    30     jne     SHORT .MainBiosStillInInitializationMode
     52    je      SHORT Int19h_BootLoaderHandler
    3153
    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
    4355    int     TEMPORARY_VECTOR_FOR_SYSTEM_INT13h
    4456    retf    2
    4557
    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
Note: See TracChangeset for help on using the changeset viewer.