[isa] Fix a small typo in isa.c.
[ipxe.git] / src / hci / shell_banner.c
1 /*
2 * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #include <stdio.h>
20 #include <console.h>
21 #include <unistd.h>
22 #include <config/general.h>
23 #include <gpxe/keys.h>
24 #include <gpxe/shell_banner.h>
25
26 /** @file
27 *
28 * Shell startup banner
29 *
30 */
31
32 /**
33 * Print shell banner and prompt for shell entry
34 *
35 * @ret enter_shell User wants to enter shell
36 */
37 int shell_banner ( void ) {
38 int enter_shell = 0;
39 int wait_count;
40 int key;
41
42 printf ( "\nPress Ctrl-B for the gPXE command line..." );
43
44 /* Wait for key */
45 for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
46 if ( iskey() ) {
47 key = getchar();
48 if ( key == CTRL_B )
49 enter_shell = 1;
50 break;
51 }
52 mdelay(100);
53 }
54
55 /* Clear the "Press Ctrl-B" line */
56 printf ( "\r \r" );
57
58 return enter_shell;
59 }