[88] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 2 | ; Description : Functions for printing drive detection strings.
|
---|
| 3 |
|
---|
| 4 | ; Section containing code
|
---|
| 5 | SECTION .text
|
---|
| 6 |
|
---|
| 7 | ;--------------------------------------------------------------------
|
---|
| 8 | ; Prints BIOS name and segment address where it is found.
|
---|
| 9 | ;
|
---|
| 10 | ; DetectPrint_RomFoundAtSegment
|
---|
| 11 | ; Parameters:
|
---|
| 12 | ; Nothing
|
---|
| 13 | ; Returns:
|
---|
| 14 | ; Nothing
|
---|
| 15 | ; Corrupts registers:
|
---|
[120] | 16 | ; AX, SI, DI
|
---|
[3] | 17 | ;--------------------------------------------------------------------
|
---|
| 18 | DetectPrint_RomFoundAtSegment:
|
---|
[88] | 19 | push bp
|
---|
[97] | 20 | mov bp, sp
|
---|
[3] | 21 | mov si, g_szRomAt
|
---|
[88] | 22 | ePUSH_T ax, ROMVARS.szTitle ; Bios title string
|
---|
| 23 | push cs ; BIOS segment
|
---|
[192] | 24 |
|
---|
| 25 | DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:
|
---|
[88] | 26 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[3] | 27 |
|
---|
| 28 |
|
---|
| 29 | ;--------------------------------------------------------------------
|
---|
[97] | 30 | ; DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
|
---|
[3] | 31 | ; Parameters:
|
---|
[88] | 32 | ; CS:AX: Ptr to "Master" or "Slave" string
|
---|
[3] | 33 | ; CS:BP: Ptr to IDEVARS
|
---|
[189] | 34 | ; SI: Ptr to template string
|
---|
[3] | 35 | ; Returns:
|
---|
| 36 | ; Nothing
|
---|
| 37 | ; Corrupts registers:
|
---|
[196] | 38 | ; AX, SI, DI, CX
|
---|
[3] | 39 | ;--------------------------------------------------------------------
|
---|
[97] | 40 | DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
|
---|
[88] | 41 | push bp
|
---|
[189] | 42 | mov di, [cs:bp+IDEVARS.wPort]
|
---|
[196] | 43 | %ifdef MODULE_SERIAL
|
---|
| 44 | mov cx, [cs:bp+IDEVARS.wSerialPackedPrintBaud]
|
---|
| 45 | %endif
|
---|
| 46 |
|
---|
[88] | 47 | mov bp, sp
|
---|
[3] | 48 |
|
---|
[196] | 49 | push ax ; Push "Master" or "Slave"
|
---|
| 50 |
|
---|
| 51 | push di ; Push Port address or COM port number
|
---|
[3] | 52 |
|
---|
[196] | 53 | %ifdef MODULE_SERIAL
|
---|
| 54 | ;
|
---|
| 55 | ; Baud rate is packed into one word:
|
---|
| 56 | ; High order 6 bits: number to add to '0' to get postfix character ('0' or 'K')
|
---|
| 57 | ; Low order 10 bits: binary number to display (960, 240, 38, or 115)
|
---|
| 58 | ; To get 9600: '0'<<10 + 960
|
---|
| 59 | ; To get 2400: '0'<<10 + 240
|
---|
| 60 | ; To get 38K: ('K'-'0')<<10 + 38
|
---|
| 61 | ; To get 115K: ('K'-'0')<<10 + 115
|
---|
| 62 | ;
|
---|
| 63 | mov ax,cx ; Unpack baud rate number
|
---|
| 64 | and ax,03ffh
|
---|
| 65 | push ax
|
---|
| 66 |
|
---|
| 67 | mov al,ch ; Unpack baud rate postfix ('0' or 'K')
|
---|
| 68 | eSHR_IM al,2
|
---|
| 69 | add al,'0'
|
---|
| 70 | push ax
|
---|
| 71 | %endif
|
---|
| 72 |
|
---|
| 73 | jmp short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
|
---|
| 74 |
|
---|
| 75 |
|
---|
[3] | 76 | ;--------------------------------------------------------------------
|
---|
[98] | 77 | ; DetectPrint_DriveNameFromBootnfoInESBX
|
---|
[3] | 78 | ; Parameters:
|
---|
| 79 | ; ES:BX: Ptr to BOOTNFO (if drive found)
|
---|
| 80 | ; Returns:
|
---|
| 81 | ; Nothing
|
---|
| 82 | ; Corrupts registers:
|
---|
[88] | 83 | ; AX, SI
|
---|
[3] | 84 | ;--------------------------------------------------------------------
|
---|
[98] | 85 | DetectPrint_DriveNameFromBootnfoInESBX:
|
---|
[88] | 86 | push di
|
---|
| 87 | push bx
|
---|
| 88 |
|
---|
[3] | 89 | lea si, [bx+BOOTNFO.szDrvName]
|
---|
[88] | 90 | mov bx, es
|
---|
| 91 | CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
|
---|
| 92 | CALL_DISPLAY_LIBRARY PrintNewlineCharacters
|
---|
| 93 |
|
---|
| 94 | pop bx
|
---|
| 95 | pop di
|
---|
| 96 | ret
|
---|
| 97 |
|
---|
[98] | 98 |
|
---|
[196] | 99 |
|
---|