shell_banner.c File Reference

Shell startup banner. More...

#include <stdio.h>
#include <console.h>
#include <unistd.h>
#include <config/general.h>
#include <gpxe/keys.h>
#include <gpxe/shell_banner.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
int shell_banner (void)
 Print shell banner and prompt for shell entry.


Detailed Description

Shell startup banner.

Definition in file shell_banner.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

int shell_banner ( void   ) 

Print shell banner and prompt for shell entry.

Return values:
enter_shell User wants to enter shell

Definition at line 39 of file shell_banner.c.

References BANNER_TIMEOUT, CTRL_B, getchar(), iskey(), mdelay(), and printf().

Referenced by main().

00039                           {
00040         int enter_shell = 0;
00041         int wait_count;
00042         int key;
00043 
00044         if ( BANNER_TIMEOUT <=  0 ) {
00045                 return enter_shell;
00046         }
00047 
00048         printf ( "\nPress Ctrl-B for the gPXE command line..." );
00049 
00050         /* Wait for key */
00051         for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
00052                 if ( iskey() ) {
00053                         key = getchar();
00054                         if ( key == CTRL_B )
00055                                 enter_shell = 1;
00056                         break;
00057                 }
00058                 mdelay(100);
00059         }
00060 
00061         /* Clear the "Press Ctrl-B" line */
00062         printf ( "\r                                         \r" );
00063 
00064         return enter_shell;
00065 }


Generated on Tue Apr 6 20:01:47 2010 for gPXE by  doxygen 1.5.7.1