[88] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 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:
|
---|
[127] | 14 | ; DS: Segment to DPT
|
---|
| 15 | ; Stack: Offset to DPT
|
---|
[3] | 16 | ; Returns:
|
---|
| 17 | ; Nothing
|
---|
| 18 | ; Corrupts registers:
|
---|
[150] | 19 | ; AX, BX, CX, DX, SI, DI
|
---|
[3] | 20 | ;--------------------------------------------------------------------
|
---|
| 21 | ALIGN JUMP_ALIGN
|
---|
| 22 | BootMenuPrintCfg_ForOurDrive:
|
---|
[96] | 23 | mov si, g_szCfgHeader
|
---|
| 24 | call BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
|
---|
[186] | 25 | pop di
|
---|
[150] | 26 | eMOVZX ax, BYTE [di+DPT.bIdevarsOffset]
|
---|
| 27 | xchg si, ax ; CS:SI now points to IDEVARS
|
---|
[96] | 28 | ; Fall to PushAndFormatCfgString
|
---|
[3] | 29 |
|
---|
| 30 | ;--------------------------------------------------------------------
|
---|
[96] | 31 | ; PushAndFormatCfgString
|
---|
[3] | 32 | ; Parameters:
|
---|
| 33 | ; DS:DI: Ptr to DPT
|
---|
| 34 | ; CS:SI: Ptr to IDEVARS
|
---|
| 35 | ; Returns:
|
---|
| 36 | ; Nothing
|
---|
| 37 | ; Corrupts registers:
|
---|
[88] | 38 | ; AX, DX, SI, DI
|
---|
[3] | 39 | ;--------------------------------------------------------------------
|
---|
[96] | 40 | PushAndFormatCfgString:
|
---|
[88] | 41 | push bp
|
---|
| 42 | mov bp, sp
|
---|
[3] | 43 | ; Fall to first push below
|
---|
| 44 |
|
---|
| 45 | ;--------------------------------------------------------------------
|
---|
[88] | 46 | ; PushAddressingMode
|
---|
[3] | 47 | ; Parameters:
|
---|
| 48 | ; DS:DI: Ptr to DPT
|
---|
| 49 | ; CS:SI: Ptr to IDEVARS
|
---|
| 50 | ; Returns:
|
---|
[88] | 51 | ; Nothing (jumps to next push below)
|
---|
[3] | 52 | ; Corrupts registers:
|
---|
[96] | 53 | ; AX
|
---|
[3] | 54 | ;--------------------------------------------------------------------
|
---|
[88] | 55 | PushAddressingMode:
|
---|
[150] | 56 | call AccessDPT_GetAddressingModeForWordLookToBX
|
---|
[182] | 57 | mov al,g_szAddressingModes_Displacement
|
---|
| 58 | mul bl
|
---|
| 59 | add ax,g_szAddressingModes
|
---|
| 60 | push ax
|
---|
| 61 |
|
---|
[3] | 62 | ;--------------------------------------------------------------------
|
---|
[88] | 63 | ; PushBlockMode
|
---|
[3] | 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:
|
---|
[88] | 70 | ; AX
|
---|
[3] | 71 | ;--------------------------------------------------------------------
|
---|
[88] | 72 | PushBlockMode:
|
---|
[150] | 73 | mov ax, 1
|
---|
[158] | 74 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
|
---|
[150] | 75 | jz SHORT .PushBlockSizeFromAX
|
---|
| 76 | mov al, [di+DPT_ATA.bSetBlock]
|
---|
| 77 | .PushBlockSizeFromAX:
|
---|
[3] | 78 | push ax
|
---|
| 79 |
|
---|
| 80 | ;--------------------------------------------------------------------
|
---|
[88] | 81 | ; PushBusType
|
---|
[3] | 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 | ;--------------------------------------------------------------------
|
---|
[181] | 90 | ;PushBusType:
|
---|
[182] | 91 | mov al,g_szBusTypeValues_Displacement
|
---|
| 92 | mul BYTE [cs:si+IDEVARS.bDevice]
|
---|
[186] | 93 |
|
---|
| 94 | shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2
|
---|
| 95 |
|
---|
[182] | 96 | add ax,g_szBusTypeValues
|
---|
| 97 | push ax
|
---|
| 98 |
|
---|
[3] | 99 | ;--------------------------------------------------------------------
|
---|
[88] | 100 | ; PushIRQ
|
---|
[3] | 101 | ; Parameters:
|
---|
| 102 | ; DS:DI: Ptr to DPT
|
---|
| 103 | ; CS:SI: Ptr to IDEVARS
|
---|
| 104 | ; Returns:
|
---|
| 105 | ; Nothing (falls to next push below)
|
---|
| 106 | ; Corrupts registers:
|
---|
[88] | 107 | ; AX, DX
|
---|
[3] | 108 | ;--------------------------------------------------------------------
|
---|
[88] | 109 | PushIRQ:
|
---|
[184] | 110 | eMOVZX ax, BYTE [cs:si+IDEVARS.bIRQ]
|
---|
[3] | 111 | push ax
|
---|
| 112 |
|
---|
| 113 | ;--------------------------------------------------------------------
|
---|
[88] | 114 | ; PushResetStatus
|
---|
[3] | 115 | ; Parameters:
|
---|
| 116 | ; DS:DI: Ptr to DPT
|
---|
| 117 | ; CS:SI: Ptr to IDEVARS
|
---|
| 118 | ; Returns:
|
---|
[88] | 119 | ; Nothing (falls to next push below)
|
---|
[3] | 120 | ; Corrupts registers:
|
---|
[88] | 121 | ; AX
|
---|
[3] | 122 | ;--------------------------------------------------------------------
|
---|
[88] | 123 | PushResetStatus:
|
---|
[158] | 124 | mov al, [di+DPT.bFlagsHigh]
|
---|
| 125 | and ax, MASKH_DPT_RESET
|
---|
[88] | 126 | push ax
|
---|
[3] | 127 |
|
---|
| 128 | ;--------------------------------------------------------------------
|
---|
[96] | 129 | ; PrintValuesFromStack
|
---|
[3] | 130 | ; Parameters:
|
---|
| 131 | ; Stack: All formatting parameters
|
---|
| 132 | ; Returns:
|
---|
| 133 | ; Nothing
|
---|
| 134 | ; Corrupts registers:
|
---|
[88] | 135 | ; AX, SI, DI
|
---|
[3] | 136 | ;--------------------------------------------------------------------
|
---|
[96] | 137 | PrintValuesFromStack:
|
---|
[3] | 138 | mov si, g_szCfgFormat
|
---|
[127] | 139 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[96] | 140 |
|
---|