diff options
author | Andrew Schran | 2008-07-24 20:59:12 +0200 |
---|---|---|
committer | Michael Brown | 2008-07-24 20:59:12 +0200 |
commit | 833447392d0d6cc224a8743e40424c091b416d21 (patch) | |
tree | d308c5522159c31c9ad1c9ad3688cb693b124a44 /src/hci/shell_banner.c | |
parent | [tg3] Added support for tg3-5754. (diff) | |
download | ipxe-833447392d0d6cc224a8743e40424c091b416d21.tar.gz ipxe-833447392d0d6cc224a8743e40424c091b416d21.tar.xz ipxe-833447392d0d6cc224a8743e40424c091b416d21.zip |
[cmdline] Added configurable shell banner timeout
This change allows the time for which shell banners are displayed to
be configured in the config.h file. The ability to access the shell
can also be effectively disabled by setting this timeout to zero.
Diffstat (limited to 'src/hci/shell_banner.c')
-rw-r--r-- | src/hci/shell_banner.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/hci/shell_banner.c b/src/hci/shell_banner.c index 92cd17dd..f96f2a50 100644 --- a/src/hci/shell_banner.c +++ b/src/hci/shell_banner.c @@ -18,7 +18,8 @@ #include <stdio.h> #include <console.h> -#include <gpxe/timer.h> +#include <unistd.h> +#include <config/general.h> #include <gpxe/shell_banner.h> /** @file @@ -27,28 +28,28 @@ * */ -#define BANNER_TIMEOUT ( 2 * TICKS_PER_SEC ) - /** * Print shell banner and prompt for shell entry * * @ret enter_shell User wants to enter shell */ int shell_banner ( void ) { - unsigned long timeout = ( currticks() + BANNER_TIMEOUT ); + int wait_count = 0; int enter_shell = 0; int key; printf ( "\nPress Ctrl-B for the gPXE command line..." ); /* Wait for key */ - while ( currticks() < timeout ) { + while ( wait_count < BANNER_TIMEOUT ) { if ( iskey() ) { key = getchar(); if ( key == 0x02 /* Ctrl-B */ ) enter_shell = 1; break; } + mdelay(100); + wait_count++; } /* Clear the "Press Ctrl-B" line */ |