Changeset 88 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
- Timestamp:
- Jan 27, 2011, 8:14:13 AM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r3 r88 1 ; File name : BootMenuPrintCfg.asm 2 ; Project name : IDE BIOS 3 ; Created date : 28.3.2010 4 ; Last update : 9.4.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Functions for printing drive configuration 7 3 ; information on Boot Menu. … … 20 16 ; Nothing 21 17 ; Corrupts registers: 22 ; AX, BX, CX, DX, SI, ES18 ; AX, BX, CX, DX, SI, DI, ES 23 19 ;-------------------------------------------------------------------- 24 20 ALIGN JUMP_ALIGN … … 27 23 call BootMenuPrintCfg_GetPointers 28 24 call BootMenuPrintCfg_PushAndFormatCfgString 29 jmp BootMenuPrint_ ClearOneInfoLine25 jmp BootMenuPrint_Newline 30 26 31 27 … … 39 35 ; Nothing 40 36 ; Corrupts registers: 41 ; AX, BX, DX37 ; AX, SI, DI 42 38 ;-------------------------------------------------------------------- 43 39 ALIGN JUMP_ALIGN 44 40 BootMenuPrintCfg_HeaderAndChangeLine: 45 41 mov si, g_szCfgHeader 46 call Print String_FromCS47 jmp BootMenuPrint_ ClearOneInfoLine42 call PrintNullTerminatedStringFromCSSIandSetCF 43 jmp BootMenuPrint_Newline 48 44 49 45 … … 83 79 ; Nothing 84 80 ; Corrupts registers: 85 ; AX, CX, DX, SI81 ; AX, DX, SI, DI 86 82 ;-------------------------------------------------------------------- 87 83 ALIGN JUMP_ALIGN 88 84 BootMenuPrintCfg_PushAndFormatCfgString: 85 push bp 86 87 mov bp, sp 89 88 ; Fall to first push below 90 89 91 90 ;-------------------------------------------------------------------- 92 ; BootMenuPrintCfg_PushResetStatus 91 ; PushAddressingMode 92 ; Parameters: 93 ; DS:DI: Ptr to DPT 94 ; ES:BX: Ptr to BOOTNFO 95 ; CS:SI: Ptr to IDEVARS 96 ; Returns: 97 ; Nothing (jumps to next push below) 98 ; Corrupts registers: 99 ; AX, DX 100 ;-------------------------------------------------------------------- 101 PushAddressingMode: 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 108 ALIGN WORD_ALIGN 109 .rgszAddressingModeString: 110 dw g_szLCHS 111 dw g_szPCHS 112 dw g_szLBA28 113 dw g_szLBA48 114 ALIGN JUMP_ALIGN 115 .NextPush: 116 117 ;-------------------------------------------------------------------- 118 ; PushBlockMode 93 119 ; Parameters: 94 120 ; DS:DI: Ptr to DPT … … 100 126 ; AX 101 127 ;-------------------------------------------------------------------- 102 BootMenuPrintCfg_PushResetStatus:103 eMOVZX ax, BYTE [di+DPT.b Reset]128 PushBlockMode: 129 eMOVZX ax, BYTE [di+DPT.bSetBlock] 104 130 push ax 105 131 106 132 ;-------------------------------------------------------------------- 107 ; BootMenuPrintCfg_PushIRQ108 ; Parameters: 109 ; DS:DI: Ptr to DPT 110 ; ES:BX: Ptr to BOOTNFO 111 ; CS:SI: Ptr to IDEVARS 112 ; Returns: 113 ; Nothing ( falls to next push below)133 ; PushBusType 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) 114 140 ; Corrupts registers: 115 141 ; AX, DX 116 142 ;-------------------------------------------------------------------- 117 BootMenuPrintCfg_PushIRQ: 118 mov dl, ' ' ; Load space to DL 119 mov al, [cs:si+IDEVARS.bIRQ] 120 test al, al ; Interrupts disabled? 121 jz SHORT .PushIrqDisabled 122 add al, '0' ; Digit to ASCII 123 cmp al, '9' ; Only one digit needed? 124 jbe SHORT .PushCharacters 125 126 ; Two digits needed 127 sub al, 10 ; Limit to single digit ASCII 128 mov dl, '1' ; Load '1 to DX 129 jmp SHORT .PushCharacters 130 ALIGN JUMP_ALIGN 131 .PushIrqDisabled: 132 mov al, '-' ; Load line to AL 133 xchg ax, dx ; Space to AL, line to DL 134 ALIGN JUMP_ALIGN 135 .PushCharacters: 136 push ax 137 push dx 138 139 ;-------------------------------------------------------------------- 140 ; BootMenuPrintCfg_PushBusType 141 ; Parameters: 142 ; DS:DI: Ptr to DPT 143 ; ES:BX: Ptr to BOOTNFO 144 ; CS:SI: Ptr to IDEVARS 145 ; Returns: 146 ; Nothing (jumps to next push below) 147 ; Corrupts registers: 148 ; AX, DX 149 ;-------------------------------------------------------------------- 150 BootMenuPrintCfg_PushBusType: 143 PushBusType: 151 144 xchg ax, bx ; Store BX to AX 152 145 eMOVZX bx, BYTE [cs:si+IDEVARS.bBusType] 153 146 mov bx, [cs:bx+.rgwBusTypeValues] ; Char to BL, Int to BH 154 147 eMOVZX dx, bh 148 push bx ; Push character 155 149 push dx ; Push 8, 16 or 32 156 push bx ; Push character157 150 xchg bx, ax ; Restore BX 158 151 jmp SHORT .NextPush … … 167 160 168 161 ;-------------------------------------------------------------------- 169 ; BootMenuPrintCfg_PushBlockMode162 ; PushIRQ 170 163 ; Parameters: 171 164 ; DS:DI: Ptr to DPT … … 175 168 ; Nothing (falls to next push below) 176 169 ; Corrupts registers: 170 ; AX, DX 171 ;-------------------------------------------------------------------- 172 PushIRQ: 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 185 ALIGN JUMP_ALIGN 186 .PushIrqDisabled: 187 mov al, '-' ; Load line to AL 188 xchg ax, dx ; Space to AL, line to DL 189 ALIGN JUMP_ALIGN 190 .PushCharacters: 191 push dx 192 push ax 193 194 ;-------------------------------------------------------------------- 195 ; PushResetStatus 196 ; Parameters: 197 ; DS:DI: Ptr to DPT 198 ; ES:BX: Ptr to BOOTNFO 199 ; CS:SI: Ptr to IDEVARS 200 ; Returns: 201 ; Nothing (falls to next push below) 202 ; Corrupts registers: 177 203 ; AX 178 204 ;-------------------------------------------------------------------- 179 BootMenuPrintCfg_PushBlockMode:180 eMOVZX ax, BYTE [di+DPT.b SetBlock]205 PushResetStatus: 206 eMOVZX ax, BYTE [di+DPT.bReset] 181 207 push ax 182 208 183 209 ;-------------------------------------------------------------------- 184 ; BootMenuPrintCfg_PushAddressingMode185 ; Parameters:186 ; DS:DI: Ptr to DPT187 ; ES:BX: Ptr to BOOTNFO188 ; CS:SI: Ptr to IDEVARS189 ; Returns:190 ; Nothing (jumps to next push below)191 ; Corrupts registers:192 ; AX, DX193 ;--------------------------------------------------------------------194 BootMenuPrintCfg_PushAddressingMode:195 mov dx, bx ; Backup BX to DX196 mov bx, MASK_DPT_ADDR ; Load addressing mode mask197 and bl, [di+DPT.bFlags] ; Addressing mode now in BX198 push WORD [cs:bx+.rgszAddressingModeString]199 mov bx, dx200 jmp SHORT .NextPush201 ALIGN WORD_ALIGN202 .rgszAddressingModeString:203 dw g_szLCHS204 dw g_szPCHS205 dw g_szLBA28206 dw g_szLBA48207 ALIGN JUMP_ALIGN208 .NextPush:209 210 ;--------------------------------------------------------------------211 210 ; Prints formatted configuration string from parameters pushed to stack. 212 211 ; … … 217 216 ; Nothing 218 217 ; Corrupts registers: 219 ; AX, CX, DX, SI218 ; AX, SI, DI 220 219 ;-------------------------------------------------------------------- 221 220 BootMenuPrintCfg_ValuesFromStack: 222 221 mov si, g_szCfgFormat 223 mov dh, 14 ; 14 bytes pushed to stack 224 jmp PrintString_JumpToFormat 222 jmp PrintNullTerminatedStringFromCSSIandSetCF
Note:
See TracChangeset
for help on using the changeset viewer.