Changeset 152 for sbliveos2/trunk/drv16/init.cpp
- Timestamp:
- Jul 17, 2000, 8:37:33 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/drv16/init.cpp
r151 r152 55 55 #include <include.h> // Pragmas and more. 56 56 #include <sbversion.h> 57 #include "commdbg.h" 58 #include <dbgos2.h> 57 59 58 60 #ifndef PCI_VENDOR_ID_CREATIVE … … 72 74 static char NEWLINE[] = "\r\n"; 73 75 static char szSBLiveNotFound[] = "SB Live! hardware not detected!"; 74 static char szAltF1[] = "Reboot, press Alt-F1 during OS/2 startup and select Enable Hardware Detection"; 76 static char szSBLiveConfig1[] = "SB Live! configuration: IRQ "; 77 static char szSBLiveConfig2[] = ", IO Port 0x"; 78 75 79 76 80 // … … 78 82 // Name is copied from header at runtime. 79 83 // 80 char szPddName [9] = {0}; 84 char szPddName[9] = {0}; 85 char digit[16] = {0}; 81 86 82 87 ResourceManager* pRM = 0; // Resource manager object. … … 122 127 123 128 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 124 DosWrite(1, (VOID FAR*)szSBLive, s trlen(szSBLive), &result);129 DosWrite(1, (VOID FAR*)szSBLive, sizeof(szSBLive)-1, &result); 125 130 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 126 131 … … 137 142 return; 138 143 } 139 else if (pRM->getState() != rmDriverCreated) {140 return;141 }142 144 143 145 //SvL: Check if SB Live hardware has been detected by the resource manager 144 // If not, tell user to reboot, press alt-f1 and enable hardware detection 145 if(!pRM->bIsDevDetected(PCI_ID, SEARCH_ID_DEVICEID, TRUE)) { 146 if(pRM->getState() != rmDriverCreated || !pRM->bIsDevDetected(PCI_ID, SEARCH_ID_DEVICEID, TRUE)) 147 { 148 hardware_notfound: 146 149 USHORT result; 147 150 148 DosWrite(1, (VOID FAR*)szSBLiveNotFound, strlen(szSBLiveNotFound), &result); 149 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 150 DosWrite(1, (VOID FAR*)szAltF1, sizeof(szAltF1), &result); 151 DosWrite(1, (VOID FAR*)szSBLiveNotFound, sizeof(szSBLiveNotFound)-1, &result); 152 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 151 153 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 152 154 return; 153 155 } 156 LDev_Resources *pResources = pRM->pGetDevResources(PCI_ID, SEARCH_ID_DEVICEID, TRUE); 157 if ((!pResources) || pResources->isEmpty()) { 158 goto hardware_notfound; 159 } 160 161 if (fVerbose) { 162 USHORT result; 163 164 DecWordToASCII(digit, (USHORT)pResources->uIRQLevel[0], 0); 165 DosWrite(1, (VOID FAR*)szSBLiveConfig1, sizeof(szSBLiveConfig1)-1, &result); 166 DosWrite(1, (VOID FAR*)digit, strlen(digit), &result); 167 168 DosWrite(1, (VOID FAR*)szSBLiveConfig2, sizeof(szSBLiveConfig2)-1, &result); 169 HexWordToASCII(digit, pResources->uIOBase[0], 0); 170 DosWrite(1, (VOID FAR*)digit, strlen(digit), &result); 171 172 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 173 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 174 } 175 delete pResources; 154 176 155 177 // Build the MPU401 object only if we got a good 2115 init.
Note:
See TracChangeset
for help on using the changeset viewer.