[88] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 2 | ; Description : Functions for printing drive configuration
|
---|
| 3 | ; information on Boot Menu.
|
---|
[258] | 4 | ;
|
---|
| 5 | ; Included by BootMenuPrint.asm, this routine is to be inserted into
|
---|
| 6 | ; BootMenuPrint_HardDiskRefreshInformation.
|
---|
| 7 | ;
|
---|
[3] | 8 | ; Section containing code
|
---|
| 9 | SECTION .text
|
---|
| 10 |
|
---|
[258] | 11 | ;;; fall-into from BootMenuPrint_HardDiskRefreshInformation.
|
---|
| 12 |
|
---|
[3] | 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:
|
---|
[241] | 19 | ; DS:DI: Pointer to DPT
|
---|
[3] | 20 | ; Returns:
|
---|
| 21 | ; Nothing
|
---|
| 22 | ; Corrupts registers:
|
---|
[258] | 23 | ; AX, BX, CX, DX
|
---|
[3] | 24 | ;--------------------------------------------------------------------
|
---|
[258] | 25 | .BootMenuPrintCfg_ForOurDrive:
|
---|
[150] | 26 | eMOVZX ax, BYTE [di+DPT.bIdevarsOffset]
|
---|
[258] | 27 | xchg bx, ax ; CS:BX now points to IDEVARS
|
---|
[194] | 28 | ; Fall to .PushAndFormatCfgString
|
---|
[3] | 29 |
|
---|
| 30 | ;--------------------------------------------------------------------
|
---|
[88] | 31 | ; PushAddressingMode
|
---|
[3] | 32 | ; Parameters:
|
---|
| 33 | ; DS:DI: Ptr to DPT
|
---|
[258] | 34 | ; CS:BX: Ptr to IDEVARS
|
---|
[3] | 35 | ; Returns:
|
---|
[88] | 36 | ; Nothing (jumps to next push below)
|
---|
[3] | 37 | ; Corrupts registers:
|
---|
[258] | 38 | ; AX, CX
|
---|
[3] | 39 | ;--------------------------------------------------------------------
|
---|
[194] | 40 | .PushAddressingMode:
|
---|
[200] | 41 | AccessDPT_GetUnshiftedAddressModeToALZF
|
---|
[193] | 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 | ;;
|
---|
[258] | 47 | mov cl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement
|
---|
| 48 | mul cl
|
---|
[193] | 49 | xchg al,ah
|
---|
[182] | 50 | add ax,g_szAddressingModes
|
---|
| 51 | push ax
|
---|
| 52 |
|
---|
[3] | 53 | ;--------------------------------------------------------------------
|
---|
[88] | 54 | ; PushBlockMode
|
---|
[3] | 55 | ; Parameters:
|
---|
| 56 | ; DS:DI: Ptr to DPT
|
---|
[258] | 57 | ; CS:BX: Ptr to IDEVARS
|
---|
[3] | 58 | ; Returns:
|
---|
| 59 | ; Nothing (falls to next push below)
|
---|
| 60 | ; Corrupts registers:
|
---|
[88] | 61 | ; AX
|
---|
[3] | 62 | ;--------------------------------------------------------------------
|
---|
[194] | 63 | .PushBlockMode:
|
---|
[150] | 64 | mov ax, 1
|
---|
[158] | 65 | test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
|
---|
[150] | 66 | jz SHORT .PushBlockSizeFromAX
|
---|
| 67 | mov al, [di+DPT_ATA.bSetBlock]
|
---|
| 68 | .PushBlockSizeFromAX:
|
---|
[3] | 69 | push ax
|
---|
| 70 |
|
---|
| 71 | ;--------------------------------------------------------------------
|
---|
[88] | 72 | ; PushBusType
|
---|
[3] | 73 | ; Parameters:
|
---|
| 74 | ; DS:DI: Ptr to DPT
|
---|
[258] | 75 | ; CS:BX: Ptr to IDEVARS
|
---|
[3] | 76 | ; Returns:
|
---|
| 77 | ; Nothing (jumps to next push below)
|
---|
| 78 | ; Corrupts registers:
|
---|
| 79 | ; AX, DX
|
---|
| 80 | ;--------------------------------------------------------------------
|
---|
[194] | 81 | .PushBusType:
|
---|
[182] | 82 | mov al,g_szBusTypeValues_Displacement
|
---|
[258] | 83 | mul BYTE [cs:bx+IDEVARS.bDevice]
|
---|
[186] | 84 |
|
---|
| 85 | shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2
|
---|
| 86 |
|
---|
[182] | 87 | add ax,g_szBusTypeValues
|
---|
| 88 | push ax
|
---|
| 89 |
|
---|
[3] | 90 | ;--------------------------------------------------------------------
|
---|
[88] | 91 | ; PushIRQ
|
---|
[3] | 92 | ; Parameters:
|
---|
| 93 | ; DS:DI: Ptr to DPT
|
---|
[258] | 94 | ; CS:BX: Ptr to IDEVARS
|
---|
[3] | 95 | ; Returns:
|
---|
| 96 | ; Nothing (falls to next push below)
|
---|
| 97 | ; Corrupts registers:
|
---|
[88] | 98 | ; AX, DX
|
---|
[3] | 99 | ;--------------------------------------------------------------------
|
---|
[194] | 100 | .PushIRQ:
|
---|
[258] | 101 | mov al, BYTE [cs:bx+IDEVARS.bIRQ]
|
---|
[241] | 102 | cbw
|
---|
[3] | 103 | push ax
|
---|
| 104 |
|
---|
| 105 | ;--------------------------------------------------------------------
|
---|
[88] | 106 | ; PushResetStatus
|
---|
[3] | 107 | ; Parameters:
|
---|
| 108 | ; DS:DI: Ptr to DPT
|
---|
[258] | 109 | ; CS:BX: Ptr to IDEVARS
|
---|
[3] | 110 | ; Returns:
|
---|
[88] | 111 | ; Nothing (falls to next push below)
|
---|
[3] | 112 | ; Corrupts registers:
|
---|
[88] | 113 | ; AX
|
---|
[3] | 114 | ;--------------------------------------------------------------------
|
---|
[194] | 115 | .PushResetStatus:
|
---|
[158] | 116 | mov al, [di+DPT.bFlagsHigh]
|
---|
[241] | 117 | and al, MASKH_DPT_RESET ; ah already zero from last push
|
---|
[88] | 118 | push ax
|
---|
[3] | 119 |
|
---|
[258] | 120 | ;;; fall-out to BootMenuPrint_HardDiskRefreshInformation.
|
---|