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


Ignore:
Timestamp:
Jan 27, 2011, 8:14:13 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Now uses new libraries (untested)
  • Non-working since code size is too large
File:
1 edited

Legend:

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

    r3 r88  
    1 ; File name     :   BootMenuPrintCfg.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   28.3.2010
    4 ; Last update   :   9.4.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Functions for printing drive configuration
    73;                   information on Boot Menu.
     
    2016;       Nothing
    2117;   Corrupts registers:
    22 ;       AX, BX, CX, DX, SI, ES
     18;       AX, BX, CX, DX, SI, DI, ES
    2319;--------------------------------------------------------------------
    2420ALIGN JUMP_ALIGN
     
    2723    call    BootMenuPrintCfg_GetPointers
    2824    call    BootMenuPrintCfg_PushAndFormatCfgString
    29     jmp     BootMenuPrint_ClearOneInfoLine
     25    jmp     BootMenuPrint_Newline
    3026
    3127
     
    3935;       Nothing
    4036;   Corrupts registers:
    41 ;       AX, BX, DX
     37;       AX, SI, DI
    4238;--------------------------------------------------------------------
    4339ALIGN JUMP_ALIGN
    4440BootMenuPrintCfg_HeaderAndChangeLine:
    4541    mov     si, g_szCfgHeader
    46     call    PrintString_FromCS
    47     jmp     BootMenuPrint_ClearOneInfoLine
     42    call    PrintNullTerminatedStringFromCSSIandSetCF
     43    jmp     BootMenuPrint_Newline
    4844
    4945
     
    8379;       Nothing
    8480;   Corrupts registers:
    85 ;       AX, CX, DX, SI
     81;       AX, DX, SI, DI
    8682;--------------------------------------------------------------------
    8783ALIGN JUMP_ALIGN
    8884BootMenuPrintCfg_PushAndFormatCfgString:
     85    push    bp
     86
     87    mov     bp, sp
    8988    ; Fall to first push below
    9089
    9190;--------------------------------------------------------------------
    92 ; BootMenuPrintCfg_PushResetStatus
     91; PushAddressingMode
     92;   Parameters:
     93;       DS:DI:  Ptr to DPT
     94;       ES:BX:  Ptr to BOOTNFO
     95;       CS:SI:  Ptr to IDEVARS
     96;   Returns:
     97;       Nothing (jumps to next push below)
     98;   Corrupts registers:
     99;       AX, DX
     100;--------------------------------------------------------------------
     101PushAddressingMode:
     102    mov     dx, bx              ; Backup BX to DX
     103    mov     bx, MASK_DPT_ADDR   ; Load addressing mode mask
     104    and     bl, [di+DPT.bFlags] ; Addressing mode now in BX
     105    push    WORD [cs:bx+.rgszAddressingModeString]
     106    mov     bx, dx
     107    jmp     SHORT .NextPush
     108ALIGN WORD_ALIGN
     109.rgszAddressingModeString:
     110    dw      g_szLCHS
     111    dw      g_szPCHS
     112    dw      g_szLBA28
     113    dw      g_szLBA48
     114ALIGN JUMP_ALIGN
     115.NextPush:
     116
     117;--------------------------------------------------------------------
     118; PushBlockMode
    93119;   Parameters:
    94120;       DS:DI:  Ptr to DPT
     
    100126;       AX
    101127;--------------------------------------------------------------------
    102 BootMenuPrintCfg_PushResetStatus:
    103     eMOVZX  ax, BYTE [di+DPT.bReset]
     128PushBlockMode:
     129    eMOVZX  ax, BYTE [di+DPT.bSetBlock]
    104130    push    ax
    105131
    106132;--------------------------------------------------------------------
    107 ; BootMenuPrintCfg_PushIRQ
    108 ;   Parameters:
    109 ;       DS:DI:  Ptr to DPT
    110 ;       ES:BX:  Ptr to BOOTNFO
    111 ;       CS:SI:  Ptr to IDEVARS
    112 ;   Returns:
    113 ;       Nothing (falls to next push below)
     133; PushBusType
     134;   Parameters:
     135;       DS:DI:  Ptr to DPT
     136;       ES:BX:  Ptr to BOOTNFO
     137;       CS:SI:  Ptr to IDEVARS
     138;   Returns:
     139;       Nothing (jumps to next push below)
    114140;   Corrupts registers:
    115141;       AX, DX
    116142;--------------------------------------------------------------------
    117 BootMenuPrintCfg_PushIRQ:
    118     mov     dl, ' '                     ; Load space to DL
    119     mov     al, [cs:si+IDEVARS.bIRQ]
    120     test    al, al                      ; Interrupts disabled?
    121     jz      SHORT .PushIrqDisabled
    122     add     al, '0'                     ; Digit to ASCII
    123     cmp     al, '9'                     ; Only one digit needed?
    124     jbe     SHORT .PushCharacters
    125 
    126     ; Two digits needed
    127     sub     al, 10                      ; Limit to single digit ASCII
    128     mov     dl, '1'                     ; Load '1 to DX
    129     jmp     SHORT .PushCharacters
    130 ALIGN JUMP_ALIGN
    131 .PushIrqDisabled:
    132     mov     al, '-'                     ; Load line to AL
    133     xchg    ax, dx                      ; Space to AL, line to DL
    134 ALIGN JUMP_ALIGN
    135 .PushCharacters:
    136     push    ax
    137     push    dx
    138 
    139 ;--------------------------------------------------------------------
    140 ; BootMenuPrintCfg_PushBusType
    141 ;   Parameters:
    142 ;       DS:DI:  Ptr to DPT
    143 ;       ES:BX:  Ptr to BOOTNFO
    144 ;       CS:SI:  Ptr to IDEVARS
    145 ;   Returns:
    146 ;       Nothing (jumps to next push below)
    147 ;   Corrupts registers:
    148 ;       AX, DX
    149 ;--------------------------------------------------------------------
    150 BootMenuPrintCfg_PushBusType:
     143PushBusType:
    151144    xchg    ax, bx      ; Store BX to AX
    152145    eMOVZX  bx, BYTE [cs:si+IDEVARS.bBusType]
    153146    mov     bx, [cs:bx+.rgwBusTypeValues]   ; Char to BL, Int to BH
    154147    eMOVZX  dx, bh
     148    push    bx          ; Push character
    155149    push    dx          ; Push 8, 16 or 32
    156     push    bx          ; Push character
    157150    xchg    bx, ax      ; Restore BX
    158151    jmp     SHORT .NextPush
     
    167160
    168161;--------------------------------------------------------------------
    169 ; BootMenuPrintCfg_PushBlockMode
     162; PushIRQ
    170163;   Parameters:
    171164;       DS:DI:  Ptr to DPT
     
    175168;       Nothing (falls to next push below)
    176169;   Corrupts registers:
     170;       AX, DX
     171;--------------------------------------------------------------------
     172PushIRQ:
     173    mov     dl, ' '                     ; Load space to DL
     174    mov     al, [cs:si+IDEVARS.bIRQ]
     175    test    al, al                      ; Interrupts disabled?
     176    jz      SHORT .PushIrqDisabled
     177    add     al, '0'                     ; Digit to ASCII
     178    cmp     al, '9'                     ; Only one digit needed?
     179    jbe     SHORT .PushCharacters
     180
     181    ; Two digits needed
     182    sub     al, 10                      ; Limit to single digit ASCII
     183    mov     dl, '1'                     ; Load '1 to DX
     184    jmp     SHORT .PushCharacters
     185ALIGN JUMP_ALIGN
     186.PushIrqDisabled:
     187    mov     al, '-'                     ; Load line to AL
     188    xchg    ax, dx                      ; Space to AL, line to DL
     189ALIGN JUMP_ALIGN
     190.PushCharacters:
     191    push    dx
     192    push    ax
     193
     194;--------------------------------------------------------------------
     195; PushResetStatus
     196;   Parameters:
     197;       DS:DI:  Ptr to DPT
     198;       ES:BX:  Ptr to BOOTNFO
     199;       CS:SI:  Ptr to IDEVARS
     200;   Returns:
     201;       Nothing (falls to next push below)
     202;   Corrupts registers:
    177203;       AX
    178204;--------------------------------------------------------------------
    179 BootMenuPrintCfg_PushBlockMode:
    180     eMOVZX  ax, BYTE [di+DPT.bSetBlock]
     205PushResetStatus:
     206    eMOVZX  ax, BYTE [di+DPT.bReset]
    181207    push    ax
    182208
    183209;--------------------------------------------------------------------
    184 ; BootMenuPrintCfg_PushAddressingMode
    185 ;   Parameters:
    186 ;       DS:DI:  Ptr to DPT
    187 ;       ES:BX:  Ptr to BOOTNFO
    188 ;       CS:SI:  Ptr to IDEVARS
    189 ;   Returns:
    190 ;       Nothing (jumps to next push below)
    191 ;   Corrupts registers:
    192 ;       AX, DX
    193 ;--------------------------------------------------------------------
    194 BootMenuPrintCfg_PushAddressingMode:
    195     mov     dx, bx              ; Backup BX to DX
    196     mov     bx, MASK_DPT_ADDR   ; Load addressing mode mask
    197     and     bl, [di+DPT.bFlags] ; Addressing mode now in BX
    198     push    WORD [cs:bx+.rgszAddressingModeString]
    199     mov     bx, dx
    200     jmp     SHORT .NextPush
    201 ALIGN WORD_ALIGN
    202 .rgszAddressingModeString:
    203     dw  g_szLCHS
    204     dw  g_szPCHS
    205     dw  g_szLBA28
    206     dw  g_szLBA48
    207 ALIGN JUMP_ALIGN
    208 .NextPush:
    209 
    210 ;--------------------------------------------------------------------
    211210; Prints formatted configuration string from parameters pushed to stack.
    212211;
     
    217216;       Nothing
    218217;   Corrupts registers:
    219 ;       AX, CX, DX, SI
     218;       AX, SI, DI
    220219;--------------------------------------------------------------------
    221220BootMenuPrintCfg_ValuesFromStack:
    222221    mov     si, g_szCfgFormat
    223     mov     dh, 14                      ; 14 bytes pushed to stack
    224     jmp     PrintString_JumpToFormat
     222    jmp     PrintNullTerminatedStringFromCSSIandSetCF
Note: See TracChangeset for help on using the changeset viewer.