1 | ; File name : DetectPrint.asm |
---|
2 | ; Project name : IDE BIOS |
---|
3 | ; Created date : 28.3.2010 |
---|
4 | ; Last update : 9.4.2010 |
---|
5 | ; Author : Tomi Tilli |
---|
6 | ; Description : Functions for printing drive detection strings. |
---|
7 | |
---|
8 | ; Section containing code |
---|
9 | SECTION .text |
---|
10 | |
---|
11 | ;-------------------------------------------------------------------- |
---|
12 | ; Prints BIOS name and segment address where it is found. |
---|
13 | ; |
---|
14 | ; DetectPrint_RomFoundAtSegment |
---|
15 | ; Parameters: |
---|
16 | ; Nothing |
---|
17 | ; Returns: |
---|
18 | ; Nothing |
---|
19 | ; Corrupts registers: |
---|
20 | ; AX, CX, DX, SI |
---|
21 | ;-------------------------------------------------------------------- |
---|
22 | ALIGN JUMP_ALIGN |
---|
23 | DetectPrint_RomFoundAtSegment: |
---|
24 | push cs |
---|
25 | ePUSH_T ax, ROMVARS.szTitle |
---|
26 | mov si, g_szRomAt |
---|
27 | mov dh, 4 ; 4 bytes pushed to stack |
---|
28 | jmp PrintString_JumpToFormat |
---|
29 | |
---|
30 | |
---|
31 | ;-------------------------------------------------------------------- |
---|
32 | ; Displays IDE drive detection string for specific device. |
---|
33 | ; |
---|
34 | ; DetectPrint_StartingMasterDetect |
---|
35 | ; DetectPrint_StartingSlaveDetect |
---|
36 | ; Parameters: |
---|
37 | ; CS:BP: Ptr to IDEVARS |
---|
38 | ; Returns: |
---|
39 | ; Nothing |
---|
40 | ; Corrupts registers: |
---|
41 | ; AX, CX, DX, SI |
---|
42 | ;-------------------------------------------------------------------- |
---|
43 | ALIGN JUMP_ALIGN |
---|
44 | DetectPrint_StartingMasterDetect: |
---|
45 | mov ax, g_szMaster |
---|
46 | jmp SHORT DetectPrint_StartingDriveDetect |
---|
47 | ALIGN JUMP_ALIGN |
---|
48 | DetectPrint_StartingSlaveDetect: |
---|
49 | mov ax, g_szSlave |
---|
50 | ; Fall to DetectPrint_StartingDriveDetect |
---|
51 | |
---|
52 | ;-------------------------------------------------------------------- |
---|
53 | ; Displays IDE drive detection string. |
---|
54 | ; |
---|
55 | ; DetectPrint_StartingDriveDetect |
---|
56 | ; Parameters: |
---|
57 | ; AX: Offset to "Master" or "Slave" string |
---|
58 | ; CS:BP: Ptr to IDEVARS |
---|
59 | ; Returns: |
---|
60 | ; Nothing |
---|
61 | ; Corrupts registers: |
---|
62 | ; AX, CX, DX, SI |
---|
63 | ;-------------------------------------------------------------------- |
---|
64 | ALIGN JUMP_ALIGN |
---|
65 | DetectPrint_StartingDriveDetect: |
---|
66 | push WORD [cs:bp+IDEVARS.wPort] |
---|
67 | push ax |
---|
68 | mov si, g_szDetect |
---|
69 | mov dh, 4 ; 4 bytes pushed to stack |
---|
70 | jmp PrintString_JumpToFormat |
---|
71 | |
---|
72 | |
---|
73 | ;-------------------------------------------------------------------- |
---|
74 | ; Displays Detected Drive Name from BOOTVARS or |
---|
75 | ; drive not found string if no drive was found. |
---|
76 | ; |
---|
77 | ; DetectPrint_DriveNameOrNotFound |
---|
78 | ; Parameters: |
---|
79 | ; ES:BX: Ptr to BOOTNFO (if drive found) |
---|
80 | ; CF: Cleared if drive found |
---|
81 | ; Set it drive not found |
---|
82 | ; Returns: |
---|
83 | ; Nothing |
---|
84 | ; Corrupts registers: |
---|
85 | ; AX, DX, SI |
---|
86 | ;-------------------------------------------------------------------- |
---|
87 | ALIGN JUMP_ALIGN |
---|
88 | DetectPrint_DriveNameOrNotFound: |
---|
89 | jc SHORT .PrintDriveNotFound |
---|
90 | lea si, [bx+BOOTNFO.szDrvName] |
---|
91 | call PrintString_FromES |
---|
92 | jmp Print_Newline |
---|
93 | ALIGN JUMP_ALIGN |
---|
94 | .PrintDriveNotFound: |
---|
95 | mov si, g_szNotFound |
---|
96 | jmp PrintString_FromCS |
---|