[392] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
| 2 | ; Description : Functions for printing drive configuration
|
---|
| 3 | ; information on Boot Menu.
|
---|
[399] | 4 | ;
|
---|
[392] | 5 | ; Included by BootMenuPrint.asm, this routine is to be inserted into
|
---|
[601] | 6 | ; BootMenuPrint_RefreshInformation.
|
---|
[392] | 7 | ;
|
---|
| 8 |
|
---|
| 9 | ;
|
---|
[399] | 10 | ; XTIDE Universal BIOS and Associated Tools
|
---|
[526] | 11 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
[392] | 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.
|
---|
[399] | 17 | ;
|
---|
[392] | 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.
|
---|
[399] | 22 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
[392] | 23 | ;
|
---|
[399] | 24 |
|
---|
[392] | 25 | ; Section containing code
|
---|
| 26 | SECTION .text
|
---|
| 27 |
|
---|
[601] | 28 | ;;; fall-into from BootMenuPrint_RefreshInformation.
|
---|
[392] | 29 |
|
---|
| 30 | ;--------------------------------------------------------------------
|
---|
| 31 | ; Prints Hard Disk configuration for drive handled by our BIOS.
|
---|
| 32 | ; Cursor is set to configuration header string position.
|
---|
| 33 | ;
|
---|
[601] | 34 | ; .BootMenuPrintCfg_ForOurDrive
|
---|
[392] | 35 | ; Parameters:
|
---|
| 36 | ; DS:DI: Pointer to DPT
|
---|
| 37 | ; Returns:
|
---|
| 38 | ; Nothing
|
---|
| 39 | ; Corrupts registers:
|
---|
[601] | 40 | ; AX, BX, DX
|
---|
[392] | 41 | ;--------------------------------------------------------------------
|
---|
| 42 | .BootMenuPrintCfg_ForOurDrive:
|
---|
[421] | 43 | ; Fall to .PushAddressingMode
|
---|
[392] | 44 |
|
---|
| 45 | ;--------------------------------------------------------------------
|
---|
[421] | 46 | ; .PushAddressingMode
|
---|
[392] | 47 | ; Parameters:
|
---|
| 48 | ; DS:DI: Ptr to DPT
|
---|
| 49 | ; Returns:
|
---|
[491] | 50 | ; Nothing (falls to next push below)
|
---|
[392] | 51 | ; Corrupts registers:
|
---|
[601] | 52 | ; AX, BX, DX
|
---|
[392] | 53 | ;--------------------------------------------------------------------
|
---|
| 54 | .PushAddressingMode:
|
---|
[568] | 55 | mov al, [di+DPT.bFlagsLow]
|
---|
| 56 | and ax, BYTE MASKL_DPT_TRANSLATEMODE
|
---|
[392] | 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 | ;;
|
---|
[592] | 62 | %ifdef USE_186
|
---|
| 63 | imul ax, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION)
|
---|
| 64 | %else
|
---|
[601] | 65 | mov bx, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION)
|
---|
| 66 | mul bx
|
---|
[592] | 67 | %endif
|
---|
[421] | 68 | xchg al, ah ; AL = always zero after above multiplication
|
---|
| 69 | add ax, g_szAddressingModes
|
---|
[392] | 70 | push ax
|
---|
[421] | 71 | ; Fall to .PushBlockMode
|
---|
[392] | 72 |
|
---|
| 73 | ;--------------------------------------------------------------------
|
---|
[421] | 74 | ; .PushBlockMode
|
---|
[392] | 75 | ; Parameters:
|
---|
| 76 | ; DS:DI: Ptr to DPT
|
---|
| 77 | ; Returns:
|
---|
| 78 | ; Nothing (falls to next push below)
|
---|
| 79 | ; Corrupts registers:
|
---|
| 80 | ; AX
|
---|
| 81 | ;--------------------------------------------------------------------
|
---|
| 82 | .PushBlockMode:
|
---|
| 83 | mov ax, 1
|
---|
[550] | 84 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS
|
---|
[392] | 85 | jz SHORT .PushBlockSizeFromAX
|
---|
| 86 | mov al, [di+DPT_ATA.bBlockSize]
|
---|
| 87 | .PushBlockSizeFromAX:
|
---|
| 88 | push ax
|
---|
[491] | 89 | ; Fall to .PushDeviceType
|
---|
[392] | 90 |
|
---|
| 91 | ;--------------------------------------------------------------------
|
---|
[491] | 92 | ; .PushDeviceType
|
---|
[392] | 93 | ; Parameters:
|
---|
| 94 | ; DS:DI: Ptr to DPT
|
---|
| 95 | ; Returns:
|
---|
[491] | 96 | ; Nothing (falls to next push below)
|
---|
[392] | 97 | ; Corrupts registers:
|
---|
[601] | 98 | ; AX, BX
|
---|
[392] | 99 | ;--------------------------------------------------------------------
|
---|
[473] | 100 | .PushDeviceType:
|
---|
[601] | 101 | call AccessDPT_GetIdevarsToCSBX
|
---|
[491] | 102 | %ifndef MODULE_SERIAL
|
---|
| 103 | mov al, g_szDeviceTypeValues_Displacement
|
---|
| 104 | mul BYTE [di+DPT_ATA.bDevice]
|
---|
| 105 | %else
|
---|
[473] | 106 | mov ah, [cs:bx+IDEVARS.bDevice]
|
---|
[491] | 107 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE ; Clears CF
|
---|
[473] | 108 | eCMOVZ ah, [di+DPT_ATA.bDevice] ; DPT_ATA contains up to date device information for IDE drives
|
---|
[491] | 109 | %ifdef USE_UNDOC_INTEL
|
---|
[568] | 110 | salc ; Clear AL using CF (from TEST above)
|
---|
[491] | 111 | eAAD g_szDeviceTypeValues_Displacement
|
---|
| 112 | %else
|
---|
| 113 | mov al, g_szDeviceTypeValues_Displacement
|
---|
[473] | 114 | mul ah
|
---|
[491] | 115 | %endif ; USE_UNDOC_INTEL
|
---|
| 116 | %endif ; MODULE_SERIAL
|
---|
| 117 |
|
---|
| 118 | %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
|
---|
| 119 | %if (COUNT_OF_ALL_IDE_DEVICES * 2 * g_szDeviceTypeValues_Displacement) > 255
|
---|
| 120 | %error "The USE_UNDOC_INTEL block in .PushDeviceType needs to be removed (would cause an overflow)!"
|
---|
| 121 | %endif
|
---|
[473] | 122 | %endif
|
---|
[392] | 123 |
|
---|
[491] | 124 | shr ax, 1 ; Divide by 2 since IDEVARS.bDevice is multiplied by 2
|
---|
[473] | 125 | add ax, g_szDeviceTypeValues
|
---|
[392] | 126 | push ax
|
---|
[491] | 127 | ; Fall to .PushIRQ
|
---|
[392] | 128 |
|
---|
| 129 | ;--------------------------------------------------------------------
|
---|
[491] | 130 | ; .PushIRQ
|
---|
[392] | 131 | ; Parameters:
|
---|
| 132 | ; DS:DI: Ptr to DPT
|
---|
| 133 | ; CS:BX: Ptr to IDEVARS
|
---|
| 134 | ; Returns:
|
---|
| 135 | ; Nothing (falls to next push below)
|
---|
| 136 | ; Corrupts registers:
|
---|
[491] | 137 | ; AX
|
---|
[392] | 138 | ;--------------------------------------------------------------------
|
---|
| 139 | .PushIRQ:
|
---|
| 140 | mov al, [cs:bx+IDEVARS.bIRQ]
|
---|
| 141 | cbw
|
---|
| 142 | push ax
|
---|
[491] | 143 | ; Fall to .PushResetStatus
|
---|
[392] | 144 |
|
---|
| 145 | ;--------------------------------------------------------------------
|
---|
[491] | 146 | ; .PushResetStatus
|
---|
[392] | 147 | ; Parameters:
|
---|
| 148 | ; DS:DI: Ptr to DPT
|
---|
| 149 | ; CS:BX: Ptr to IDEVARS
|
---|
| 150 | ; Returns:
|
---|
| 151 | ; Nothing (falls to next push below)
|
---|
| 152 | ; Corrupts registers:
|
---|
[601] | 153 | ; AL
|
---|
[392] | 154 | ;--------------------------------------------------------------------
|
---|
| 155 | .PushResetStatus:
|
---|
[422] | 156 | mov al, [di+DPT.bInitError]
|
---|
[392] | 157 | push ax
|
---|
| 158 |
|
---|
[601] | 159 | ;;; fall-out to BootMenuPrint_RefreshInformation.
|
---|