main.c File Reference

#include <stdio.h>
#include <gpxe/init.h>
#include <gpxe/features.h>
#include <gpxe/shell.h>
#include <gpxe/shell_banner.h>
#include <gpxe/image.h>
#include <usr/autoboot.h>
#include <config/general.h>

Go to the source code of this file.

Defines

#define NORMAL   "\033[0m"
#define BOLD   "\033[1m"
#define CYAN   "\033[36m"

Functions

 FILE_LICENCE (GPL2_OR_LATER)
__asmcall int main (void)
 Main entry point.


Define Documentation

#define NORMAL   "\033[0m"

Definition at line 26 of file main.c.

Referenced by main().

#define BOLD   "\033[1m"

Definition at line 27 of file main.c.

Referenced by main().

#define CYAN   "\033[36m"

Definition at line 28 of file main.c.

Referenced by main().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

__asmcall int main ( void   ) 

Main entry point.

Return values:
rc Return status code

Definition at line 35 of file main.c.

References autoboot(), BOLD, CYAN, FEATURES, for_each_image, for_each_table_entry, have_images(), image_exec(), initialise(), feature::name, NORMAL, printf(), PRODUCT_NAME, PRODUCT_SHORT_NAME, shell(), shell_banner(), shutdown(), SHUTDOWN_EXIT, shutdown_exit_flags, and startup().

Referenced by _start().

00035                             {
00036         struct feature *feature;
00037         struct image *image;
00038 
00039         /* Some devices take an unreasonably long time to initialise */
00040         printf ( PRODUCT_SHORT_NAME " initialising devices...\n" );
00041 
00042         initialise();
00043         startup();
00044 
00045         /*
00046          * Print welcome banner
00047          *
00048          *
00049          * If you wish to brand this build of gPXE, please do so by
00050          * defining the string PRODUCT_NAME in config/general.h.
00051          *
00052          * While nothing in the GPL prevents you from removing all
00053          * references to gPXE or http://etherboot.org, we prefer you
00054          * not to do so.
00055          *
00056          */
00057         printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "gPXE " VERSION
00058                  NORMAL " -- Open Source Boot Firmware -- "
00059                  CYAN "http://etherboot.org" NORMAL "\n"
00060                  "Features:" );
00061         for_each_table_entry ( feature, FEATURES )
00062                 printf ( " %s", feature->name );
00063         printf ( "\n" );
00064 
00065         /* Prompt for shell */
00066         if ( shell_banner() ) {
00067                 /* User wants shell; just give them a shell */
00068                 shell();
00069         } else {
00070                 /* User doesn't want shell; load and execute the first
00071                  * image, or autoboot() if we have no images.  If
00072                  * booting fails for any reason, offer a second chance
00073                  * to enter the shell for diagnostics.
00074                  */
00075                 if ( have_images() ) {
00076                         for_each_image ( image ) {
00077                                 image_exec ( image );
00078                                 break;
00079                         }
00080                 } else {
00081                         autoboot();
00082                 }
00083 
00084                 if ( shell_banner() )
00085                         shell();
00086         }
00087 
00088         shutdown ( SHUTDOWN_EXIT | shutdown_exit_flags );
00089 
00090         return 0;
00091 }


Generated on Tue Apr 6 20:01:14 2010 for gPXE by  doxygen 1.5.7.1