Leaked source code of windows server 2003
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.

70 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1998 Intel Corporation
  3. Module Name:
  4. cls.c
  5. Abstract:
  6. Revision History
  7. --*/
  8. #include "shell.h"
  9. EFI_STATUS
  10. InitializeCls (
  11. IN EFI_HANDLE ImageHandle,
  12. IN EFI_SYSTEM_TABLE *SystemTable
  13. );
  14. EFI_DRIVER_ENTRY_POINT(InitializeCls)
  15. EFI_STATUS
  16. InitializeCls (
  17. IN EFI_HANDLE ImageHandle,
  18. IN EFI_SYSTEM_TABLE *SystemTable
  19. )
  20. {
  21. UINTN Background;
  22. /*
  23. * Check to see if the app is to install as a "internal command"
  24. * to the shell
  25. */
  26. InstallInternalShellCommand (
  27. ImageHandle, SystemTable, InitializeCls,
  28. L"cls", /* command */
  29. L"cls [background color]", /* command syntax */
  30. L"Clear screen", /* 1 line descriptor */
  31. NULL /* command help page */
  32. );
  33. /*
  34. * We are no being installed as an internal command driver, initialize
  35. * as an nshell app and run
  36. */
  37. InitializeShellApplication (ImageHandle, SystemTable);
  38. /*
  39. *
  40. */
  41. if ( SI->Argc > 1 ) {
  42. Background = xtoi(SI->Argv[1]);
  43. if (Background > EFI_LIGHTGRAY) {
  44. Background = EFI_BLACK;
  45. }
  46. ST->ConOut->SetAttribute(ST->ConOut,(ST->ConOut->Mode->Attribute & 0x0f) | (Background << 4));
  47. }
  48. ST->ConOut->ClearScreen(ST->ConOut);
  49. return EFI_SUCCESS;
  50. }