Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

327 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. hwdata.c
  5. Abstract:
  6. This module contains the C code to translate Video type to an
  7. ascii string.
  8. Author:
  9. Shie-Lin Tzong (shielint) 6-Jan-1991
  10. Revision History:
  11. --*/
  12. #include "hwdetect.h"
  13. #include "string.h"
  14. //
  15. // Video adaptor type identifiers.
  16. //
  17. PUCHAR VideoIdentifier[] = {
  18. "UNKNOWN",
  19. #if defined(NEC_98)
  20. "PC-98"
  21. #else // PC98
  22. "VGA",
  23. "COMPAQ AVGA",
  24. "COMPAQ QVIS",
  25. "8514",
  26. "GENOA VGA",
  27. "VIDEO7 VGA",
  28. "TRIDENT VGA",
  29. "PARADISE VGA", // should be removed
  30. "ATI VGA",
  31. "TSENGLAB VGA",
  32. "CIRRUS VGA",
  33. "DELL DGX",
  34. "S3 VGA",
  35. "NCR 77C22",
  36. "WD90C",
  37. "XGA"
  38. #endif // PC98
  39. };
  40. #if defined(NEC_98)
  41. PUCHAR PC98Specific[] = {
  42. " N_MODE"
  43. };
  44. #else // PC98
  45. //
  46. // 8514 Monitor type
  47. //
  48. PUCHAR x8514Specific[] = {
  49. " MONITOR UNKNOWN",
  50. " VGA MONITOR",
  51. " 8503 MONO",
  52. " 8514 GAD"
  53. };
  54. //
  55. // NCR 77C22 specific vga
  56. //
  57. PUCHAR NcrSpecific[] = {
  58. "",
  59. "E"
  60. };
  61. //
  62. // Western Digital 90Cxx specific vga
  63. //
  64. PUCHAR WdSpecific[] = {
  65. "",
  66. "00",
  67. "30",
  68. "31"
  69. };
  70. //
  71. // Video 7 specific vga
  72. //
  73. PUCHAR Video7Specific[] = {
  74. "",
  75. " VRAM",
  76. " DRAM"
  77. };
  78. //
  79. // Trident vga specific
  80. //
  81. PUCHAR TridentSpecific[] = {
  82. "",
  83. " 9100"
  84. };
  85. //
  86. // Paradize specific vga
  87. //
  88. PUCHAR ParadiseSpecific[] = {
  89. "",
  90. " PROM",
  91. " CHIP 1F"
  92. };
  93. //
  94. // Ati specific vga
  95. //
  96. PUCHAR AtiSpecific[] = {
  97. "",
  98. " WONDDER3"
  99. };
  100. //
  101. // Tsenglab specific vga
  102. //
  103. PUCHAR TsenglabSpecific[] = {
  104. " ET3000",
  105. " ET4000"
  106. };
  107. //
  108. // Cirrus Logic specific
  109. //
  110. PUCHAR CirrusSpecific[] = {
  111. "",
  112. " 610-620 REVC",
  113. " 5420r0",
  114. " 5420r1",
  115. " 5428",
  116. " 542x"
  117. };
  118. #endif // PC98
  119. FPFWCONFIGURATION_COMPONENT_DATA
  120. SetVideoConfigurationData (
  121. IN ULONG VideoType
  122. )
  123. /*++
  124. Routine Description:
  125. This routine maps VideoType information to an ASCII string and
  126. stores the string in configuration data heap.
  127. Arguments:
  128. VideoType - Supplies a ULONG which describes the video type information.
  129. Display type definitions.
  130. bit 0 0 - color; 1 - mono
  131. bit 1-7 Reserved
  132. bit 8-15 Adapter specific information.
  133. BIT 16-31 Defines video adapter type
  134. Returns:
  135. None.
  136. --*/
  137. {
  138. USHORT MajorType;
  139. USHORT SpecificType;
  140. USHORT MonitorType;
  141. FPFWCONFIGURATION_COMPONENT_DATA Controller, CurrentEntry;
  142. FPFWCONFIGURATION_COMPONENT Component;
  143. UCHAR TypeString[40];
  144. USHORT Length;
  145. //
  146. // Allocate configuration component space and initialize it.
  147. //
  148. Controller = (FPFWCONFIGURATION_COMPONENT_DATA)HwAllocateHeap (
  149. sizeof(FWCONFIGURATION_COMPONENT_DATA), TRUE);
  150. Component = &Controller->ComponentEntry;
  151. Component->Class = ControllerClass;
  152. Component->Type = DisplayController;
  153. Component->Flags.ConsoleOut = 1;
  154. Component->Flags.Output = 1;
  155. Component->Version = 0;
  156. Component->Key = 0;
  157. Component->AffinityMask = 0xffffffff;
  158. //
  159. // Set up Identifier string
  160. //
  161. #if defined(NEC_98)
  162. MajorType = (USHORT)((VideoType >> 16) & 1);
  163. SpecificType = (USHORT)((VideoType >> 20) & 1);
  164. #else // PC98
  165. MajorType = (USHORT)(VideoType >> 16);
  166. SpecificType = (USHORT)((VideoType & 0xffff) >> 8);
  167. #endif // PC98
  168. MonitorType = (USHORT)(VideoType & 1);
  169. strcpy(TypeString, VideoIdentifier[MajorType]);
  170. #if defined(NEC_98)
  171. strcat(TypeString, PC98Specific[SpecificType]);
  172. #else // PC98
  173. switch (MajorType){
  174. case 6: // Video 7
  175. strcat(TypeString, Video7Specific[SpecificType]);
  176. break;
  177. case 7: // Trident
  178. strcat(TypeString, TridentSpecific[SpecificType]);
  179. break;
  180. case 8: // Paradise
  181. strcat(TypeString, ParadiseSpecific[SpecificType]);
  182. break;
  183. case 9: // ATI
  184. strcat(TypeString, AtiSpecific[SpecificType]);
  185. break;
  186. case 10: // TsengLab
  187. strcat(TypeString, TsenglabSpecific[SpecificType]);
  188. break;
  189. case 11: // Cirrus
  190. strcat(TypeString, CirrusSpecific[SpecificType]);
  191. break;
  192. case 14: // NCR
  193. strcat(TypeString, NcrSpecific[SpecificType]);
  194. break;
  195. case 15: // NCR
  196. strcat(TypeString, WdSpecific[SpecificType]);
  197. break;
  198. default:
  199. break;
  200. }
  201. #endif // PC98
  202. //
  203. // Set up Identifier string for controller
  204. //
  205. Length = strlen(TypeString) + 1;
  206. Component->IdentifierLength = Length;
  207. Component->Identifier = (FPUCHAR)HwAllocateHeap(Length, FALSE);
  208. _fstrcpy(Component->Identifier, TypeString);
  209. Controller->ConfigurationData = NULL;
  210. Component->ConfigurationDataLength = 0;
  211. //
  212. // Set Up monitor peripheral
  213. //
  214. CurrentEntry = (FPFWCONFIGURATION_COMPONENT_DATA)HwAllocateHeap (
  215. sizeof(FWCONFIGURATION_COMPONENT_DATA), TRUE);
  216. Component = &CurrentEntry->ComponentEntry;
  217. Component->Class = PeripheralClass;
  218. Component->Type = MonitorPeripheral;
  219. Component->Flags.ConsoleOut = 1;
  220. Component->Flags.Output = 1;
  221. Component->Version = 0;
  222. Component->Key = 0;
  223. Component->AffinityMask = 0xffffffff;
  224. Component->ConfigurationDataLength = 0;
  225. CurrentEntry->ConfigurationData = NULL;
  226. //
  227. // If major type is 8514 we need to further supply monitor information
  228. //
  229. #if defined(NEC_98)
  230. if (MonitorType == 0) {
  231. strcpy(TypeString, "COLOR MONITOR");
  232. } else {
  233. strcpy(TypeString, "MONO MONITOR");
  234. }
  235. #else // PC98
  236. if (MajorType == 4) { // 8514
  237. strcpy(TypeString, x8514Specific[SpecificType]);
  238. } else if (MonitorType == 0) {
  239. strcpy(TypeString, "COLOR MONITOR");
  240. } else {
  241. strcpy(TypeString, "MONO MONITOR");
  242. }
  243. #endif // PC98
  244. //
  245. // Set up Identifier string for monitor peripheral.
  246. //
  247. Length = strlen(TypeString) + 1;
  248. Component->IdentifierLength = Length;
  249. Component->Identifier = (FPUCHAR)HwAllocateHeap(Length, FALSE);
  250. _fstrcpy(Component->Identifier, TypeString);
  251. //
  252. // Make monitor component be the child of video controller component
  253. //
  254. Controller->Child = CurrentEntry;
  255. Controller->Sibling = NULL;
  256. CurrentEntry->Parent = Controller;
  257. CurrentEntry->Sibling = NULL;
  258. CurrentEntry->Child = NULL;
  259. return(Controller);
  260. }