Changeset 95 in xtideuniversalbios


Ignore:
Timestamp:
Jan 28, 2011, 11:55:34 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Smaller boot sector loading string.
  • Cleaned boot code a bit.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm

    r93 r95  
    1212;       DS:     RAMVARS segment
    1313;   Returns:
    14 ;       DX:     Untranslated drive number to be used for booting (if CF cleared)
    15 ;               Function number (if CF set)
    16 ;       CF:     Cleared if drive selected
    17 ;               Set if function selected
     14;       DX:     Untranslated drive number to be used for booting
    1815;   Corrupts registers:
    1916;       All General Purpose Registers
     
    2623    call    BootMenuPrint_ClearScreen
    2724    cmp     cx, BYTE NO_ITEM_SELECTED
    28     je      SHORT BootMenu_DisplayAndReturnSelection
     25    je      SHORT BootMenu_DisplayAndReturnSelection    ; Clear screen and display menu
    2926    jmp     SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX
    3027
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r93 r95  
    108108    cmp     ah, ROM_BOOT_HOTKEY_SCANCODE
    109109    jne     SHORT .CheckDriveHotkeys
    110     int     INTV_BOOT_FAILURE       ; ROM Boot, never returns
     110    jmp     Int19hMenu_RomBoot
    111111ALIGN JUMP_ALIGN
    112112.CheckDriveHotkeys:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm

    r88 r95  
    2020    mov     bp, sp
    2121
    22     mov     ax, g_szHardDrv
     22    mov     ax, g_szHDD
    2323    test    dl, 80h
    24     eCMOVZ  ax, g_szFloppyDrv
    25     push    ax                  ; "Hard Drive" or "Floppy Drive"
     24    eCMOVZ  ax, g_szFDD
     25    push    ax
    2626
    2727    call    DriveXlate_ToOrBack
     
    3535
    3636;--------------------------------------------------------------------
    37 ; BootPrint_BootSectorLoaded
     37; BootPrint_BootSectorResultStringFromBX
    3838;   Parameters:
    39 ;       Nothing
     39;       CS:BX:  Ptr to "found" or "not found"
    4040;   Returns:
    4141;       Nothing
     
    4444;--------------------------------------------------------------------
    4545ALIGN JUMP_ALIGN
    46 BootPrint_BootSectorLoaded:
     46BootPrint_BootSectorResultStringFromBX:
    4747    push    bp
    4848    mov     bp, sp
    4949    ePUSH_T ax, g_szBootSector
    50     ePUSH_T ax, g_szFound
    51     jmp     SHORT PrintBootSectorResult
    52 
    53 ;--------------------------------------------------------------------
    54 ; BootPrint_FirstSectorNotBootable
    55 ;   Parameters:
    56 ;       Nothing
    57 ;   Returns:
    58 ;       Nothing
    59 ;   Corrupts registers:
    60 ;       AX, SI
    61 ;--------------------------------------------------------------------
    62 ALIGN JUMP_ALIGN
    63 BootPrint_FirstSectorNotBootable:
    64     push    bp
    65     mov     bp, sp
    66     ePUSH_T ax, g_szBootSector
    67     ePUSH_T ax, g_szNotFound
    68 PrintBootSectorResult:
     50    push    bx          ; "found" or "not found"
    6951    mov     si, g_szSectRead
    7052    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
     
    7860;       Nothing
    7961;   Corrupts registers:
    80 ;       AX, CX, SI
     62;       AX, BX, SI
    8163;--------------------------------------------------------------------
    8264ALIGN JUMP_ALIGN
     
    8466    push    bp
    8567    mov     bp, sp
    86     eMOVZX  cx, ah              ; Error code to CX
    87     push    cx                  ; Push INT 13h error code
     68    eMOVZX  bx, ah
     69    push    bx                  ; Push INT 13h error code
    8870    mov     si, g_szReadError
    8971    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r90 r95  
    2525Int19h_TryToLoadBootSectorFromDL:
    2626    call    BootPrint_TryToBootFromDL
    27     call    Int19h_LoadFirstSectorFromDL
     27    call    LoadFirstSectorFromDriveDL
    2828    jc      SHORT .FailedToLoadFirstSector
    2929
     
    3333    jne     SHORT .FirstHardDiskSectorNotBootable
    3434.AlwaysBootFromFloppyDriveForBooterGames:
    35     call    BootPrint_BootSectorLoaded
     35    mov     bx, g_szFound
     36    call    BootPrint_BootSectorResultStringFromBX
    3637    stc
    3738    ret
     
    4142    ret
    4243.FirstHardDiskSectorNotBootable:
    43     call    BootPrint_FirstSectorNotBootable
     44    mov     bx, g_szNotFound
     45    call    BootPrint_BootSectorResultStringFromBX
    4446    clc
    4547    ret
    4648
    4749;--------------------------------------------------------------------
    48 ; Reads first sector (boot sector) from drive DL.
    49 ;
    50 ; Int19h_LoadFirstSectorFromDL
     50; LoadFirstSectorFromDriveDL
    5151;   Parameters:
    5252;       DL:     Drive to boot from (translated, 00h or 80h)
     
    6060;--------------------------------------------------------------------
    6161ALIGN JUMP_ALIGN
    62 Int19h_LoadFirstSectorFromDL:
     62LoadFirstSectorFromDriveDL:
    6363    LOAD_BDA_SEGMENT_TO es, bx              ; ES:BX now points to...
    6464    mov     bx, BOOTVARS.rgbBootSect        ; ...boot sector location
    65     mov     di, B_READ_RETRY_TIMES          ; Retry counter
     65    mov     di, B_READ_RETRY_TIMES          ; Initialize retry counter
    6666ALIGN JUMP_ALIGN
    6767.ReadRetryLoop:
     
    9090    xor     ax, ax                          ; AH=0h, Disk Controller Reset
    9191    test    dl, 80h                         ; Floppy drive?
    92     jz      SHORT .ResetDriveFromDL         ;  If so, jump to reset
    93     mov     ah, 0Dh                         ; AH=Dh, Reset Hard Disk (Alternate reset)
    94 .ResetDriveFromDL:
     92    eCMOVNZ ah, 0Dh                         ; AH=Dh, Reset Hard Disk (Alternate reset)
    9593    int     INTV_DISK_FUNC
    9694    ret
     
    155153    mov     es, ax
    156154    ret
    157 
    158 
    159 ;--------------------------------------------------------------------
    160 ; Calls INT 18h (ROM Basic or Boot Failure). Called after booting from
    161 ; floppy drive or hard disk fails.
    162 ;
    163 ; Int19h_BootFailure
    164 ;   Parameters:
    165 ;       Nothing
    166 ;   Returns:
    167 ;       Should never return (but might)
    168 ;--------------------------------------------------------------------
    169 ALIGN JUMP_ALIGN
    170 Int19h_BootFailure:
    171     call    Int19h_ClearSegmentsForBoot
    172     int     INTV_BOOT_FAILURE
    173     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm

    r90 r95  
    5353ALIGN JUMP_ALIGN
    5454Int19hMenu_ProcessMenuSelectionsUntilBootable:
    55     call    Int19hMenu_GetDriveOrFunctionFromBootMenu
    56     jc      SHORT Int19hMenu_ExecuteSelectedFunction
     55    call    BootMenu_DisplayAndReturnSelection
     56    call    DriveXlate_ToOrBack         ; Translate drive number
    5757    call    Int19h_TryToLoadBootSectorFromDL
    58     jnc     SHORT Int19hMenu_ProcessMenuSelectionsUntilBootable ; Boot failure
     58    jnc     SHORT Int19hMenu_ProcessMenuSelectionsUntilBootable ; Boot failure, show menu again
    5959    call    BootVars_SwitchBackToPostStack
    60     jmp     SHORT Int19h_JumpToBootSector
     60    jmp     Int19h_JumpToBootSector
    6161
    6262
    6363;--------------------------------------------------------------------
    64 ; Selects Floppy or Hard Disk Drive to boot from or some function.
    65 ;
    66 ; Int19hMenu_GetDriveOrFunctionFromBootMenu
     64; Int19hMenu_RomBoot
    6765;   Parameters:
    6866;       DS:     RAMVARS segment
    6967;   Returns:
    70 ;       DX:     Drive number (translated, 00h or 80h) or
    71 ;               Function ID
    72 ;       CF:     Cleared if drive selected
    73 ;               Set if function selected
    74 ;   Corrupts registers:
    75 ;       All non segment regs
     68;       Never returns
    7669;--------------------------------------------------------------------
    7770ALIGN JUMP_ALIGN
    78 Int19hMenu_GetDriveOrFunctionFromBootMenu:
    79     call    BootMenu_DisplayAndReturnSelection
    80     jc      SHORT .ReturnFunction
    81     call    DriveXlate_ToOrBack         ; Translate drive number
    82     clc
    83 ALIGN JUMP_ALIGN
    84 .ReturnFunction:
    85     ret
    86 
    87 
    88 ;--------------------------------------------------------------------
    89 ; Executes any function (non-drive) selected from Boot Menu.
    90 ;
    91 ; Int19hMenu_ExecuteSelectedFunction
    92 ;   Parameters:
    93 ;       DX:     Function ID (selected from Boot Menu)
    94 ;       DS:     RAMVARS segment
    95 ;   Returns:
    96 ;       Nothing
    97 ;   Corrupts registers:
    98 ;       All non segment regs
    99 ;--------------------------------------------------------------------
    100 ALIGN JUMP_ALIGN
    101 Int19hMenu_ExecuteSelectedFunction:
    102     ePUSH_T ax, Int19hMenu_ProcessMenuSelectionsUntilBootable
    103     test    dx, dx                      ; 0, IDF_BOOTMNU_ROM
    104     jz      SHORT .Int18hRomBoot
    105     ret
    106 ALIGN JUMP_ALIGN
    107 .Int18hRomBoot:
     71Int19hMenu_RomBoot:
    10872    call    BootVars_SwitchBackToPostStack
    109     jmp     Int19h_BootFailure          ; Never returns
     73    call    Int19h_ClearSegmentsForBoot
     74    int     INTV_BOOT_FAILURE       ; Never returns
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r92 r95  
    1313
    1414; Boot loader strings
    15 g_szFloppyDrv:  db  "Floppy Drive",NULL
    16 g_szHardDrv:    db  " Hard Drive ",NULL
    17 g_szTryToBoot:  db  "Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x ... ",NULL
    18 g_szBootSector: db  "Boot Sector",NULL
     15g_szTryToBoot:  db  "Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x",CR,LF,NULL
     16g_szBootSector: db  "Boot sector",NULL
    1917g_szFound:      db  "found",NULL
    2018g_szSectRead:   db  "%s %s!",CR,LF,NULL
     
    3028; Boot Menu menuitem strings
    3129g_szFDLetter:   db  "%s %c",NULL
     30g_szFloppyDrv:  db  "Floppy Drive",NULL
    3231g_szforeignHD:  db  "Foreign Hard Disk",NULL
    3332
Note: See TracChangeset for help on using the changeset viewer.