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

Last change on this file since 94 was 88, checked in by Tomi Tilli, 14 years ago

Changes to XTIDE Universal BIOS:

  • Now uses new libraries (untested)
  • Non-working since code size is too large
File size: 6.1 KB
RevLine 
[88]1; Project name : XTIDE Universal BIOS
[3]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:DI: Ptr to DPT
15; Returns:
16; Nothing
17; Corrupts registers:
[88]18; AX, BX, CX, DX, SI, DI, ES
[3]19;--------------------------------------------------------------------
20ALIGN JUMP_ALIGN
21BootMenuPrintCfg_ForOurDrive:
22 call BootMenuPrintCfg_HeaderAndChangeLine
23 call BootMenuPrintCfg_GetPointers
24 call BootMenuPrintCfg_PushAndFormatCfgString
[88]25 jmp BootMenuPrint_Newline
[3]26
27
28;--------------------------------------------------------------------
29; Prints configuration header and changes for printing values.
30;
31; BootMenuPrintCfg_HeaderAndChangeLine
32; Parameters:
33; Nothing
34; Returns:
35; Nothing
36; Corrupts registers:
[88]37; AX, SI, DI
[3]38;--------------------------------------------------------------------
39ALIGN JUMP_ALIGN
40BootMenuPrintCfg_HeaderAndChangeLine:
41 mov si, g_szCfgHeader
[88]42 call PrintNullTerminatedStringFromCSSIandSetCF
43 jmp BootMenuPrint_Newline
[3]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;--------------------------------------------------------------------
59ALIGN JUMP_ALIGN
60BootMenuPrintCfg_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
74; Parameters:
75; DS:DI: Ptr to DPT
76; ES:BX: Ptr to BOOTNFO
77; CS:SI: Ptr to IDEVARS
78; Returns:
79; Nothing
80; Corrupts registers:
[88]81; AX, DX, SI, DI
[3]82;--------------------------------------------------------------------
83ALIGN JUMP_ALIGN
84BootMenuPrintCfg_PushAndFormatCfgString:
[88]85 push bp
86
87 mov bp, sp
[3]88 ; Fall to first push below
89
90;--------------------------------------------------------------------
[88]91; PushAddressingMode
[3]92; Parameters:
93; DS:DI: Ptr to DPT
94; ES:BX: Ptr to BOOTNFO
95; CS:SI: Ptr to IDEVARS
96; Returns:
[88]97; Nothing (jumps to next push below)
[3]98; Corrupts registers:
[88]99; AX, DX
[3]100;--------------------------------------------------------------------
[88]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:
[3]116
117;--------------------------------------------------------------------
[88]118; PushBlockMode
[3]119; Parameters:
120; DS:DI: Ptr to DPT
121; ES:BX: Ptr to BOOTNFO
122; CS:SI: Ptr to IDEVARS
123; Returns:
124; Nothing (falls to next push below)
125; Corrupts registers:
[88]126; AX
[3]127;--------------------------------------------------------------------
[88]128PushBlockMode:
129 eMOVZX ax, BYTE [di+DPT.bSetBlock]
[3]130 push ax
131
132;--------------------------------------------------------------------
[88]133; PushBusType
[3]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)
140; Corrupts registers:
141; AX, DX
142;--------------------------------------------------------------------
[88]143PushBusType:
[3]144 xchg ax, bx ; Store BX to AX
145 eMOVZX bx, BYTE [cs:si+IDEVARS.bBusType]
146 mov bx, [cs:bx+.rgwBusTypeValues] ; Char to BL, Int to BH
147 eMOVZX dx, bh
[88]148 push bx ; Push character
[3]149 push dx ; Push 8, 16 or 32
150 xchg bx, ax ; Restore BX
151 jmp SHORT .NextPush
152ALIGN WORD_ALIGN
153.rgwBusTypeValues:
154 db 'D', 8 ; BUS_TYPE_8_DUAL
155 db ' ', 16 ; BUS_TYPE_16
156 db ' ', 32 ; BUS_TYPE_32
157 db 'S', 8 ; BUS_TYPE_8_SINGLE
158ALIGN JUMP_ALIGN
159.NextPush:
160
161;--------------------------------------------------------------------
[88]162; PushIRQ
[3]163; Parameters:
164; DS:DI: Ptr to DPT
165; ES:BX: Ptr to BOOTNFO
166; CS:SI: Ptr to IDEVARS
167; Returns:
168; Nothing (falls to next push below)
169; Corrupts registers:
[88]170; AX, DX
[3]171;--------------------------------------------------------------------
[88]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
[3]192 push ax
193
194;--------------------------------------------------------------------
[88]195; PushResetStatus
[3]196; Parameters:
197; DS:DI: Ptr to DPT
198; ES:BX: Ptr to BOOTNFO
199; CS:SI: Ptr to IDEVARS
200; Returns:
[88]201; Nothing (falls to next push below)
[3]202; Corrupts registers:
[88]203; AX
[3]204;--------------------------------------------------------------------
[88]205PushResetStatus:
206 eMOVZX ax, BYTE [di+DPT.bReset]
207 push ax
[3]208
209;--------------------------------------------------------------------
210; Prints formatted configuration string from parameters pushed to stack.
211;
212; BootMenuPrintCfg_ValuesFromStack
213; Parameters:
214; Stack: All formatting parameters
215; Returns:
216; Nothing
217; Corrupts registers:
[88]218; AX, SI, DI
[3]219;--------------------------------------------------------------------
220BootMenuPrintCfg_ValuesFromStack:
221 mov si, g_szCfgFormat
[88]222 jmp PrintNullTerminatedStringFromCSSIandSetCF
Note: See TracBrowser for help on using the repository browser.