Changeset 96 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm


Ignore:
Timestamp:
Jan 28, 2011, 4:29:42 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Cleaned boot loader code some more.
File:
1 edited

Legend:

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

    r88 r96  
    2020ALIGN JUMP_ALIGN
    2121BootMenuPrintCfg_ForOurDrive:
    22     call    BootMenuPrintCfg_HeaderAndChangeLine
     22    mov     si, g_szCfgHeader
     23    call    BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
    2324    call    BootMenuPrintCfg_GetPointers
    24     call    BootMenuPrintCfg_PushAndFormatCfgString
    25     jmp     BootMenuPrint_Newline
     25    ; Fall to PushAndFormatCfgString
    2626
    2727
    2828;--------------------------------------------------------------------
    29 ; Prints configuration header and changes for printing values.
    30 ;
    31 ; BootMenuPrintCfg_HeaderAndChangeLine
    32 ;   Parameters:
    33 ;       Nothing
    34 ;   Returns:
    35 ;       Nothing
    36 ;   Corrupts registers:
    37 ;       AX, SI, DI
    38 ;--------------------------------------------------------------------
    39 ALIGN JUMP_ALIGN
    40 BootMenuPrintCfg_HeaderAndChangeLine:
    41     mov     si, g_szCfgHeader
    42     call    PrintNullTerminatedStringFromCSSIandSetCF
    43     jmp     BootMenuPrint_Newline
    44 
    45 
    46 ;--------------------------------------------------------------------
    47 ; Return all necessary pointers to drive information structs.
    48 ;
    49 ; BootMenuPrintCfg_GetPointers
    50 ;   Parameters:
    51 ;       DS:DI:  Ptr to DPT
    52 ;   Returns:
    53 ;       DS:DI:  Ptr to DPT
    54 ;       ES:BX:  Ptr to BOOTNFO
    55 ;       CS:SI:  Ptr to IDEVARS
    56 ;   Corrupts registers:
    57 ;       AX, DL
    58 ;--------------------------------------------------------------------
    59 ALIGN JUMP_ALIGN
    60 BootMenuPrintCfg_GetPointers:
    61     mov     dl, [di+DPT.bDrvNum]        ; Load Drive number to DL
    62     call    BootInfo_GetOffsetToBX      ; ES:BX now points...
    63     LOAD_BDA_SEGMENT_TO es, ax          ; ...to BOOTNFO
    64     mov     al, [di+DPT.bIdeOff]
    65     xchg    si, ax                      ; CS:SI now points to IDEVARS
    66     ret
    67 
    68 
    69 ;--------------------------------------------------------------------
    70 ; Pushes all string formatting parameters and prints
    71 ; formatted configuration string.
    72 ;
    73 ; BootMenuPrintCfg_PushAndFormatCfgString
     29; PushAndFormatCfgString
    7430;   Parameters:
    7531;       DS:DI:  Ptr to DPT
     
    8238;--------------------------------------------------------------------
    8339ALIGN JUMP_ALIGN
    84 BootMenuPrintCfg_PushAndFormatCfgString:
     40PushAndFormatCfgString:
    8541    push    bp
    86 
    8742    mov     bp, sp
    8843    ; Fall to first push below
     
    9752;       Nothing (jumps to next push below)
    9853;   Corrupts registers:
    99 ;       AX, DX
     54;       AX
    10055;--------------------------------------------------------------------
    10156PushAddressingMode:
    102     mov     dx, bx              ; Backup BX to DX
     57    xchg    ax, bx
    10358    mov     bx, MASK_DPT_ADDR   ; Load addressing mode mask
    10459    and     bl, [di+DPT.bFlags] ; Addressing mode now in BX
    10560    push    WORD [cs:bx+.rgszAddressingModeString]
    106     mov     bx, dx
     61    xchg    bx, ax
    10762    jmp     SHORT .NextPush
    10863ALIGN WORD_ALIGN
     
    208163
    209164;--------------------------------------------------------------------
    210 ; Prints formatted configuration string from parameters pushed to stack.
    211 ;
    212 ; BootMenuPrintCfg_ValuesFromStack
     165; PrintValuesFromStack
    213166;   Parameters:
    214167;       Stack:  All formatting parameters
     
    218171;       AX, SI, DI
    219172;--------------------------------------------------------------------
    220 BootMenuPrintCfg_ValuesFromStack:
     173PrintValuesFromStack:
    221174    mov     si, g_szCfgFormat
    222     jmp     PrintNullTerminatedStringFromCSSIandSetCF
     175    jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     176
     177
     178;--------------------------------------------------------------------
     179; BootMenuPrintCfg_GetPointers
     180;   Parameters:
     181;       DS:DI:  Ptr to DPT
     182;   Returns:
     183;       DS:DI:  Ptr to DPT
     184;       ES:BX:  Ptr to BOOTNFO
     185;       CS:SI:  Ptr to IDEVARS
     186;   Corrupts registers:
     187;       AX, DL
     188;--------------------------------------------------------------------
     189ALIGN JUMP_ALIGN
     190BootMenuPrintCfg_GetPointers:
     191    mov     dl, [di+DPT.bDrvNum]        ; Load Drive number to DL
     192    call    BootInfo_GetOffsetToBX      ; ES:BX now points...
     193    LOAD_BDA_SEGMENT_TO es, ax          ; ...to BOOTNFO
     194    mov     al, [di+DPT.bIdeOff]
     195    xchg    si, ax                      ; CS:SI now points to IDEVARS
     196    ret
Note: See TracChangeset for help on using the changeset viewer.