|
@@ -14,26 +14,54 @@ Literature dealing with the network protocols:
|
14
|
14
|
|
15
|
15
|
**************************************************************************/
|
16
|
16
|
|
|
17
|
+#include <stdio.h>
|
17
|
18
|
#include <gpxe/init.h>
|
|
19
|
+#include <gpxe/features.h>
|
18
|
20
|
#include <gpxe/shell.h>
|
19
|
21
|
#include <gpxe/shell_banner.h>
|
20
|
22
|
#include <usr/autoboot.h>
|
21
|
23
|
|
|
24
|
+#define NORMAL "\033[0m"
|
|
25
|
+#define BOLD "\033[1m"
|
|
26
|
+#define CYAN "\033[36m"
|
|
27
|
+
|
|
28
|
+static struct feature features[0] __table_start ( struct feature, features );
|
|
29
|
+static struct feature features_end[0] __table_end ( struct feature, features );
|
|
30
|
+
|
22
|
31
|
/**
|
23
|
32
|
* Main entry point
|
24
|
33
|
*
|
25
|
34
|
* @ret rc Return status code
|
26
|
35
|
*/
|
27
|
36
|
__cdecl int main ( void ) {
|
|
37
|
+ struct feature *feature;
|
28
|
38
|
|
29
|
39
|
initialise();
|
30
|
40
|
startup();
|
31
|
41
|
|
32
|
|
- if ( shell_banner() )
|
|
42
|
+ /* Print welcome banner */
|
|
43
|
+ printf ( NORMAL "\n\n\n" BOLD "gPXE " VERSION
|
|
44
|
+ NORMAL " -- Open Source Boot Firmware -- "
|
|
45
|
+ CYAN "http://etherboot.org" NORMAL "\n"
|
|
46
|
+ "Features:" );
|
|
47
|
+ for ( feature = features ; feature < features_end ; feature++ )
|
|
48
|
+ printf ( " %s", feature->name );
|
|
49
|
+ printf ( "\n" );
|
|
50
|
+
|
|
51
|
+ /* Prompt for shell */
|
|
52
|
+ if ( shell_banner() ) {
|
|
53
|
+ /* User wants shell; just give them a shell */
|
33
|
54
|
shell();
|
34
|
|
- else
|
|
55
|
+ } else {
|
|
56
|
+ /* User doesn't want shell; try booting. If booting
|
|
57
|
+ * fails, offer a second chance to enter the shell for
|
|
58
|
+ * diagnostics.
|
|
59
|
+ */
|
35
|
60
|
autoboot();
|
36
|
|
-
|
|
61
|
+ if ( shell_banner() )
|
|
62
|
+ shell();
|
|
63
|
+ }
|
|
64
|
+
|
37
|
65
|
shutdown();
|
38
|
66
|
|
39
|
67
|
return 0;
|