Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

config.c 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License as
  4. * published by the Free Software Foundation; either version 2, or (at
  5. * your option) any later version.
  6. */
  7. #include "etherboot.h"
  8. #include "nic.h"
  9. #include "console.h"
  10. #ifdef BUILD_SERIAL
  11. #include ".buildserial.h"
  12. #define xstr(s) str(s)
  13. #define str(s) #s
  14. #endif
  15. void print_config(void)
  16. {
  17. printf( "Etherboot " VERSION
  18. #ifdef BUILD_SERIAL
  19. " [build "
  20. #ifdef BUILD_ID
  21. BUILD_ID " "
  22. #endif
  23. "#" xstr(BUILD_SERIAL_NUM) "]"
  24. #endif /* BUILD_SERIAL */
  25. " (GPL) http://etherboot.org\n"
  26. "Drivers: " );
  27. #ifdef CONFIG_PCI
  28. pci_enumerate();
  29. #endif
  30. #ifdef CONFIG_ISA
  31. isa_enumerate();
  32. #endif
  33. printf( " Images: "
  34. #ifdef TAGGED_IMAGE
  35. "NBI "
  36. #endif
  37. #ifdef ELF64_IMAGE
  38. "ELF64 "
  39. #endif
  40. #ifdef ELF_IMAGE
  41. "ELF "
  42. #endif
  43. #ifdef COFF_IMAGE
  44. "COFF "
  45. #endif
  46. #ifdef IMAGE_FREEBSD
  47. "FreeBSD "
  48. #endif
  49. #ifdef IMAGE_MULTIBOOT
  50. "Multiboot "
  51. #endif
  52. #ifdef AOUT_IMAGE
  53. "a.out "
  54. #endif
  55. #ifdef WINCE_IMAGE
  56. "WINCE "
  57. #endif
  58. #ifdef PXE_IMAGE
  59. "PXE "
  60. #endif
  61. #ifdef PXE_EXPORT /* All possible exports */
  62. " Exports: "
  63. #ifdef PXE_EXPORT
  64. "PXE "
  65. #endif
  66. #endif /* All possible exports */
  67. " "
  68. );
  69. #if (BOOTP_SERVER != 67) || (BOOTP_CLIENT != 68)
  70. printf( "[DHCP ports %d and %d] ",
  71. BOOTP_SERVER, BOOTP_CLIENT);
  72. #endif
  73. putchar('\n');
  74. printf( "Protocols: "
  75. #ifdef RARP_NOT_BOOTP
  76. "RARP "
  77. #else
  78. # ifndef NO_DHCP_SUPPORT
  79. "DHCP "
  80. # else
  81. "BOOTP "
  82. # endif
  83. #endif
  84. #ifdef DOWNLOAD_PROTO_TFTP
  85. "TFTP "
  86. #endif
  87. #ifdef DOWNLOAD_PROTO_NFS
  88. "NFS "
  89. #endif
  90. #ifdef DOWNLOAD_PROTO_SLAM
  91. "SLAM "
  92. #endif
  93. #ifdef DOWNLOAD_PROTO_TFTM
  94. "TFTM "
  95. #endif
  96. #ifdef DOWNLOAD_PROTO_HTTP
  97. "HTTP "
  98. #endif
  99. #ifdef PROTO_LACP
  100. "LACP "
  101. #endif
  102. #ifdef DNS_RESOLVER
  103. "DNS "
  104. #endif
  105. "\n");
  106. #ifdef KEEP_IT_REAL
  107. printf( "Keeping It Real [EXPERIMENTAL]\n" );
  108. #endif
  109. }
  110. static const char *driver_name[] = {
  111. "nic",
  112. "disk",
  113. "floppy",
  114. };
  115. int probe(struct dev *dev)
  116. {
  117. const char *type_name;
  118. type_name = "";
  119. if ((dev->type >= 0) &&
  120. ((unsigned)dev->type < sizeof(driver_name)/sizeof(driver_name[0]))) {
  121. type_name = driver_name[dev->type];
  122. }
  123. if (dev->how_probe == PROBE_FIRST) {
  124. dev->to_probe = PROBE_PCI;
  125. memset(&dev->state, 0, sizeof(dev->state));
  126. }
  127. if (dev->to_probe == PROBE_PCI) {
  128. #ifdef CONFIG_PCI
  129. dev->how_probe = pci_probe(dev, type_name);
  130. #else
  131. dev->how_probe = PROBE_FAILED;
  132. #endif
  133. if (dev->how_probe == PROBE_FAILED) {
  134. dev->to_probe = PROBE_ISA;
  135. }
  136. }
  137. if (dev->to_probe == PROBE_ISA) {
  138. #ifdef CONFIG_ISA
  139. dev->how_probe = isa_probe(dev, type_name);
  140. #else
  141. dev->how_probe = PROBE_FAILED;
  142. #endif
  143. if (dev->how_probe == PROBE_FAILED) {
  144. dev->to_probe = PROBE_NONE;
  145. }
  146. }
  147. if ((dev->to_probe != PROBE_PCI) &&
  148. (dev->to_probe != PROBE_ISA)) {
  149. dev->how_probe = PROBE_FAILED;
  150. }
  151. return dev->how_probe;
  152. }
  153. void disable(struct dev *dev)
  154. {
  155. if (dev->disable) {
  156. dev->disable(dev);
  157. dev->disable = 0;
  158. }
  159. }
  160. /*
  161. * Drag in all requested console types
  162. *
  163. * At least one of the CONSOLE_xxx has to be set. CONSOLE_DUAL sets
  164. * both CONSOLE_FIRMWARE and CONSOLE_SERIAL for legacy compatibility.
  165. * If no CONSOLE_xxx is set, CONSOLE_FIRMWARE is assumed.
  166. */
  167. #ifdef CONSOLE_CRT
  168. #define CONSOLE_FIRMWARE
  169. #endif
  170. #ifdef CONSOLE_DUAL
  171. #undef CONSOLE_FIRMWARE
  172. #define CONSOLE_FIRMWARE
  173. #undef CONSOLE_SERIAL
  174. #define CONSOLE_SERIAL
  175. #endif
  176. #if !defined(CONSOLE_FIRMWARE) && !defined(CONSOLE_SERIAL)
  177. #define CONSOLE_FIRMWARE
  178. #endif
  179. #ifdef CONSOLE_FIRMWARE
  180. REQUIRE_OBJECT ( bios_console );
  181. #endif
  182. #ifdef CONSOLE_SERIAL
  183. REQUIRE_OBJECT ( serial );
  184. #endif
  185. #ifdef CONSOLE_DIRECT_VGA
  186. REQUIRE_OBJECT ( video_subr );
  187. #endif
  188. #ifdef CONSOLE_BTEXT
  189. REQUIRE_OBJECT ( btext );
  190. #endif
  191. #ifdef CONSOLE_PC_KBD
  192. REQUIRE_OBJECT ( pc_kbd );
  193. #endif