iPXE
main.c
Go to the documentation of this file.
00001 /**************************************************************************
00002 iPXE -  Network Bootstrap Program
00003 
00004 Literature dealing with the network protocols:
00005         ARP - RFC826
00006         RARP - RFC903
00007         UDP - RFC768
00008         BOOTP - RFC951, RFC2132 (vendor extensions)
00009         DHCP - RFC2131, RFC2132 (options)
00010         TFTP - RFC1350, RFC2347 (options), RFC2348 (blocksize), RFC2349 (tsize)
00011         RPC - RFC1831, RFC1832 (XDR), RFC1833 (rpcbind/portmapper)
00012 
00013 **************************************************************************/
00014 
00015 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00016 
00017 #include <stddef.h>
00018 #include <stdio.h>
00019 #include <ipxe/init.h>
00020 #include <ipxe/version.h>
00021 #include <usr/autoboot.h>
00022 
00023 /**
00024  * Main entry point
00025  *
00026  * @ret rc              Return status code
00027  */
00028 __asmcall int main ( void ) {
00029         int rc;
00030 
00031         /* Perform one-time-only initialisation (e.g. heap) */
00032         initialise();
00033 
00034         /* Some devices take an unreasonably long time to initialise */
00035         printf ( "%s initialising devices...", product_short_name );
00036         startup();
00037         printf ( "ok\n" );
00038 
00039         /* Attempt to boot */
00040         if ( ( rc = ipxe ( NULL ) ) != 0 )
00041                 goto err_ipxe;
00042 
00043  err_ipxe:
00044         shutdown_exit();
00045         return rc;
00046 }