1 /**************************************************************************
2 gPXE - Network Bootstrap Program
4 Literature dealing with the network protocols:
8 BOOTP - RFC951, RFC2132 (vendor extensions)
9 DHCP - RFC2131, RFC2132 (options)
10 TFTP - RFC1350, RFC2347 (options), RFC2348 (blocksize), RFC2349 (tsize)
11 RPC - RFC1831, RFC1832 (XDR), RFC1833 (rpcbind/portmapper)
13 **************************************************************************/
15 FILE_LICENCE ( GPL2_OR_LATER
);
18 #include <gpxe/init.h>
19 #include <gpxe/features.h>
20 #include <gpxe/shell.h>
21 #include <gpxe/shell_banner.h>
22 #include <gpxe/image.h>
23 #include <usr/autoboot.h>
24 #include <config/general.h>
26 #define NORMAL "\033[0m"
27 #define BOLD "\033[1m"
28 #define CYAN "\033[36m"
33 * @ret rc Return status code
35 __asmcall
int main ( void ) {
36 struct feature
*feature
;
39 /* Some devices take an unreasonably long time to initialise */
40 printf ( PRODUCT_SHORT_NAME
" initialising devices..." );
46 * Print welcome banner
49 * If you wish to brand this build of gPXE, please do so by
50 * defining the string PRODUCT_NAME in config/general.h.
52 * While nothing in the GPL prevents you from removing all
53 * references to gPXE or http://etherboot.org, we prefer you
57 printf ( NORMAL
"\n\n" PRODUCT_NAME
"\n" BOLD
"gPXE " VERSION
58 NORMAL
" -- Open Source Boot Firmware -- "
59 CYAN
"http://etherboot.org" NORMAL
"\n"
61 for_each_table_entry ( feature
, FEATURES
)
62 printf ( " %s", feature
->name
);
65 /* Prompt for shell */
66 if ( shell_banner() ) {
67 /* User wants shell; just give them a shell */
70 /* User doesn't want shell; load and execute the first
71 * image, or autoboot() if we have no images. If
72 * booting fails for any reason, offer a second chance
73 * to enter the shell for diagnostics.
75 if ( have_images() ) {
76 for_each_image ( image
) {
88 shutdown ( SHUTDOWN_EXIT
| shutdown_exit_flags
);