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 | pop di
|
---|
24 | mov si, g_szCfgHeader
|
---|
25 | call BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
|
---|
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
|
---|
54 | ;--------------------------------------------------------------------
|
---|
55 | PushAddressingMode:
|
---|
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 | ;--------------------------------------------------------------------
|
---|
72 | PushBlockMode:
|
---|
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 | shr ax,1
|
---|
94 | add ax,g_szBusTypeValues
|
---|
95 | push ax
|
---|
96 |
|
---|
97 | ;--------------------------------------------------------------------
|
---|
98 | ; PushIRQ
|
---|
99 | ; Parameters:
|
---|
100 | ; DS:DI: Ptr to DPT
|
---|
101 | ; CS:SI: Ptr to IDEVARS
|
---|
102 | ; Returns:
|
---|
103 | ; Nothing (falls to next push below)
|
---|
104 | ; Corrupts registers:
|
---|
105 | ; AX, DX
|
---|
106 | ;--------------------------------------------------------------------
|
---|
107 | PushIRQ:
|
---|
108 | eMOVZX ax, BYTE [cs:si+IDEVARS.bIRQ]
|
---|
109 | push ax
|
---|
110 |
|
---|
111 | ;--------------------------------------------------------------------
|
---|
112 | ; PushResetStatus
|
---|
113 | ; Parameters:
|
---|
114 | ; DS:DI: Ptr to DPT
|
---|
115 | ; CS:SI: Ptr to IDEVARS
|
---|
116 | ; Returns:
|
---|
117 | ; Nothing (falls to next push below)
|
---|
118 | ; Corrupts registers:
|
---|
119 | ; AX
|
---|
120 | ;--------------------------------------------------------------------
|
---|
121 | PushResetStatus:
|
---|
122 | mov al, [di+DPT.bFlagsHigh]
|
---|
123 | and ax, MASKH_DPT_RESET
|
---|
124 | push ax
|
---|
125 |
|
---|
126 | ;--------------------------------------------------------------------
|
---|
127 | ; PrintValuesFromStack
|
---|
128 | ; Parameters:
|
---|
129 | ; Stack: All formatting parameters
|
---|
130 | ; Returns:
|
---|
131 | ; Nothing
|
---|
132 | ; Corrupts registers:
|
---|
133 | ; AX, SI, DI
|
---|
134 | ;--------------------------------------------------------------------
|
---|
135 | PrintValuesFromStack:
|
---|
136 | mov si, g_szCfgFormat
|
---|
137 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
138 |
|
---|