iPXE
main.c
Go to the documentation of this file.
1/**************************************************************************
2iPXE - Network Bootstrap Program
3
4Literature 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)
12
13**************************************************************************/
14
15FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
16FILE_SECBOOT ( PERMITTED );
17
18#include <stddef.h>
19#include <stdio.h>
20#include <ipxe/init.h>
21#include <ipxe/version.h>
22#include <usr/autoboot.h>
23
24/**
25 * Main entry point
26 *
27 * @ret rc Return status code
28 */
29__asmcall int main ( void ) {
30 int rc;
31
32 /* Perform one-time-only initialisation (e.g. heap) */
33 initialise();
34
35 /* Some devices take an unreasonably long time to initialise */
36 printf ( "%s initialising devices...\n", product_short_name );
37 startup();
38
39 /* Attempt to boot */
40 if ( ( rc = ipxe ( NULL ) ) != 0 )
41 goto err_ipxe;
42
43 err_ipxe:
45 return rc;
46}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
#define __asmcall
Declare a function with standard calling conventions.
Definition compiler.h:15
int ipxe(struct net_device *netdev)
Main iPXE flow of execution.
Definition autoboot.c:586
Automatic booting.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
void startup(void)
Start up iPXE.
Definition init.c:70
void initialise(void)
Initialise iPXE.
Definition init.c:53
static void shutdown_exit(void)
Shut down system for exit back to firmware.
Definition init.h:86
Version number.
__asmcall int main(void)
Main entry point.
Definition main.c:29
const char product_short_name[]
Product short name string.
Definition version.c:77
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition vsprintf.c:465