|
@@ -18,7 +18,8 @@
|
18
|
18
|
|
19
|
19
|
#include <stdio.h>
|
20
|
20
|
#include <console.h>
|
21
|
|
-#include <gpxe/timer.h>
|
|
21
|
+#include <unistd.h>
|
|
22
|
+#include <config/general.h>
|
22
|
23
|
#include <gpxe/shell_banner.h>
|
23
|
24
|
|
24
|
25
|
/** @file
|
|
@@ -27,28 +28,28 @@
|
27
|
28
|
*
|
28
|
29
|
*/
|
29
|
30
|
|
30
|
|
-#define BANNER_TIMEOUT ( 2 * TICKS_PER_SEC )
|
31
|
|
-
|
32
|
31
|
/**
|
33
|
32
|
* Print shell banner and prompt for shell entry
|
34
|
33
|
*
|
35
|
34
|
* @ret enter_shell User wants to enter shell
|
36
|
35
|
*/
|
37
|
36
|
int shell_banner ( void ) {
|
38
|
|
- unsigned long timeout = ( currticks() + BANNER_TIMEOUT );
|
|
37
|
+ int wait_count = 0;
|
39
|
38
|
int enter_shell = 0;
|
40
|
39
|
int key;
|
41
|
40
|
|
42
|
41
|
printf ( "\nPress Ctrl-B for the gPXE command line..." );
|
43
|
42
|
|
44
|
43
|
/* Wait for key */
|
45
|
|
- while ( currticks() < timeout ) {
|
|
44
|
+ while ( wait_count < BANNER_TIMEOUT ) {
|
46
|
45
|
if ( iskey() ) {
|
47
|
46
|
key = getchar();
|
48
|
47
|
if ( key == 0x02 /* Ctrl-B */ )
|
49
|
48
|
enter_shell = 1;
|
50
|
49
|
break;
|
51
|
50
|
}
|
|
51
|
+ mdelay(100);
|
|
52
|
+ wait_count++;
|
52
|
53
|
}
|
53
|
54
|
|
54
|
55
|
/* Clear the "Press Ctrl-B" line */
|