Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

main.c 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**************************************************************************
  2. gPXE - Network Bootstrap Program
  3. Literature dealing with the network protocols:
  4. ARP - RFC826
  5. RARP - RFC903
  6. UDP - RFC768
  7. BOOTP - RFC951, RFC2132 (vendor extensions)
  8. DHCP - RFC2131, RFC2132 (options)
  9. TFTP - RFC1350, RFC2347 (options), RFC2348 (blocksize), RFC2349 (tsize)
  10. RPC - RFC1831, RFC1832 (XDR), RFC1833 (rpcbind/portmapper)
  11. NFS - RFC1094, RFC1813 (v3, useful for clarifications, not implemented)
  12. IGMP - RFC1112
  13. **************************************************************************/
  14. #include <stdio.h>
  15. #include <gpxe/init.h>
  16. #include <gpxe/features.h>
  17. #include <gpxe/shell.h>
  18. #include <gpxe/shell_banner.h>
  19. #include <usr/autoboot.h>
  20. #include <config/general.h>
  21. #define NORMAL "\033[0m"
  22. #define BOLD "\033[1m"
  23. #define CYAN "\033[36m"
  24. static struct feature features[0] __table_start ( struct feature, features );
  25. static struct feature features_end[0] __table_end ( struct feature, features );
  26. /**
  27. * Main entry point
  28. *
  29. * @ret rc Return status code
  30. */
  31. __asmcall int main ( void ) {
  32. struct feature *feature;
  33. /* Some devices take an unreasonably long time to initialise */
  34. printf ( PRODUCT_SHORT_NAME " initialising devices...\n" );
  35. initialise();
  36. startup();
  37. /*
  38. * Print welcome banner
  39. *
  40. *
  41. * If you wish to brand this build of gPXE, please do so by
  42. * defining the string PRODUCT_NAME in config/general.h.
  43. *
  44. * While nothing in the GPL prevents you from removing all
  45. * references to gPXE or http://etherboot.org, we prefer you
  46. * not to do so.
  47. *
  48. */
  49. printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "gPXE " VERSION
  50. NORMAL " -- Open Source Boot Firmware -- "
  51. CYAN "http://etherboot.org" NORMAL "\n"
  52. "Features:" );
  53. for ( feature = features ; feature < features_end ; feature++ )
  54. printf ( " %s", feature->name );
  55. printf ( "\n" );
  56. /* Prompt for shell */
  57. if ( shell_banner() ) {
  58. /* User wants shell; just give them a shell */
  59. shell();
  60. } else {
  61. /* User doesn't want shell; try booting. If booting
  62. * fails, offer a second chance to enter the shell for
  63. * diagnostics.
  64. */
  65. autoboot();
  66. if ( shell_banner() )
  67. shell();
  68. }
  69. shutdown ( SHUTDOWN_EXIT | shutdown_exit_flags );
  70. return 0;
  71. }