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 | ; Section containing code |
---|
9 | SECTION .text |
---|
10 | |
---|
11 | ;;; fall-into from BootMenuPrint_HardDiskRefreshInformation. |
---|
12 | |
---|
13 | ;-------------------------------------------------------------------- |
---|
14 | ; Prints Hard Disk configuration for drive handled by our BIOS. |
---|
15 | ; Cursor is set to configuration header string position. |
---|
16 | ; |
---|
17 | ; BootMenuPrintCfg_ForOurDrive |
---|
18 | ; Parameters: |
---|
19 | ; DS:DI: Pointer to DPT |
---|
20 | ; Returns: |
---|
21 | ; Nothing |
---|
22 | ; Corrupts registers: |
---|
23 | ; AX, BX, CX, DX |
---|
24 | ;-------------------------------------------------------------------- |
---|
25 | .BootMenuPrintCfg_ForOurDrive: |
---|
26 | eMOVZX ax, [di+DPT.bIdevarsOffset] |
---|
27 | xchg bx, ax ; CS:BX now points to IDEVARS |
---|
28 | ; Fall to .PushAndFormatCfgString |
---|
29 | |
---|
30 | ;-------------------------------------------------------------------- |
---|
31 | ; PushAddressingMode |
---|
32 | ; Parameters: |
---|
33 | ; DS:DI: Ptr to DPT |
---|
34 | ; CS:BX: Ptr to IDEVARS |
---|
35 | ; Returns: |
---|
36 | ; Nothing (jumps to next push below) |
---|
37 | ; Corrupts registers: |
---|
38 | ; AX, CX |
---|
39 | ;-------------------------------------------------------------------- |
---|
40 | .PushAddressingMode: |
---|
41 | AccessDPT_GetUnshiftedAddressModeToALZF |
---|
42 | ;; |
---|
43 | ;; This multiply both shifts the addressing mode bits down to low order bits, and |
---|
44 | ;; at the same time multiplies by the size of the string displacement. The result is in AH, |
---|
45 | ;; with AL clear, and so we exchange AL and AH after the multiply for the final result. |
---|
46 | ;; |
---|
47 | mov cl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement |
---|
48 | mul cl |
---|
49 | xchg al,ah |
---|
50 | add ax,g_szAddressingModes |
---|
51 | push ax |
---|
52 | |
---|
53 | ;-------------------------------------------------------------------- |
---|
54 | ; PushBlockMode |
---|
55 | ; Parameters: |
---|
56 | ; DS:DI: Ptr to DPT |
---|
57 | ; CS:BX: Ptr to IDEVARS |
---|
58 | ; Returns: |
---|
59 | ; Nothing (falls to next push below) |
---|
60 | ; Corrupts registers: |
---|
61 | ; AX |
---|
62 | ;-------------------------------------------------------------------- |
---|
63 | .PushBlockMode: |
---|
64 | mov ax, 1 |
---|
65 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED |
---|
66 | jz SHORT .PushBlockSizeFromAX |
---|
67 | mov al, [di+DPT_ATA.bBlockSize] |
---|
68 | .PushBlockSizeFromAX: |
---|
69 | push ax |
---|
70 | |
---|
71 | ;-------------------------------------------------------------------- |
---|
72 | ; PushBusType |
---|
73 | ; Parameters: |
---|
74 | ; DS:DI: Ptr to DPT |
---|
75 | ; CS:BX: Ptr to IDEVARS |
---|
76 | ; Returns: |
---|
77 | ; Nothing (jumps to next push below) |
---|
78 | ; Corrupts registers: |
---|
79 | ; AX, DX |
---|
80 | ;-------------------------------------------------------------------- |
---|
81 | .PushBusType: |
---|
82 | mov al,g_szBusTypeValues_Displacement |
---|
83 | mul BYTE [cs:bx+IDEVARS.bDevice] |
---|
84 | |
---|
85 | shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2 |
---|
86 | |
---|
87 | add ax,g_szBusTypeValues |
---|
88 | push ax |
---|
89 | |
---|
90 | ;-------------------------------------------------------------------- |
---|
91 | ; PushIRQ |
---|
92 | ; Parameters: |
---|
93 | ; DS:DI: Ptr to DPT |
---|
94 | ; CS:BX: Ptr to IDEVARS |
---|
95 | ; Returns: |
---|
96 | ; Nothing (falls to next push below) |
---|
97 | ; Corrupts registers: |
---|
98 | ; AX, DX |
---|
99 | ;-------------------------------------------------------------------- |
---|
100 | .PushIRQ: |
---|
101 | mov al, [cs:bx+IDEVARS.bIRQ] |
---|
102 | cbw |
---|
103 | push ax |
---|
104 | |
---|
105 | ;-------------------------------------------------------------------- |
---|
106 | ; PushResetStatus |
---|
107 | ; Parameters: |
---|
108 | ; DS:DI: Ptr to DPT |
---|
109 | ; CS:BX: Ptr to IDEVARS |
---|
110 | ; Returns: |
---|
111 | ; Nothing (falls to next push below) |
---|
112 | ; Corrupts registers: |
---|
113 | ; AX, BX, DX, ES |
---|
114 | ;-------------------------------------------------------------------- |
---|
115 | .PushResetStatus: |
---|
116 | xor ax, ax |
---|
117 | %ifdef MODULE_SERIAL |
---|
118 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE |
---|
119 | jnz SHORT .AlwaysSuccess |
---|
120 | mov al, [di+DPT_ATA.bInitError] |
---|
121 | .AlwaysSuccess: |
---|
122 | %endif |
---|
123 | push ax |
---|
124 | |
---|
125 | ;;; fall-out to BootMenuPrint_HardDiskRefreshInformation. |
---|