Changeset 392 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers


Ignore:
Timestamp:
Apr 17, 2012, 2:42:54 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Greatly improved Hotkey Bar is displayed during drive detection.
  • 8k builds no longer include boot menu.
  • Boot menu is displayed only if F2 is pressed during drive detection.
  • Some changes to directory structure.


Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r376 r392  
    8181;       CX
    8282;--------------------------------------------------------------------
     83%ifdef MODULE_BOOT_MENU
    8384AH15h_GetSectorCountFromForeignDriveToDXAX:
    8485    mov     ah, GET_DRIVE_PARAMETERS
    8586    call    Int13h_CallPreviousInt13hHandler
    8687    jmp     SHORT ConvertAH08hReturnValuesToSectorCount
     88%endif
    8789
    8890AH15h_GetSectorCountToBXDXAX:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r386 r392  
    2222
    2323;--------------------------------------------------------------------
    24 ; INT 19h handler that properly reboots the computer when
    25 ; INT 19h is called.
    26 ;
    27 ; Int19h_ResetHandler
    28 ;   Parameters:
    29 ;       Nothing
    30 ;   Returns:
    31 ;       Never returns (reboots computer)
    32 ;--------------------------------------------------------------------
    33 Int19h_ResetHandler:
    34     mov     ax, BOOT_FLAG_WARM              ; Skip memory tests
    35     jmp     Reboot_ComputerWithBootFlagInAX
    36 
    37 
    38 ;--------------------------------------------------------------------
    3924; Int19h_BootLoaderHandler
    4025;   Parameters:
     
    4429;--------------------------------------------------------------------
    4530Int19h_BootLoaderHandler:
    46     sti
    47     ; Install INT 19h handler for proper reboot
    48     LOAD_BDA_SEGMENT_TO es, ax
    49     mov     al, BIOS_BOOT_LOADER_INTERRUPT_19h  ; INT 19h interrupt vector offset
    50     mov     si, Int19h_ResetHandler             ; INT 19h handler to reboot the system
    51     call    Interrupts_InstallHandlerToVectorInALFromCSSI
    52     call    Initialize_AndDetectDrives          ; Installs new boot menu loader
    53     ; Fall to .PrepareStackAndSelectDriveFromBootMenu
     31    sti                                         ; Allow timer interrupts
     32    LOAD_BDA_SEGMENT_TO es, ax                  ; Load BDA segment (zero) to ES
     33    ; Fall to .PrepareBootLoaderStack
     34
    5435
    5536;--------------------------------------------------------------------
    56 ; .PrepareStackAndSelectDriveFromBootMenu
     37; Drive detection and boot menu use lots of stack so it is
     38; wise to relocate stack. Otherwise something important from
     39; interrupt vectors are likely corrupted, likely our own DPTs if
     40; they are located to 30:0h.
     41;
     42; .PrepareBootLoaderStack
    5743;   Parameters:
    5844;       ES:     BDA and interrupt vector segment (zero)
     
    6046;       Never returns (loads operating system)
    6147;--------------------------------------------------------------------
    62 .PrepareStackAndSelectDriveFromBootMenu:
     48.PrepareBootLoaderStack:
    6349    STORE_POST_STACK_POINTER
    6450    SWITCH_TO_BOOT_MENU_STACK
    6551    ; Fall to .InitializeDisplay
    6652
     53
    6754;--------------------------------------------------------------------
    6855; .InitializeDisplay
    6956;   Parameters:
    70 ;       Nothing
     57;       ES:     BDA and interrupt vector segment (zero)
    7158;   Returns:
    7259;       Never returns (loads operating system)
     
    7966    int     BIOS_VIDEO_INTERRUPT_10h
    8067.InitializeDisplayLibrary:
    81     call    BootMenuPrint_InitializeDisplayContext
    82     ; Fall to .SelectDriveToBootFrom
     68    call    DetectPrint_InitializeDisplayContext
     69    ; Fall to .InitializeBiosAndDetectDrives
     70
    8371
    8472;--------------------------------------------------------------------
    85 ; .SelectDriveToBootFrom
     73; .InitializeBiosAndDetectDrives
    8674;   Parameters:
    87 ;       Nothing
     75;       ES:     BDA and interrupt vector segment (zero)
     76;   Returns:
     77;       DS:     RAMVARS segment
     78;--------------------------------------------------------------------
     79    call    Initialize_AndDetectDrives 
     80    ; Fall to SelectDriveToBootFrom
     81
     82
     83;--------------------------------------------------------------------
     84; SelectDriveToBootFrom
     85;   Parameters:
     86;       DS:     RAMVARS segment
     87;       ES:     BDA and interrupt vector segment (zero)
    8888;   Returns:
    8989;       Never returns (loads operating system)
    9090;--------------------------------------------------------------------
    91 .SelectDriveToBootFrom:
    92     call    RamVars_GetSegmentToDS
     91SelectDriveToBootFrom:
     92    call    HotkeyBar_UpdateDuringDriveDetection
     93
    9394%ifdef MODULE_BOOT_MENU
    94     cmp     WORD [cs:ROMVARS.wfDisplayBootMenu], BYTE 0
    95     jne     SHORT ProcessBootMenuSelectionsUntilBootableDriveSelected   ; Display boot menu
     95    mov     di, BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode
     96    cmp     BYTE [es:di], BOOT_MENU_HOTKEY_SCANCODE
     97    jne     SHORT .DoNotDisplayBootMenu
     98
     99    ; Stop blinking the Boot Menu hotkey and display menu
     100    mov     BYTE [es:di], 0
     101    call    HotkeyBar_DrawToTopOfScreen
     102    call    BootMenu_DisplayAndStoreSelectionAsHotkey
     103.DoNotDisplayBootMenu:
    96104%endif
    97     ; Fall to BootFromDriveAthenTryDriveC
     105
     106    ; Check if ROM boot (INT 18h) wanted
     107    cmp     BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ROM_BOOT_HOTKEY_SCANCODE
     108    je      SHORT JumpToBootSector_or_RomBoot   ; CF clear so ROM boot
     109
     110    ; Try to boot from Primary boot drive (00h by default)
     111    call    HotkeyBar_GetPrimaryBootDriveNumberToDL
     112    call    TryToBootFromPrimaryOrSecondaryBootDevice
     113    jc      SHORT JumpToBootSector_or_RomBoot
     114
     115    ; Try to boot from Secondary boot device (80h by default)
     116    call    HotkeyBar_GetSecondaryBootDriveNumberToDL
     117    call    TryToBootFromPrimaryOrSecondaryBootDevice
     118
     119%ifdef MODULE_BOOT_MENU
     120    ; Force Boot Menu hotkey to display boot menu
     121    mov     BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], BOOT_MENU_HOTKEY_SCANCODE
     122    jnc     SHORT SelectDriveToBootFrom
     123%endif
     124    ; Fall to JumpToBootSector_or_RomBoot
     125
    98126
    99127;--------------------------------------------------------------------
    100 ; BootFromDriveAthenTryDriveC
    101 ;   Parameters:
    102 ;       DS:     RAMVARS segment
    103 ;   Returns:
    104 ;       Never returns (loads operating system)
    105 ;--------------------------------------------------------------------
    106 BootFromDriveAthenTryDriveC:
    107     xor     dx, dx              ; DL = 00h = Floppy Drive A
    108     call    BootSector_TryToLoadFromDriveDL
    109     jc      SHORT Int19hMenu_JumpToBootSector_or_RomBoot
    110     mov     dl, 80h             ; DL = 80h = First Hard Drive (usually C)
    111     call    BootSector_TryToLoadFromDriveDL
    112     jmp     SHORT Int19hMenu_JumpToBootSector_or_RomBoot    ; ROM Boot if error
    113 
    114 
    115 %ifdef MODULE_BOOT_MENU
    116 ;--------------------------------------------------------------------
    117 ; ProcessBootMenuSelectionsUntilBootableDriveSelected
    118 ;   Parameters:
    119 ;       DS:     RAMVARS segment
    120 ;   Returns:
    121 ;       Never returns
    122 ;--------------------------------------------------------------------
    123 ProcessBootMenuSelectionsUntilBootableDriveSelected:
    124     call    BootMenu_DisplayAndReturnSelectionInDX
    125     call    DriveXlate_ToOrBack                                         ; Translate drive number
    126     call    BootSector_TryToLoadFromDriveDL
    127     jnc     SHORT ProcessBootMenuSelectionsUntilBootableDriveSelected   ; Boot failure, show menu again
    128     ; Fall to Int19hMenu_JumpToBootSector_or_RomBoot
    129     ; (CF is set or we wouldn't be here, see "jnc" immediately above)
    130 %endif
    131 
    132 ;--------------------------------------------------------------------
    133 ; Int19hMenu_JumpToBootSector_or_RomBoot
     128; JumpToBootSector_or_RomBoot
    134129;
    135130; Switches back to the POST stack, clears the DS and ES registers,
     
    140135;       DL:     Drive to boot from (translated, 00h or 80h)
    141136;       CF:     Set for Boot Sector Boot
    142 ;               Clear for Rom Boot
     137;               Clear for ROM Boot
    143138;       ES:BX:  (if CF set) Ptr to boot sector
    144139;
     
    146141;       Never returns
    147142;--------------------------------------------------------------------
    148 Int19hMenu_JumpToBootSector_or_RomBoot:
     143JumpToBootSector_or_RomBoot:
    149144    mov     cx, es      ; Preserve MBR segment (can't push because of stack change)
    150145    mov     ax, 0       ; NOTE: can't use XOR (LOAD_BDA_SEGMENT_TO) as it impacts CF
     
    167162; Boot by calling INT 18h (ROM Basic of ROM DOS)
    168163.romboot:
    169     int     BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns     
     164    int     BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns
     165
     166
     167;--------------------------------------------------------------------
     168; TryToBootFromPrimaryOrSecondaryBootDevice
     169;   Parameters
     170;       DL:     Drive selected as boot device
     171;       DS:     RAMVARS segment
     172;       ES:     BDA and interrupt vector segment (zero)
     173;   Returns:
     174;       DL:     Drive to boot from (translated, 00h or 80h)
     175;       CF:     Set for Boot Sector Boot
     176;               Clear for ROM Boot
     177;       ES:BX:  (if CF set) Ptr to boot sector
     178;   Corrupts registers:
     179;       AX, CX, DH, SI, DI, (DL if failed to read boot sector)
     180;--------------------------------------------------------------------
     181TryToBootFromPrimaryOrSecondaryBootDevice:
     182    call    DriveXlate_SetDriveToSwap
     183    call    DriveXlate_ToOrBack
     184    jmp     BootSector_TryToLoadFromDriveDL
Note: See TracChangeset for help on using the changeset viewer.