source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm @ 196

Last change on this file since 196 was 196, checked in by gregli@…, 12 years ago

Added printing of COM port and baud rate, when set explicitly by idecfg. Although it eats some bytes, I think it is worth it, since the BIOS will be looking for a server on a particular com port and baud rate, and it could be hard to troubleshoot a mismatch without this information. However, if we become space crunched, this change can be backed out.

File size: 2.6 KB
Line 
1; Project name  :   XTIDE Universal BIOS
2; Description   :   Functions for printing drive detection strings.
3
4; Section containing code
5SECTION .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:
16;       AX, SI, DI
17;--------------------------------------------------------------------
18DetectPrint_RomFoundAtSegment:
19    push    bp
20    mov     bp, sp
21    mov     si, g_szRomAt
22    ePUSH_T ax, ROMVARS.szTitle         ; Bios title string
23    push    cs                          ; BIOS segment
24       
25DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:     
26    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
27
28
29;--------------------------------------------------------------------
30; DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
31;   Parameters:
32;       CS:AX:  Ptr to "Master" or "Slave" string
33;       CS:BP:  Ptr to IDEVARS
34;       SI:     Ptr to template string 
35;   Returns:
36;       Nothing
37;   Corrupts registers:
38;       AX, SI, DI, CX
39;--------------------------------------------------------------------
40DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
41    push    bp
42    mov     di, [cs:bp+IDEVARS.wPort]
43%ifdef MODULE_SERIAL
44    mov     cx, [cs:bp+IDEVARS.wSerialPackedPrintBaud]
45%endif
46       
47    mov     bp, sp
48
49    push    ax                          ; Push "Master" or "Slave"
50       
51    push    di                          ; Push Port address or COM port number
52
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
76;--------------------------------------------------------------------
77; DetectPrint_DriveNameFromBootnfoInESBX
78;   Parameters:
79;       ES:BX:  Ptr to BOOTNFO (if drive found)
80;   Returns:
81;       Nothing
82;   Corrupts registers:
83;       AX, SI
84;--------------------------------------------------------------------
85DetectPrint_DriveNameFromBootnfoInESBX:
86    push    di
87    push    bx
88
89    lea     si, [bx+BOOTNFO.szDrvName]
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
99
Note: See TracBrowser for help on using the repository browser.