1 | /* $Id: Console.c 29070 2010-05-05 12:32:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Console.c - VirtualBox Console control emulation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.alldomusa.eu.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 | #include <Uefi.h>
|
---|
18 | #include <Library/UefiBootServicesTableLib.h>
|
---|
19 | #include <Library/DebugLib.h>
|
---|
20 |
|
---|
21 | #include "VBoxPkg.h"
|
---|
22 | #include "ConsoleControl.h"
|
---|
23 |
|
---|
24 | EFI_STATUS EFIAPI
|
---|
25 | GetModeImpl(
|
---|
26 | IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
---|
27 | OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
|
---|
28 | OUT BOOLEAN *GopUgaExists, OPTIONAL
|
---|
29 | OUT BOOLEAN *StdInLocked OPTIONAL
|
---|
30 | )
|
---|
31 | {
|
---|
32 | *Mode = EfiConsoleControlScreenGraphics;
|
---|
33 |
|
---|
34 | if (GopUgaExists)
|
---|
35 | *GopUgaExists = TRUE;
|
---|
36 | if (StdInLocked)
|
---|
37 | *StdInLocked = FALSE;
|
---|
38 | return EFI_SUCCESS;
|
---|
39 | }
|
---|
40 |
|
---|
41 | EFI_STATUS EFIAPI
|
---|
42 | SetModeImpl(
|
---|
43 | IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
---|
44 | IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
|
---|
45 | )
|
---|
46 | {
|
---|
47 | return EFI_SUCCESS;
|
---|
48 | }
|
---|
49 |
|
---|
50 | EFI_STATUS EFIAPI
|
---|
51 | LockStdInImpl(
|
---|
52 | IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
---|
53 | IN CHAR16 *Password
|
---|
54 | )
|
---|
55 | {
|
---|
56 | return EFI_SUCCESS;
|
---|
57 | }
|
---|
58 |
|
---|
59 |
|
---|
60 | EFI_CONSOLE_CONTROL_PROTOCOL gConsoleController =
|
---|
61 | {
|
---|
62 | GetModeImpl,
|
---|
63 | SetModeImpl,
|
---|
64 | LockStdInImpl
|
---|
65 | };
|
---|
66 |
|
---|
67 | EFI_GUID gEfiConsoleControlProtocolGuid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
|
---|
68 |
|
---|
69 | EFI_STATUS
|
---|
70 | EFIAPI
|
---|
71 | InitializeConsoleSim (
|
---|
72 | IN EFI_HANDLE ImageHandle,
|
---|
73 | IN EFI_SYSTEM_TABLE *SystemTable
|
---|
74 | )
|
---|
75 | {
|
---|
76 | EFI_STATUS Status;
|
---|
77 |
|
---|
78 | Status = gBS->InstallMultipleProtocolInterfaces (
|
---|
79 | &ImageHandle,
|
---|
80 | &gEfiConsoleControlProtocolGuid,
|
---|
81 | &gConsoleController,
|
---|
82 | NULL
|
---|
83 | );
|
---|
84 | ASSERT_EFI_ERROR (Status);
|
---|
85 |
|
---|
86 | return Status;
|
---|
87 | }
|
---|