54158396ae10117e9b91210f77f48c48da478b6f
[people/lynusvaz/gpxe.git] / src / core / config.c
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
8 #include "etherboot.h"
9 #include "dev.h"
10 #include "console.h"
11 #ifdef BUILD_SERIAL
12 #include ".buildserial.h"
13 #define xstr(s) str(s)
14 #define str(s) #s
15 #endif
16
17 void print_config ( void ) {
18         printf( "Etherboot " VERSION
19 #ifdef BUILD_SERIAL
20                 " [build " 
21 #ifdef BUILD_ID
22                 BUILD_ID " "
23 #endif
24                 "#" xstr(BUILD_SERIAL_NUM) "]"
25 #endif /* BUILD_SERIAL */
26                 " (GPL) http://etherboot.org\n"
27                 "Drivers: " );
28         print_drivers();
29         printf( "  Images: " 
30 #ifdef  TAGGED_IMAGE
31                 "NBI "
32 #endif
33 #ifdef  ELF64_IMAGE
34                 "ELF64 "
35 #endif
36 #ifdef  ELF_IMAGE
37                 "ELF "
38 #endif
39 #ifdef  COFF_IMAGE
40                 "COFF "
41 #endif
42 #ifdef  IMAGE_FREEBSD
43                 "FreeBSD "
44 #endif
45 #ifdef  IMAGE_MULTIBOOT
46                 "Multiboot "
47 #endif
48 #ifdef  AOUT_IMAGE
49                 "a.out "
50 #endif
51 #ifdef  WINCE_IMAGE
52                 "WINCE "
53 #endif
54 #ifdef  PXE_IMAGE
55                 "PXE "
56 #endif
57 #ifdef PXE_EXPORT /* All possible exports */
58                 "  Exports: "
59 #ifdef PXE_EXPORT
60                 "PXE "
61 #endif
62 #endif /* All possible exports */
63                 "  "
64                 );
65 #if     (BOOTP_SERVER != 67) || (BOOTP_CLIENT != 68)
66         printf( "[DHCP ports %d and %d] ",
67                 BOOTP_SERVER, BOOTP_CLIENT);
68 #endif
69         putchar('\n');
70         printf( "Protocols: "
71 #ifdef RARP_NOT_BOOTP
72                 "RARP "
73 #else
74 # ifndef NO_DHCP_SUPPORT
75                 "DHCP "
76 # else
77                 "BOOTP "
78 # endif
79 #endif
80 #ifdef DOWNLOAD_PROTO_TFTP
81                 "TFTP "
82 #endif
83 #ifdef  DOWNLOAD_PROTO_NFS
84                 "NFS "
85 #endif
86 #ifdef  DOWNLOAD_PROTO_SLAM
87                 "SLAM "
88 #endif
89 #ifdef  DOWNLOAD_PROTO_TFTM
90                 "TFTM "
91 #endif
92 #ifdef  DOWNLOAD_PROTO_HTTP
93                 "HTTP "
94 #endif
95 #ifdef  PROTO_LACP
96                 "LACP "
97 #endif
98 #ifdef DNS_RESOLVER
99                 "DNS "
100 #endif
101                 "\n");
102 #ifdef KEEP_IT_REAL
103         printf( "Keeping It Real [EXPERIMENTAL]\n" );
104 #endif
105 }
106
107 /*
108  * Drag in all requested console types
109  *
110  * At least one of the CONSOLE_xxx has to be set.  CONSOLE_DUAL sets
111  * both CONSOLE_FIRMWARE and CONSOLE_SERIAL for legacy compatibility.
112  * If no CONSOLE_xxx is set, CONSOLE_FIRMWARE is assumed.
113  *
114  */
115
116 #ifdef CONSOLE_CRT
117 #define CONSOLE_FIRMWARE
118 #endif
119
120 #ifdef  CONSOLE_DUAL
121 #undef CONSOLE_FIRMWARE
122 #define CONSOLE_FIRMWARE
123 #undef CONSOLE_SERIAL
124 #define CONSOLE_SERIAL
125 #endif
126
127 #if     !defined(CONSOLE_FIRMWARE) && !defined(CONSOLE_SERIAL)
128 #define CONSOLE_FIRMWARE
129 #endif
130
131 #ifdef CONSOLE_FIRMWARE
132 REQUIRE_OBJECT ( bios_console );
133 #endif
134
135 #ifdef CONSOLE_SERIAL
136 REQUIRE_OBJECT ( serial );
137 #endif
138
139 #ifdef CONSOLE_DIRECT_VGA
140 REQUIRE_OBJECT ( video_subr );
141 #endif
142
143 #ifdef CONSOLE_BTEXT
144 REQUIRE_OBJECT ( btext );
145 #endif
146
147 #ifdef CONSOLE_PC_KBD
148 REQUIRE_OBJECT ( pc_kbd );
149 #endif
150
151 /*
152  * Drag in relocate.o if required
153  *
154  */
155
156 #ifndef NORELOCATE
157 REQUIRE_OBJECT ( relocate );
158 #endif
159
160 /*
161  * Allow ISA probe address list to be overridden
162  *
163  */
164 #include "isa.h"
165 #ifndef ISA_PROBE_ADDRS
166 #define ISA_PROBE_ADDRS
167 #endif
168
169 isa_probe_addr_t isa_extra_probe_addrs[] = {
170         ISA_PROBE_ADDRS
171 };
172
173 unsigned int isa_extra_probe_addr_count
174       = sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] );