You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shell_banner.c 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <stdio.h>
  19. #include <console.h>
  20. #include <unistd.h>
  21. #include <config/general.h>
  22. #include <gpxe/keys.h>
  23. #include <gpxe/shell_banner.h>
  24. /** @file
  25. *
  26. * Shell startup banner
  27. *
  28. */
  29. /**
  30. * Print shell banner and prompt for shell entry
  31. *
  32. * @ret enter_shell User wants to enter shell
  33. */
  34. int shell_banner ( void ) {
  35. int enter_shell = 0;
  36. int wait_count;
  37. int key;
  38. printf ( "\nPress Ctrl-B for the gPXE command line..." );
  39. /* Wait for key */
  40. for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
  41. if ( iskey() ) {
  42. key = getchar();
  43. if ( key == CTRL_B )
  44. enter_shell = 1;
  45. break;
  46. }
  47. mdelay(100);
  48. }
  49. /* Clear the "Press Ctrl-B" line */
  50. printf ( "\r \r" );
  51. return enter_shell;
  52. }