[proto] Remove unsupported IGMP protocol
[gpxe.git] / src / core / main.c
blobd07d24c02d48de4a53de5d7ea03e36d3c4f4840c
1 /**************************************************************************
2 gPXE - Network Bootstrap Program
4 Literature dealing with the network protocols:
5 ARP - RFC826
6 RARP - RFC903
7 UDP - RFC768
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 );
17 #include <stdio.h>
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"
30 /**
31 * Main entry point
33 * @ret rc Return status code
35 __asmcall int main ( void ) {
36 struct feature *feature;
37 struct image *image;
39 /* Some devices take an unreasonably long time to initialise */
40 printf ( PRODUCT_SHORT_NAME " initialising devices...\n" );
42 initialise();
43 startup();
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
54 * not to do so.
57 printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "gPXE " VERSION
58 NORMAL " -- Open Source Boot Firmware -- "
59 CYAN "http://etherboot.org" NORMAL "\n"
60 "Features:" );
61 for_each_table_entry ( feature, FEATURES )
62 printf ( " %s", feature->name );
63 printf ( "\n" );
65 /* Prompt for shell */
66 if ( shell_banner() ) {
67 /* User wants shell; just give them a shell */
68 shell();
69 } else {
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 ) {
77 image_exec ( image );
78 break;
80 } else {
81 autoboot();
84 if ( shell_banner() )
85 shell();
88 shutdown ( SHUTDOWN_EXIT | shutdown_exit_flags );
90 return 0;