1 | ; Project name : XTIDE Universal BIOS |
---|
2 | ; Description : Functions for printing drive configuration |
---|
3 | ; information on Boot Menu. |
---|
4 | |
---|
5 | ; Section containing code |
---|
6 | SECTION .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 | ;-------------------------------------------------------------------- |
---|
21 | ALIGN JUMP_ALIGN |
---|
22 | BootMenuPrintCfg_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 | ;-------------------------------------------------------------------- |
---|
40 | .PushAndFormatCfgString: |
---|
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, BX |
---|
54 | ;-------------------------------------------------------------------- |
---|
55 | .PushAddressingMode: |
---|
56 | AccessDPT_GetUnshiftedAddressModeToALZF |
---|
57 | ;; |
---|
58 | ;; This multiply both shifts the addressing mode bits down to low order bits, and |
---|
59 | ;; at the same time multiplies by the size of the string displacement. The result is in AH, |
---|
60 | ;; with AL clear, and so we exchange AL and AH after the multiply for the final result. |
---|
61 | ;; |
---|
62 | mov bl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement |
---|
63 | mul bl |
---|
64 | xchg al,ah |
---|
65 | add ax,g_szAddressingModes |
---|
66 | push ax |
---|
67 | |
---|
68 | ;-------------------------------------------------------------------- |
---|
69 | ; PushBlockMode |
---|
70 | ; Parameters: |
---|
71 | ; DS:DI: Ptr to DPT |
---|
72 | ; CS:SI: Ptr to IDEVARS |
---|
73 | ; Returns: |
---|
74 | ; Nothing (falls to next push below) |
---|
75 | ; Corrupts registers: |
---|
76 | ; AX |
---|
77 | ;-------------------------------------------------------------------- |
---|
78 | .PushBlockMode: |
---|
79 | mov ax, 1 |
---|
80 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED |
---|
81 | jz SHORT .PushBlockSizeFromAX |
---|
82 | mov al, [di+DPT_ATA.bSetBlock] |
---|
83 | .PushBlockSizeFromAX: |
---|
84 | push ax |
---|
85 | |
---|
86 | ;-------------------------------------------------------------------- |
---|
87 | ; PushBusType |
---|
88 | ; Parameters: |
---|
89 | ; DS:DI: Ptr to DPT |
---|
90 | ; CS:SI: Ptr to IDEVARS |
---|
91 | ; Returns: |
---|
92 | ; Nothing (jumps to next push below) |
---|
93 | ; Corrupts registers: |
---|
94 | ; AX, DX |
---|
95 | ;-------------------------------------------------------------------- |
---|
96 | .PushBusType: |
---|
97 | mov al,g_szBusTypeValues_Displacement |
---|
98 | mul BYTE [cs:si+IDEVARS.bDevice] |
---|
99 | |
---|
100 | shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2 |
---|
101 | |
---|
102 | add ax,g_szBusTypeValues |
---|
103 | push ax |
---|
104 | |
---|
105 | ;-------------------------------------------------------------------- |
---|
106 | ; PushIRQ |
---|
107 | ; Parameters: |
---|
108 | ; DS:DI: Ptr to DPT |
---|
109 | ; CS:SI: Ptr to IDEVARS |
---|
110 | ; Returns: |
---|
111 | ; Nothing (falls to next push below) |
---|
112 | ; Corrupts registers: |
---|
113 | ; AX, DX |
---|
114 | ;-------------------------------------------------------------------- |
---|
115 | .PushIRQ: |
---|
116 | eMOVZX ax, BYTE [cs:si+IDEVARS.bIRQ] |
---|
117 | push ax |
---|
118 | |
---|
119 | ;-------------------------------------------------------------------- |
---|
120 | ; PushResetStatus |
---|
121 | ; Parameters: |
---|
122 | ; DS:DI: Ptr to DPT |
---|
123 | ; CS:SI: Ptr to IDEVARS |
---|
124 | ; Returns: |
---|
125 | ; Nothing (falls to next push below) |
---|
126 | ; Corrupts registers: |
---|
127 | ; AX |
---|
128 | ;-------------------------------------------------------------------- |
---|
129 | .PushResetStatus: |
---|
130 | mov al, [di+DPT.bFlagsHigh] |
---|
131 | and ax, MASKH_DPT_RESET |
---|
132 | push ax |
---|
133 | |
---|
134 | ;-------------------------------------------------------------------- |
---|
135 | ; PrintValuesFromStack |
---|
136 | ; Parameters: |
---|
137 | ; Stack: All formatting parameters |
---|
138 | ; Returns: |
---|
139 | ; Nothing |
---|
140 | ; Corrupts registers: |
---|
141 | ; AX, SI, DI |
---|
142 | ;-------------------------------------------------------------------- |
---|
143 | .PrintValuesFromStack: |
---|
144 | mov si, g_szCfgFormat |
---|
145 | jmp BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay |
---|
146 | |
---|