iPXE
Functions
main.c File Reference
#include <stddef.h>
#include <stdio.h>
#include <ipxe/init.h>
#include <ipxe/version.h>
#include <usr/autoboot.h>

Go to the source code of this file.

Functions

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

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
__asmcall int main ( void  )

Main entry point.

Return values:
rcReturn status code

Definition at line 28 of file main.c.

References initialise(), ipxe(), NULL, printf(), product_short_name, rc, shutdown_exit(), and startup().

Referenced by _efi_start().

                            {
        int rc;

        /* Perform one-time-only initialisation (e.g. heap) */
        initialise();

        /* Some devices take an unreasonably long time to initialise */
        printf ( "%s initialising devices...", product_short_name );
        startup();
        printf ( "ok\n" );

        /* Attempt to boot */
        if ( ( rc = ipxe ( NULL ) ) != 0 )
                goto err_ipxe;

 err_ipxe:
        shutdown_exit();
        return rc;
}