1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Functions for printing drive configuration
|
---|
3 | ; information on Boot Menu.
|
---|
4 | ;
|
---|
5 | ; Included by BootMenuPrint.asm, this routine is to be inserted into
|
---|
6 | ; BootMenuPrint_HardDiskRefreshInformation.
|
---|
7 | ;
|
---|
8 |
|
---|
9 | ;
|
---|
10 | ; XTIDE Universal BIOS and Associated Tools
|
---|
11 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
|
---|
12 | ;
|
---|
13 | ; This program is free software; you can redistribute it and/or modify
|
---|
14 | ; it under the terms of the GNU General Public License as published by
|
---|
15 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
16 | ; (at your option) any later version.
|
---|
17 | ;
|
---|
18 | ; This program is distributed in the hope that it will be useful,
|
---|
19 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
21 | ; GNU General Public License for more details.
|
---|
22 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
23 | ;
|
---|
24 |
|
---|
25 | ; Section containing code
|
---|
26 | SECTION .text
|
---|
27 |
|
---|
28 | ;;; fall-into from BootMenuPrint_HardDiskRefreshInformation.
|
---|
29 |
|
---|
30 | ;--------------------------------------------------------------------
|
---|
31 | ; Prints Hard Disk configuration for drive handled by our BIOS.
|
---|
32 | ; Cursor is set to configuration header string position.
|
---|
33 | ;
|
---|
34 | ; BootMenuPrintCfg_ForOurDrive
|
---|
35 | ; Parameters:
|
---|
36 | ; DS:DI: Pointer to DPT
|
---|
37 | ; Returns:
|
---|
38 | ; Nothing
|
---|
39 | ; Corrupts registers:
|
---|
40 | ; AX, BX, CX, DX
|
---|
41 | ;--------------------------------------------------------------------
|
---|
42 | .BootMenuPrintCfg_ForOurDrive:
|
---|
43 | eMOVZX ax, [di+DPT.bIdevarsOffset]
|
---|
44 | xchg bx, ax ; CS:BX now points to IDEVARS
|
---|
45 | ; Fall to .PushAndFormatCfgString
|
---|
46 |
|
---|
47 | ;--------------------------------------------------------------------
|
---|
48 | ; PushAddressingMode
|
---|
49 | ; Parameters:
|
---|
50 | ; DS:DI: Ptr to DPT
|
---|
51 | ; CS:BX: Ptr to IDEVARS
|
---|
52 | ; Returns:
|
---|
53 | ; Nothing (jumps to next push below)
|
---|
54 | ; Corrupts registers:
|
---|
55 | ; AX, CX
|
---|
56 | ;--------------------------------------------------------------------
|
---|
57 | .PushAddressingMode:
|
---|
58 | AccessDPT_GetUnshiftedAddressModeToALZF
|
---|
59 | ;;
|
---|
60 | ;; This multiply both shifts the addressing mode bits down to low order bits, and
|
---|
61 | ;; at the same time multiplies by the size of the string displacement. The result is in AH,
|
---|
62 | ;; with AL clear, and so we exchange AL and AH after the multiply for the final result.
|
---|
63 | ;;
|
---|
64 | mov cl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement
|
---|
65 | mul cl
|
---|
66 | xchg al,ah
|
---|
67 | add ax,g_szAddressingModes
|
---|
68 | push ax
|
---|
69 |
|
---|
70 | ;--------------------------------------------------------------------
|
---|
71 | ; PushBlockMode
|
---|
72 | ; Parameters:
|
---|
73 | ; DS:DI: Ptr to DPT
|
---|
74 | ; CS:BX: Ptr to IDEVARS
|
---|
75 | ; Returns:
|
---|
76 | ; Nothing (falls to next push below)
|
---|
77 | ; Corrupts registers:
|
---|
78 | ; AX
|
---|
79 | ;--------------------------------------------------------------------
|
---|
80 | .PushBlockMode:
|
---|
81 | mov ax, 1
|
---|
82 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
|
---|
83 | jz SHORT .PushBlockSizeFromAX
|
---|
84 | mov al, [di+DPT_ATA.bBlockSize]
|
---|
85 | .PushBlockSizeFromAX:
|
---|
86 | push ax
|
---|
87 |
|
---|
88 | ;--------------------------------------------------------------------
|
---|
89 | ; PushBusType
|
---|
90 | ; Parameters:
|
---|
91 | ; DS:DI: Ptr to DPT
|
---|
92 | ; CS:BX: Ptr to IDEVARS
|
---|
93 | ; Returns:
|
---|
94 | ; Nothing (jumps to next push below)
|
---|
95 | ; Corrupts registers:
|
---|
96 | ; AX, DX
|
---|
97 | ;--------------------------------------------------------------------
|
---|
98 | .PushBusType:
|
---|
99 | mov al,g_szBusTypeValues_Displacement
|
---|
100 | mul BYTE [cs:bx+IDEVARS.bDevice]
|
---|
101 |
|
---|
102 | shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2
|
---|
103 |
|
---|
104 | add ax,g_szBusTypeValues
|
---|
105 | push ax
|
---|
106 |
|
---|
107 | ;--------------------------------------------------------------------
|
---|
108 | ; PushIRQ
|
---|
109 | ; Parameters:
|
---|
110 | ; DS:DI: Ptr to DPT
|
---|
111 | ; CS:BX: Ptr to IDEVARS
|
---|
112 | ; Returns:
|
---|
113 | ; Nothing (falls to next push below)
|
---|
114 | ; Corrupts registers:
|
---|
115 | ; AX, DX
|
---|
116 | ;--------------------------------------------------------------------
|
---|
117 | .PushIRQ:
|
---|
118 | mov al, [cs:bx+IDEVARS.bIRQ]
|
---|
119 | cbw
|
---|
120 | push ax
|
---|
121 |
|
---|
122 | ;--------------------------------------------------------------------
|
---|
123 | ; PushResetStatus
|
---|
124 | ; Parameters:
|
---|
125 | ; DS:DI: Ptr to DPT
|
---|
126 | ; CS:BX: Ptr to IDEVARS
|
---|
127 | ; Returns:
|
---|
128 | ; Nothing (falls to next push below)
|
---|
129 | ; Corrupts registers:
|
---|
130 | ; AX, BX, DX, ES
|
---|
131 | ;--------------------------------------------------------------------
|
---|
132 | .PushResetStatus:
|
---|
133 | mov al, [di+DPT_ATA.bInitError]
|
---|
134 | push ax
|
---|
135 |
|
---|
136 | ;;; fall-out to BootMenuPrint_HardDiskRefreshInformation.
|
---|