source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm @ 186

Last change on this file since 186 was 186, checked in by gregli@…, 12 years ago

Initial string compression checkin. All changes are under MODULE_STRINGS_COMPRESSED, and this can still be turned off. With this checkin, the serial and ebios code can both be turned on at the same time and still we remain below the 8K boundary (barely). I still need to chekin StringsCompress.pl after some more code cleanup. The output, in StringsCompressed.asm is checked in here, and should continue be to checkin when Strings.asm is changed, for those who do not have/want to run the Perl script to recreate it.

File size: 3.8 KB
Line 
1; Project name  :   XTIDE Universal BIOS
2; Description   :   Functions for printing drive configuration
3;                   information on Boot Menu.
4
5; Section containing code
6SECTION .text
7
8;--------------------------------------------------------------------
9; Prints Hard Disk configuration for drive handled by our BIOS.
10; Cursor is set to configuration header string position.
11;
12; BootMenuPrintCfg_ForOurDrive
13;   Parameters:
14;       DS:     Segment to DPT
15;       Stack:  Offset to DPT
16;   Returns:
17;       Nothing
18;   Corrupts registers:
19;       AX, BX, CX, DX, SI, DI
20;--------------------------------------------------------------------
21ALIGN JUMP_ALIGN
22BootMenuPrintCfg_ForOurDrive:
23    mov     si, g_szCfgHeader
24    call    BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
25    pop     di
26    eMOVZX  ax, BYTE [di+DPT.bIdevarsOffset]
27    xchg    si, ax                      ; CS:SI now points to IDEVARS
28    ; Fall to PushAndFormatCfgString
29
30;--------------------------------------------------------------------
31; PushAndFormatCfgString
32;   Parameters:
33;       DS:DI:  Ptr to DPT
34;       CS:SI:  Ptr to IDEVARS
35;   Returns:
36;       Nothing
37;   Corrupts registers:
38;       AX, DX, SI, DI
39;--------------------------------------------------------------------
40PushAndFormatCfgString:
41    push    bp
42    mov     bp, sp
43    ; Fall to first push below
44
45;--------------------------------------------------------------------
46; PushAddressingMode
47;   Parameters:
48;       DS:DI:  Ptr to DPT
49;       CS:SI:  Ptr to IDEVARS
50;   Returns:
51;       Nothing (jumps to next push below)
52;   Corrupts registers:
53;       AX
54;--------------------------------------------------------------------
55PushAddressingMode:
56    call    AccessDPT_GetAddressingModeForWordLookToBX
57    mov     al,g_szAddressingModes_Displacement
58    mul     bl
59    add     ax,g_szAddressingModes
60    push    ax
61       
62;--------------------------------------------------------------------
63; PushBlockMode
64;   Parameters:
65;       DS:DI:  Ptr to DPT
66;       CS:SI:  Ptr to IDEVARS
67;   Returns:
68;       Nothing (falls to next push below)
69;   Corrupts registers:
70;       AX
71;--------------------------------------------------------------------
72PushBlockMode:
73    mov     ax, 1
74    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
75    jz      SHORT .PushBlockSizeFromAX
76    mov     al, [di+DPT_ATA.bSetBlock]
77.PushBlockSizeFromAX:
78    push    ax
79
80;--------------------------------------------------------------------
81; PushBusType
82;   Parameters:
83;       DS:DI:  Ptr to DPT
84;       CS:SI:  Ptr to IDEVARS
85;   Returns:
86;       Nothing (jumps to next push below)
87;   Corrupts registers:
88;       AX, DX
89;--------------------------------------------------------------------
90;PushBusType:
91    mov     al,g_szBusTypeValues_Displacement
92    mul     BYTE [cs:si+IDEVARS.bDevice]
93       
94    shr     ax,1            ; divide by 2 since IDEVARS.bDevice is multiplied by 2
95       
96    add     ax,g_szBusTypeValues
97    push    ax 
98               
99;--------------------------------------------------------------------
100; PushIRQ
101;   Parameters:
102;       DS:DI:  Ptr to DPT
103;       CS:SI:  Ptr to IDEVARS
104;   Returns:
105;       Nothing (falls to next push below)
106;   Corrupts registers:
107;       AX, DX
108;--------------------------------------------------------------------
109PushIRQ:
110    eMOVZX  ax, BYTE [cs:si+IDEVARS.bIRQ]
111    push    ax
112
113;--------------------------------------------------------------------
114; PushResetStatus
115;   Parameters:
116;       DS:DI:  Ptr to DPT
117;       CS:SI:  Ptr to IDEVARS
118;   Returns:
119;       Nothing (falls to next push below)
120;   Corrupts registers:
121;       AX
122;--------------------------------------------------------------------
123PushResetStatus:
124    mov     al, [di+DPT.bFlagsHigh]
125    and     ax, MASKH_DPT_RESET
126    push    ax
127
128;--------------------------------------------------------------------
129; PrintValuesFromStack
130;   Parameters:
131;       Stack:  All formatting parameters
132;   Returns:
133;       Nothing
134;   Corrupts registers:
135;       AX, SI, DI
136;--------------------------------------------------------------------
137PrintValuesFromStack:
138    mov     si, g_szCfgFormat
139    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
140
Note: See TracBrowser for help on using the repository browser.