]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add in VgaClassDxe
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 13 Jul 2007 12:03:09 +0000 (12:03 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 13 Jul 2007 12:03:09 +0000 (12:03 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3236 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.c [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.h [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.c [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.h [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.msa [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf [new file with mode: 0644]

diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.c b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.c
new file mode 100644 (file)
index 0000000..b550a9d
--- /dev/null
@@ -0,0 +1,141 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. <BR> \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+\r
+Module Name:\r
+\r
+  ComponentName.c\r
+\r
+Abstract:\r
+\r
+--*/\r
+\r
+#include "VgaClass.h"\r
+\r
+//\r
+// EFI Component Name Protocol\r
+//\r
+EFI_COMPONENT_NAME_PROTOCOL     gVgaClassComponentName = {\r
+  VgaClassComponentNameGetDriverName,\r
+  VgaClassComponentNameGetControllerName,\r
+  "eng"\r
+};\r
+\r
+STATIC EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[] = {\r
+  {\r
+    "eng",\r
+    L"VGA Class Driver"\r
+  },\r
+  {\r
+    NULL,\r
+    NULL\r
+  }\r
+};\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
+\r
+  Arguments:\r
+    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+    Language   - A pointer to a three character ISO 639-2 language identifier.\r
+                 This is the language of the driver name that that the caller \r
+                 is requesting, and it must match one of the languages specified\r
+                 in SupportedLanguages.  The number of languages supported by a \r
+                 driver is up to the driver writer.\r
+    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
+                 is the name of the driver specified by This in the language \r
+                 specified by Language.\r
+\r
+  Returns:\r
+    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
+                            and the language specified by Language was returned \r
+                            in DriverName.\r
+    EFI_INVALID_PARAMETER - Language is NULL.\r
+    EFI_INVALID_PARAMETER - DriverName is NULL.\r
+    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
+                            language specified by Language.\r
+\r
+--*/\r
+{\r
+  return LookupUnicodeString (\r
+          Language,\r
+          gVgaClassComponentName.SupportedLanguages,\r
+          mVgaClassDriverNameTable,\r
+          DriverName\r
+          );\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Retrieves a Unicode string that is the user readable name of the controller\r
+    that is being managed by an EFI Driver.\r
+\r
+  Arguments:\r
+    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+    ControllerHandle - The handle of a controller that the driver specified by \r
+                       This is managing.  This handle specifies the controller \r
+                       whose name is to be returned.\r
+    ChildHandle      - The handle of the child controller to retrieve the name \r
+                       of.  This is an optional parameter that may be NULL.  It \r
+                       will be NULL for device drivers.  It will also be NULL \r
+                       for a bus drivers that wish to retrieve the name of the \r
+                       bus controller.  It will not be NULL for a bus driver \r
+                       that wishes to retrieve the name of a child controller.\r
+    Language         - A pointer to a three character ISO 639-2 language \r
+                       identifier.  This is the language of the controller name \r
+                       that that the caller is requesting, and it must match one\r
+                       of the languages specified in SupportedLanguages.  The \r
+                       number of languages supported by a driver is up to the \r
+                       driver writer.\r
+    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
+                       string is the name of the controller specified by \r
+                       ControllerHandle and ChildHandle in the language \r
+                       specified by Language from the point of view of the \r
+                       driver specified by This. \r
+\r
+  Returns:\r
+    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
+                            language specified by Language for the driver \r
+                            specified by This was returned in DriverName.\r
+    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
+    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r
+                            EFI_HANDLE.\r
+    EFI_INVALID_PARAMETER - Language is NULL.\r
+    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
+    EFI_UNSUPPORTED       - The driver specified by This is not currently \r
+                            managing the controller specified by \r
+                            ControllerHandle and ChildHandle.\r
+    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
+                            language specified by Language.\r
+\r
+--*/\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.h b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.h
new file mode 100644 (file)
index 0000000..a702f18
--- /dev/null
@@ -0,0 +1,90 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved.\r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+\r
+Module Name:\r
+\r
+    ComponentName.h\r
+\r
+Abstract:\r
+\r
+\r
+Revision History\r
+--*/\r
+\r
+#ifndef _VGA_CLASS_COMPONENT_NAME_H\r
+#define _VGA_CLASS_COMPONENT_NAME_H\r
+\r
+#include <PiDxe.h>\r
+#include <Protocol/ComponentName.h>\r
+\r
+extern EFI_COMPONENT_NAME_PROTOCOL  gVgaClassComponentName;\r
+\r
+//\r
+// EFI Component Name Functions\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This        - GC_TODO: add argument description\r
+  Language    - GC_TODO: add argument description\r
+  DriverName  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This              - GC_TODO: add argument description\r
+  ControllerHandle  - GC_TODO: add argument description\r
+  ChildHandle       - GC_TODO: add argument description\r
+  Language          - GC_TODO: add argument description\r
+  ControllerName    - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+#endif\r
diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.c b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.c
new file mode 100644 (file)
index 0000000..f5f60cd
--- /dev/null
@@ -0,0 +1,1405 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. <BR> \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+\r
+Module Name:\r
+\r
+    VgaClass.c\r
+    \r
+Abstract: \r
+    This driver produces a VGA console.\r
+    \r
+--*/\r
+\r
+#include "VgaClass.h"\r
+\r
+//\r
+// EFI Driver Binding Protocol for the VGA Class Driver\r
+//\r
+EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding = {\r
+  VgaClassDriverBindingSupported,\r
+  VgaClassDriverBindingStart,\r
+  VgaClassDriverBindingStop,\r
+  0xa,\r
+  NULL,\r
+  NULL\r
+};\r
+\r
+/**\r
+  The user Entry Point for module VgaClass. The user code starts with this function.\r
+\r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
+  @param[in] SystemTable    A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+  @retval other             Some error occurs when executing this entry point.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeVgaClass(\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS              Status;\r
+\r
+  //\r
+  // Install driver model protocol(s).\r
+  //\r
+  Status = EfiLibInstallAllDriverProtocols (\r
+             ImageHandle,\r
+             SystemTable,\r
+             &gVgaClassDriverBinding,\r
+             ImageHandle,\r
+             &gVgaClassComponentName,\r
+             NULL,\r
+             NULL\r
+             );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+\r
+  return Status;\r
+}\r
+\r
+//\r
+// Local variables\r
+//\r
+static CHAR16               CrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };\r
+\r
+typedef struct {\r
+  CHAR16  Unicode;\r
+  CHAR8   PcAnsi;\r
+  CHAR8   Ascii;\r
+} UNICODE_TO_CHAR;\r
+\r
+//\r
+// This list is used to define the valid extend chars.\r
+// It also provides a mapping from Unicode to PCANSI or\r
+// ASCII. The ASCII mapping we just made up.\r
+//\r
+//\r
+STATIC UNICODE_TO_CHAR  UnicodeToPcAnsiOrAscii[] = {\r
+  {\r
+    BOXDRAW_HORIZONTAL,\r
+    0xc4,\r
+    L'-'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL,\r
+    0xb3,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_RIGHT,\r
+    0xda,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_LEFT,\r
+    0xbf,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_UP_RIGHT,\r
+    0xc0,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_UP_LEFT,\r
+    0xd9,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_RIGHT,\r
+    0xc3,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_LEFT,\r
+    0xb4,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_HORIZONTAL,\r
+    0xc2,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_UP_HORIZONTAL,\r
+    0xc1,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_HORIZONTAL,\r
+    0xc5,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_HORIZONTAL,\r
+    0xcd,\r
+    L'-'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_VERTICAL,\r
+    0xba,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_RIGHT_DOUBLE,\r
+    0xd5,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_DOUBLE_RIGHT,\r
+    0xd6,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_DOWN_RIGHT,\r
+    0xc9,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_LEFT_DOUBLE,\r
+    0xb8,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_DOUBLE_LEFT,\r
+    0xb7,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_DOWN_LEFT,\r
+    0xbb,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_UP_RIGHT_DOUBLE,\r
+    0xd4,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_UP_DOUBLE_RIGHT,\r
+    0xd3,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_UP_RIGHT,\r
+    0xc8,\r
+    L'\\'\r
+  },\r
+  {\r
+    BOXDRAW_UP_LEFT_DOUBLE,\r
+    0xbe,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_UP_DOUBLE_LEFT,\r
+    0xbd,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_UP_LEFT,\r
+    0xbc,\r
+    L'/'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_RIGHT_DOUBLE,\r
+    0xc6,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_DOUBLE_RIGHT,\r
+    0xc7,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_VERTICAL_RIGHT,\r
+    0xcc,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_LEFT_DOUBLE,\r
+    0xb5,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_DOUBLE_LEFT,\r
+    0xb6,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_VERTICAL_LEFT,\r
+    0xb9,\r
+    L'|'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_HORIZONTAL_DOUBLE,\r
+    0xd1,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_DOWN_DOUBLE_HORIZONTAL,\r
+    0xd2,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_DOWN_HORIZONTAL,\r
+    0xcb,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_UP_HORIZONTAL_DOUBLE,\r
+    0xcf,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_UP_DOUBLE_HORIZONTAL,\r
+    0xd0,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_UP_HORIZONTAL,\r
+    0xca,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE,\r
+    0xd8,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL,\r
+    0xd7,\r
+    L'+'\r
+  },\r
+  {\r
+    BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL,\r
+    0xce,\r
+    L'+'\r
+  },\r
+\r
+  {\r
+    BLOCKELEMENT_FULL_BLOCK,\r
+    0xdb,\r
+    L'*'\r
+  },\r
+  {\r
+    BLOCKELEMENT_LIGHT_SHADE,\r
+    0xb0,\r
+    L'+'\r
+  },\r
+\r
+  {\r
+    GEOMETRICSHAPE_UP_TRIANGLE,\r
+    0x1e,\r
+    L'^'\r
+  },\r
+  {\r
+    GEOMETRICSHAPE_RIGHT_TRIANGLE,\r
+    0x10,\r
+    L'>'\r
+  },\r
+  {\r
+    GEOMETRICSHAPE_DOWN_TRIANGLE,\r
+    0x1f,\r
+    L'v'\r
+  },\r
+  {\r
+    GEOMETRICSHAPE_LEFT_TRIANGLE,\r
+    0x11,\r
+    L'<'\r
+  },\r
+\r
+  {\r
+    ARROW_LEFT,\r
+    0x3c,\r
+    L'<'\r
+  },\r
+\r
+  {\r
+    ARROW_UP,\r
+    0x18,\r
+    L'^'\r
+  },\r
+\r
+  {\r
+    ARROW_RIGHT,\r
+    0x3e,\r
+    L'>'\r
+  },\r
+\r
+  {\r
+    ARROW_DOWN,\r
+    0x19,\r
+    L'v'\r
+  },\r
+\r
+  {\r
+    0x0000,\r
+    0x00,\r
+    0x00\r
+  }\r
+};\r
+\r
+//\r
+// Private worker functions\r
+//\r
+STATIC\r
+VOID\r
+SetVideoCursorPosition (\r
+  IN  VGA_CLASS_DEV  *VgaClassDev,\r
+  IN  UINTN          Column,\r
+  IN  UINTN          Row,\r
+  IN  UINTN          MaxColumn\r
+  );\r
+\r
+STATIC\r
+VOID\r
+WriteCrtc (\r
+  IN  VGA_CLASS_DEV  *VgaClassDev,\r
+  IN  UINT16         Address,\r
+  IN  UINT8          Data\r
+  );\r
+\r
+STATIC\r
+BOOLEAN\r
+LibIsValidTextGraphics (\r
+  IN  CHAR16  Graphic,\r
+  OUT CHAR8   *PcAnsi, OPTIONAL\r
+  OUT CHAR8   *Ascii OPTIONAL\r
+  );\r
+\r
+STATIC\r
+BOOLEAN\r
+IsValidAscii (\r
+  IN  CHAR16  Ascii\r
+  );\r
+\r
+STATIC\r
+BOOLEAN\r
+IsValidEfiCntlChar (\r
+  IN  CHAR16  c\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
+  )\r
+/*++\r
+  \r
+  Routine Description:\r
+  \r
+    Supported.\r
+    \r
+  Arguments:\r
+  \r
+    (Standard DriverBinding Protocol Supported() function)\r
+    \r
+  Returns:\r
+  \r
+    EFI_STATUS\r
+  \r
+--*/\r
+// GC_TODO:    This - add argument and description to function comment\r
+// GC_TODO:    Controller - add argument and description to function comment\r
+// GC_TODO:    RemainingDevicePath - add argument and description to function comment\r
+{\r
+  EFI_STATUS                  Status;\r
+  EFI_VGA_MINI_PORT_PROTOCOL  *VgaMiniPort;\r
+\r
+  //\r
+  // Open the IO Abstraction(s) needed to perform the supported test\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiVgaMiniPortProtocolGuid,\r
+                  (VOID **) &VgaMiniPort,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  //\r
+  // Open the IO Abstraction(s) needed to perform the supported test\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  NULL,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
+  )\r
+/*++\r
+  \r
+  Routine Description:\r
+  \r
+    Layers the Simple Text Output Protocol on top of the \r
+    VGA Mini Port Protocol\r
+  \r
+  Arguments:\r
+  \r
+    (Standard DriverBinding Protocol Start() function)\r
+    \r
+  Returns:\r
+  \r
+    EFI_STATUS\r
+    \r
+--*/\r
+// GC_TODO:    This - add argument and description to function comment\r
+// GC_TODO:    Controller - add argument and description to function comment\r
+// GC_TODO:    RemainingDevicePath - add argument and description to function comment\r
+// GC_TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
+{\r
+  EFI_STATUS                  Status;\r
+  EFI_VGA_MINI_PORT_PROTOCOL  *VgaMiniPort;\r
+  EFI_PCI_IO_PROTOCOL         *PciIo;\r
+  VGA_CLASS_DEV               *VgaClassPrivate;\r
+  EFI_DEVICE_PATH_PROTOCOL    *DevicePath;\r
+\r
+  Status = gBS->HandleProtocol (\r
+                  Controller,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  (VOID **) &DevicePath\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  //\r
+  // Report that VGA Class driver is being enabled\r
+  //\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_ENABLE,\r
+    DevicePath\r
+    );\r
+\r
+  //\r
+  // Open the IO Abstraction(s) needed\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **) &PciIo,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiVgaMiniPortProtocolGuid,\r
+                  (VOID **) &VgaMiniPort,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  //\r
+  // Allocate the private device structure\r
+  //\r
+  Status = gBS->AllocatePool (\r
+                  EfiBootServicesData,\r
+                  sizeof (VGA_CLASS_DEV),\r
+                  (VOID **) &VgaClassPrivate\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    gBS->CloseProtocol (\r
+          Controller,\r
+          &gEfiVgaMiniPortProtocolGuid,\r
+          This->DriverBindingHandle,\r
+          Controller\r
+          );\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  ZeroMem (VgaClassPrivate, sizeof (VGA_CLASS_DEV));\r
+\r
+  //\r
+  // Initialize the private device structure\r
+  //\r
+  VgaClassPrivate->Signature                        = VGA_CLASS_DEV_SIGNATURE;\r
+  VgaClassPrivate->Handle = Controller;\r
+  VgaClassPrivate->VgaMiniPort = VgaMiniPort;\r
+  VgaClassPrivate->PciIo = PciIo;\r
+\r
+  VgaClassPrivate->SimpleTextOut.Reset = VgaClassReset;\r
+  VgaClassPrivate->SimpleTextOut.OutputString = VgaClassOutputString;\r
+  VgaClassPrivate->SimpleTextOut.TestString = VgaClassTestString;\r
+  VgaClassPrivate->SimpleTextOut.ClearScreen = VgaClassClearScreen;\r
+  VgaClassPrivate->SimpleTextOut.SetAttribute = VgaClassSetAttribute;\r
+  VgaClassPrivate->SimpleTextOut.SetCursorPosition = VgaClassSetCursorPosition;\r
+  VgaClassPrivate->SimpleTextOut.EnableCursor = VgaClassEnableCursor;\r
+  VgaClassPrivate->SimpleTextOut.QueryMode = VgaClassQueryMode;\r
+  VgaClassPrivate->SimpleTextOut.SetMode = VgaClassSetMode;\r
+\r
+  VgaClassPrivate->SimpleTextOut.Mode = &VgaClassPrivate->SimpleTextOutputMode;\r
+  VgaClassPrivate->SimpleTextOutputMode.MaxMode = VgaMiniPort->MaxMode;\r
+  VgaClassPrivate->DevicePath = DevicePath;\r
+\r
+  Status = VgaClassPrivate->SimpleTextOut.SetAttribute (\r
+                                            &VgaClassPrivate->SimpleTextOut,\r
+                                            EFI_TEXT_ATTR (EFI_WHITE,\r
+    EFI_BLACK)\r
+                                            );\r
+  if (EFI_ERROR (Status)) {\r
+    goto ErrorExit;\r
+  }\r
+\r
+  Status = VgaClassPrivate->SimpleTextOut.Reset (\r
+                                            &VgaClassPrivate->SimpleTextOut,\r
+                                            FALSE\r
+                                            );\r
+  if (EFI_ERROR (Status)) {\r
+    goto ErrorExit;\r
+  }\r
+\r
+  Status = VgaClassPrivate->SimpleTextOut.EnableCursor (\r
+                                            &VgaClassPrivate->SimpleTextOut,\r
+                                            TRUE\r
+                                            );\r
+  if (EFI_ERROR (Status)) {\r
+    goto ErrorExit;\r
+  }\r
+\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &Controller,\r
+                  &gEfiSimpleTextOutProtocolGuid,\r
+                  &VgaClassPrivate->SimpleTextOut,\r
+                  NULL\r
+                  );\r
+\r
+  return Status;\r
+\r
+ErrorExit:\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+    EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_CONTROLLER_ERROR,\r
+    DevicePath\r
+    );\r
+\r
+  return Status;\r
+\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingStop (\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN  EFI_HANDLE                      Controller,\r
+  IN  UINTN                           NumberOfChildren,\r
+  IN  EFI_HANDLE                      *ChildHandleBuffer\r
+  )\r
+/*++\r
+  \r
+  Routine Description:\r
+  \r
+    Stop.\r
+  \r
+  Arguments:\r
+  \r
+    (Standard DriverBinding Protocol Stop() function)\r
+  \r
+  Returns:\r
+  \r
+    EFI_STATUS\r
+  \r
+--*/\r
+// GC_TODO:    This - add argument and description to function comment\r
+// GC_TODO:    Controller - add argument and description to function comment\r
+// GC_TODO:    NumberOfChildren - add argument and description to function comment\r
+// GC_TODO:    ChildHandleBuffer - add argument and description to function comment\r
+// GC_TODO:    EFI_SUCCESS - add return value to function comment\r
+{\r
+  EFI_STATUS                    Status;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *SimpleTextOut;\r
+  VGA_CLASS_DEV                 *VgaClassPrivate;\r
+\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiSimpleTextOutProtocolGuid,\r
+                  (VOID **) &SimpleTextOut,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  VgaClassPrivate = VGA_CLASS_DEV_FROM_THIS (SimpleTextOut);\r
+\r
+  //\r
+  // Report that VGA Class driver is being disabled\r
+  //\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_DISABLE,\r
+    VgaClassPrivate->DevicePath\r
+    );\r
+\r
+  Status = gBS->UninstallProtocolInterface (\r
+                  Controller,\r
+                  &gEfiSimpleTextOutProtocolGuid,\r
+                  &VgaClassPrivate->SimpleTextOut\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  //\r
+  // Release PCI I/O and VGA Mini Port Protocols on the controller handle.\r
+  //\r
+  gBS->CloseProtocol (\r
+        Controller,\r
+        &gEfiPciIoProtocolGuid,\r
+        This->DriverBindingHandle,\r
+        Controller\r
+        );\r
+\r
+  gBS->CloseProtocol (\r
+        Controller,\r
+        &gEfiVgaMiniPortProtocolGuid,\r
+        This->DriverBindingHandle,\r
+        Controller\r
+        );\r
+\r
+  gBS->FreePool (VgaClassPrivate);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+//\r
+// Simple Text Output Protocol Functions\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassReset (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,\r
+  IN  BOOLEAN                             ExtendedVerification\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This                  - GC_TODO: add argument description\r
+  ExtendedVerification  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  VGA_CLASS_DEV *VgaClassPrivate;\r
+\r
+  VgaClassPrivate = VGA_CLASS_DEV_FROM_THIS (This);\r
+\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_RESET,\r
+    VgaClassPrivate->DevicePath\r
+    );\r
+\r
+  This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
+\r
+  Status = This->SetMode (This, 0);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return This->ClearScreen (This);\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassOutputString (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  CHAR16                          *WString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  WString - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                  Status;\r
+  VGA_CLASS_DEV               *VgaClassDev;\r
+  EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
+  UINTN                       MaxColumn;\r
+  UINTN                       MaxRow;\r
+  UINT32                      VideoChar;\r
+  CHAR8                       GraphicChar;\r
+\r
+  VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);\r
+\r
+  Mode        = This->Mode;\r
+\r
+  Status = This->QueryMode (\r
+                  This,\r
+                  Mode->Mode,\r
+                  &MaxColumn,\r
+                  &MaxRow\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  for (; *WString != CHAR_NULL; WString++) {\r
+\r
+    switch (*WString) {\r
+    case CHAR_BACKSPACE:\r
+      if (Mode->CursorColumn > 0) {\r
+        Mode->CursorColumn--;\r
+      }\r
+      break;\r
+\r
+    case CHAR_LINEFEED:\r
+      if (Mode->CursorRow == (INT32) (MaxRow - 1)) {\r
+        //\r
+        // Scroll the screen by copying the contents\r
+        // of the VGA display up one line\r
+        //\r
+        VgaClassDev->PciIo->CopyMem (\r
+                              VgaClassDev->PciIo,\r
+                              EfiPciIoWidthUint32,\r
+                              VgaClassDev->VgaMiniPort->VgaMemoryBar,\r
+                              VgaClassDev->VgaMiniPort->VgaMemoryOffset,\r
+                              VgaClassDev->VgaMiniPort->VgaMemoryBar,\r
+                              VgaClassDev->VgaMiniPort->VgaMemoryOffset + MaxColumn * 2,\r
+                              ((MaxRow - 1) * MaxColumn) >> 1\r
+                              );\r
+\r
+        //\r
+        // Print Blank Line of spaces with the current color attributes\r
+        //\r
+        VideoChar = (Mode->Attribute << 8) | ' ';\r
+        VideoChar = (VideoChar << 16) | VideoChar;\r
+        VgaClassDev->PciIo->Mem.Write (\r
+                                  VgaClassDev->PciIo,\r
+                                  EfiPciIoWidthFillUint32,\r
+                                  VgaClassDev->VgaMiniPort->VgaMemoryBar,\r
+                                  VgaClassDev->VgaMiniPort->VgaMemoryOffset + (MaxRow - 1) * MaxColumn * 2,\r
+                                  MaxColumn >> 1,\r
+                                  &VideoChar\r
+                                  );\r
+      }\r
+\r
+      if (Mode->CursorRow < (INT32) (MaxRow - 1)) {\r
+        Mode->CursorRow++;\r
+      }\r
+      break;\r
+\r
+    case CHAR_CARRIAGE_RETURN:\r
+      Mode->CursorColumn = 0;\r
+      break;\r
+\r
+    default:\r
+      if (!LibIsValidTextGraphics (*WString, &GraphicChar, NULL)) {\r
+        //\r
+        // Just convert to ASCII\r
+        //\r
+        GraphicChar = (CHAR8) *WString;\r
+        if (!IsValidAscii (GraphicChar)) {\r
+          //\r
+          // Keep the API from supporting PCANSI Graphics chars\r
+          //\r
+          GraphicChar = '?';\r
+        }\r
+      }\r
+\r
+      VideoChar = (Mode->Attribute << 8) | GraphicChar;\r
+      VgaClassDev->PciIo->Mem.Write (\r
+                                VgaClassDev->PciIo,\r
+                                EfiPciIoWidthUint16,\r
+                                VgaClassDev->VgaMiniPort->VgaMemoryBar,\r
+                                VgaClassDev->VgaMiniPort->VgaMemoryOffset + ((Mode->CursorRow * MaxColumn + Mode->CursorColumn) * 2),\r
+                                1,\r
+                                &VideoChar\r
+                                );\r
+\r
+      if (Mode->CursorColumn >= (INT32) (MaxColumn - 1)) {\r
+        This->OutputString (This, CrLfString);\r
+      } else {\r
+        Mode->CursorColumn++;\r
+      }\r
+      break;\r
+    }\r
+  }\r
+\r
+  SetVideoCursorPosition (\r
+    VgaClassDev,\r
+    (UINTN) Mode->CursorColumn,\r
+    (UINTN) Mode->CursorRow,\r
+    MaxColumn\r
+    );\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassTestString (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  CHAR16                          *WString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  WString - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  while (*WString != 0x0000) {\r
+    if (!(IsValidAscii (*WString) || IsValidEfiCntlChar (*WString) || LibIsValidTextGraphics (*WString, NULL, NULL))) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+\r
+    WString++;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassClearScreen (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  VGA_CLASS_DEV *VgaClassDev;\r
+  UINTN         MaxRow;\r
+  UINTN         MaxColumn;\r
+  UINT32        VideoChar;\r
+\r
+  VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);\r
+\r
+  Status = This->QueryMode (\r
+                  This,\r
+                  This->Mode->Mode,\r
+                  &MaxColumn,\r
+                  &MaxRow\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  VideoChar = (This->Mode->Attribute << 8) | ' ';\r
+  VideoChar = (VideoChar << 16) | VideoChar;\r
+  VgaClassDev->PciIo->Mem.Write (\r
+                            VgaClassDev->PciIo,\r
+                            EfiPciIoWidthFillUint32,\r
+                            VgaClassDev->VgaMiniPort->VgaMemoryBar,\r
+                            VgaClassDev->VgaMiniPort->VgaMemoryOffset,\r
+                            (MaxRow * MaxColumn) >> 1,\r
+                            &VideoChar\r
+                            );\r
+\r
+  This->SetCursorPosition (This, 0, 0);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetAttribute (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  UINTN                           Attribute\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This      - GC_TODO: add argument description\r
+  Attribute - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  if (Attribute <= EFI_MAX_ATTRIBUTE) {\r
+    This->Mode->Attribute = (INT32) Attribute;\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetCursorPosition (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  UINTN                           Column,\r
+  IN  UINTN                           Row\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  Column  - GC_TODO: add argument description\r
+  Row     - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  VGA_CLASS_DEV *VgaClassDev;\r
+  UINTN         MaxColumn;\r
+  UINTN         MaxRow;\r
+\r
+  VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);\r
+\r
+  Status = This->QueryMode (\r
+                  This,\r
+                  This->Mode->Mode,\r
+                  &MaxColumn,\r
+                  &MaxRow\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  if (Column >= MaxColumn || Row >= MaxRow) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  SetVideoCursorPosition (VgaClassDev, Column, Row, MaxColumn);\r
+\r
+  This->Mode->CursorColumn  = (INT32) Column;\r
+  This->Mode->CursorRow     = (INT32) Row;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassEnableCursor (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  BOOLEAN                         Visible\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  Visible - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  VGA_CLASS_DEV *VgaClassDev;\r
+\r
+  VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);\r
+  if (Visible) {\r
+    switch (This->Mode->Mode) {\r
+    case 1:\r
+      WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x06);\r
+      WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x07);\r
+      break;\r
+\r
+    default:\r
+      WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x0e);\r
+      WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x0f);\r
+      break;\r
+    }\r
+  } else {\r
+    WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x20);\r
+  }\r
+\r
+  This->Mode->CursorVisible = Visible;\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassQueryMode (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  UINTN                           ModeNumber,\r
+  OUT UINTN                           *Columns,\r
+  OUT UINTN                           *Rows\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This        - GC_TODO: add argument description\r
+  ModeNumber  - GC_TODO: add argument description\r
+  Columns     - GC_TODO: add argument description\r
+  Rows        - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+  EFI_SUCCESS - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  if ((INT32) ModeNumber >= This->Mode->MaxMode) {\r
+    *Columns  = 0;\r
+    *Rows     = 0;\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  switch (ModeNumber) {\r
+  case 0:\r
+    *Columns  = 80;\r
+    *Rows     = 25;\r
+    break;\r
+\r
+  case 1:\r
+    *Columns  = 80;\r
+    *Rows     = 50;\r
+    break;\r
+\r
+  default:\r
+    *Columns  = 0;\r
+    *Rows     = 0;\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetMode (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
+  IN  UINTN                           ModeNumber\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This        - GC_TODO: add argument description\r
+  ModeNumber  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  EFI_UNSUPPORTED - GC_TODO: Add description for return value\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  VGA_CLASS_DEV *VgaClassDev;\r
+\r
+  VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);\r
+\r
+  if ((INT32) ModeNumber >= This->Mode->MaxMode) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  This->ClearScreen (This);\r
+\r
+  This->Mode->Mode  = (INT32) ModeNumber;\r
+\r
+  Status            = VgaClassDev->VgaMiniPort->SetMode (VgaClassDev->VgaMiniPort, ModeNumber);\r
+\r
+  return Status;\r
+}\r
+//\r
+// Private Worker Functions\r
+//\r
+STATIC\r
+VOID\r
+SetVideoCursorPosition (\r
+  IN  VGA_CLASS_DEV  *VgaClassDev,\r
+  IN  UINTN          Column,\r
+  IN  UINTN          Row,\r
+  IN  UINTN          MaxColumn\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  VgaClassDev - GC_TODO: add argument description\r
+  Column      - GC_TODO: add argument description\r
+  Row         - GC_TODO: add argument description\r
+  MaxColumn   - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  Column    = Column & 0xff;\r
+  Row       = Row & 0xff;\r
+  MaxColumn = MaxColumn & 0xff;\r
+  WriteCrtc (\r
+    VgaClassDev,\r
+    CRTC_CURSOR_LOCATION_HIGH,\r
+    (UINT8) ((Row * MaxColumn + Column) >> 8)\r
+    );\r
+  WriteCrtc (\r
+    VgaClassDev,\r
+    CRTC_CURSOR_LOCATION_LOW,\r
+    (UINT8) ((Row * MaxColumn + Column) & 0xff)\r
+    );\r
+}\r
+\r
+STATIC\r
+VOID\r
+WriteCrtc (\r
+  IN  VGA_CLASS_DEV  *VgaClassDev,\r
+  IN  UINT16         Address,\r
+  IN  UINT8          Data\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  VgaClassDev - GC_TODO: add argument description\r
+  Address     - GC_TODO: add argument description\r
+  Data        - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  VgaClassDev->PciIo->Io.Write (\r
+                          VgaClassDev->PciIo,\r
+                          EfiPciIoWidthUint8,\r
+                          VgaClassDev->VgaMiniPort->CrtcAddressRegisterBar,\r
+                          VgaClassDev->VgaMiniPort->CrtcAddressRegisterOffset,\r
+                          1,\r
+                          &Address\r
+                          );\r
+\r
+  VgaClassDev->PciIo->Io.Write (\r
+                          VgaClassDev->PciIo,\r
+                          EfiPciIoWidthUint8,\r
+                          VgaClassDev->VgaMiniPort->CrtcDataRegisterBar,\r
+                          VgaClassDev->VgaMiniPort->CrtcDataRegisterOffset,\r
+                          1,\r
+                          &Data\r
+                          );\r
+}\r
+\r
+STATIC\r
+BOOLEAN\r
+LibIsValidTextGraphics (\r
+  IN  CHAR16  Graphic,\r
+  OUT CHAR8   *PcAnsi, OPTIONAL\r
+  OUT CHAR8   *Ascii OPTIONAL\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+    Detects if a Unicode char is for Box Drawing text graphics.\r
+\r
+Arguments:\r
+\r
+    Grphic  - Unicode char to test.\r
+\r
+    PcAnsi  - Optional pointer to return PCANSI equivalent of Graphic.\r
+\r
+    Asci    - Optional pointer to return Ascii equivalent of Graphic.\r
+\r
+Returns:\r
+\r
+    TRUE if Gpaphic is a supported Unicode Box Drawing character.\r
+\r
+--*/\r
+// GC_TODO:    Graphic - add argument and description to function comment\r
+{\r
+  UNICODE_TO_CHAR *Table;\r
+\r
+  if ((((Graphic & 0xff00) != 0x2500) && ((Graphic & 0xff00) != 0x2100))) {\r
+    //\r
+    // Unicode drawing code charts are all in the 0x25xx range,\r
+    //  arrows are 0x21xx\r
+    //\r
+    return FALSE;\r
+  }\r
+\r
+  for (Table = UnicodeToPcAnsiOrAscii; Table->Unicode != 0x0000; Table++) {\r
+    if (Graphic == Table->Unicode) {\r
+      if (PcAnsi) {\r
+        *PcAnsi = Table->PcAnsi;\r
+      }\r
+\r
+      if (Ascii) {\r
+        *Ascii = Table->Ascii;\r
+      }\r
+\r
+      return TRUE;\r
+    }\r
+  }\r
+\r
+  return FALSE;\r
+}\r
+\r
+STATIC\r
+BOOLEAN\r
+IsValidAscii (\r
+  IN  CHAR16  Ascii\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  Ascii - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  if ((Ascii >= 0x20) && (Ascii <= 0x7f)) {\r
+    return TRUE;\r
+  }\r
+\r
+  return FALSE;\r
+}\r
+\r
+STATIC\r
+BOOLEAN\r
+IsValidEfiCntlChar (\r
+  IN  CHAR16  c\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  c - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  if (c == CHAR_NULL || c == CHAR_BACKSPACE || c == CHAR_LINEFEED || c == CHAR_CARRIAGE_RETURN) {\r
+    return TRUE;\r
+  }\r
+\r
+  return FALSE;\r
+}\r
diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.h b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.h
new file mode 100644 (file)
index 0000000..aed4a84
--- /dev/null
@@ -0,0 +1,393 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+\r
+Module Name:\r
+\r
+    VgaClass.h\r
+    \r
+Abstract: \r
+    \r
+\r
+Revision History\r
+--*/\r
+\r
+#ifndef _VGA_CLASS_H\r
+#define _VGA_CLASS_H\r
+\r
+#include <PiDxe.h>\r
+#include <FrameworkDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextOut.h>\r
+#include <Protocol/PciIo.h>\r
+#include <Protocol/VgaMiniPort.h>\r
+#include <Protocol/DevicePath.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+\r
+\r
+#include <IndustryStandard/Pci22.h>\r
+#include "ComponentName.h"\r
+#include <Protocol/VgaMiniPort.h>\r
+\r
+//\r
+// VGA specific registers\r
+//\r
+#define CRTC_CURSOR_START         0xA\r
+#define CRTC_CURSOR_END           0xB\r
+\r
+#define CRTC_CURSOR_LOCATION_HIGH 0xE\r
+#define CRTC_CURSOR_LOCATION_LOW  0xF\r
+\r
+#define EFI_MAX_ATTRIBUTE         0x7f\r
+\r
+//\r
+// VGA Class Device Structure\r
+//\r
+#define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')\r
+\r
+typedef struct {\r
+  UINTN                         Signature;\r
+  EFI_HANDLE                    Handle;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  SimpleTextOut;\r
+  EFI_SIMPLE_TEXT_OUTPUT_MODE   SimpleTextOutputMode;\r
+  EFI_VGA_MINI_PORT_PROTOCOL    *VgaMiniPort;\r
+  EFI_PCI_IO_PROTOCOL           *PciIo;\r
+  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
+} VGA_CLASS_DEV;\r
+\r
+#define VGA_CLASS_DEV_FROM_THIS(a)  CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)\r
+\r
+//\r
+// Global Variables\r
+//\r
+extern EFI_DRIVER_BINDING_PROTOCOL  gVgaClassDriverBinding;\r
+\r
+//\r
+// Driver Binding Protocol functions\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL   *This,\r
+  IN EFI_HANDLE                    Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This                - GC_TODO: add argument description\r
+  Controller          - GC_TODO: add argument description\r
+  RemainingDevicePath - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL   *This,\r
+  IN EFI_HANDLE                    Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This                - GC_TODO: add argument description\r
+  Controller          - GC_TODO: add argument description\r
+  RemainingDevicePath - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassDriverBindingStop (\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   Controller,\r
+  IN  UINTN                        NumberOfChildren,\r
+  IN  EFI_HANDLE                   *ChildHandleBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This              - GC_TODO: add argument description\r
+  Controller        - GC_TODO: add argument description\r
+  NumberOfChildren  - GC_TODO: add argument description\r
+  ChildHandleBuffer - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Simple Text Output Protocol functions\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassReset (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  BOOLEAN                      ExtendedVerification\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This                  - GC_TODO: add argument description\r
+  ExtendedVerification  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassOutputString (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  CHAR16                       *WString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  WString - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassTestString (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  CHAR16                       *WString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  WString - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassClearScreen (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetAttribute (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  UINTN                        Attribute\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This      - GC_TODO: add argument description\r
+  Attribute - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetCursorPosition (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  UINTN                        Column,\r
+  IN  UINTN                        Row\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  Column  - GC_TODO: add argument description\r
+  Row     - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassEnableCursor (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  BOOLEAN                      Visible\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This    - GC_TODO: add argument description\r
+  Visible - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassQueryMode (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  UINTN                        ModeNumber,\r
+  OUT UINTN                        *Columns,\r
+  OUT UINTN                        *Rows\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This        - GC_TODO: add argument description\r
+  ModeNumber  - GC_TODO: add argument description\r
+  Columns     - GC_TODO: add argument description\r
+  Rows        - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VgaClassSetMode (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+  IN  UINTN                        ModeNumber\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  This        - GC_TODO: add argument description\r
+  ModeNumber  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+;\r
+\r
+#endif\r
diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.msa b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClass.msa
new file mode 100644 (file)
index 0000000..c1c79f8
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>VgaClass</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>BF89F10D-B205-474f-96E3-7A7BB1B4A407</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for VgaClass module.</Abstract>\r
+    <Description>This driver produces a VGA console.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+    <License>All rights reserved.\r
+      This software and associated documentation (if any) is furnished\r
+      under a license and may only be used or copied in accordance\r
+      with the terms of the license. Except as permitted by such\r
+      license, no part of this software or documentation may be\r
+      reproduced, stored in a retrieval system, or transmitted in any\r
+      form or by any means without the express written consent of\r
+      Intel Corporation.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>VgaClass</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiDriverModelLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiDriverEntryPoint</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DevicePathLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>ReportStatusCodeLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>VgaClass.c</Filename>\r
+    <Filename>VgaClass.h</Filename>\r
+    <Filename>ComponentName.h</Filename>\r
+    <Filename>ComponentName.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+    <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
+    <Package PackageGuid="bea835f9-fd62-464a-81ff-f3a806360c6b"/>\r
+  </PackageDependencies>\r
+  <Protocols>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiPciIoProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiVgaMiniPortProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiSimpleTextInProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+  </Protocols>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+    <Extern>\r
+      <DriverBinding>gVgaClassDriverBinding</DriverBinding>\r
+      <ComponentName>gVgaClassComponentName</ComponentName>\r
+    </Extern>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf b/IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf
new file mode 100644 (file)
index 0000000..8acb941
--- /dev/null
@@ -0,0 +1,103 @@
+#/** @file\r
+# Component description file for VgaClass module.\r
+#\r
+# This driver produces a VGA console.\r
+# Copyright (c) 2006, Intel Corporation.\r
+#\r
+#  All rights reserved.\r
+#  This software and associated documentation (if any) is furnished\r
+#  under a license and may only be used or copied in accordance\r
+#  with the terms of the license. Except as permitted by such\r
+#  license, no part of this software or documentation may be\r
+#  reproduced, stored in a retrieval system, or transmitted in any\r
+#  form or by any means without the express written consent of\r
+#  Intel Corporation.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = VgaClassDxe\r
+  FILE_GUID                      = BF89F10D-B205-474f-96E3-7A7BB1B4A407\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+  ENTRY_POINT                    = InitializeVgaClass\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+#  DRIVER_BINDING                =  gVgaClassDriverBinding                       \r
+#  COMPONENT_NAME                =  gVgaClassComponentName                       \r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+  ComponentName.c\r
+  ComponentName.h\r
+  VgaClass.h\r
+  VgaClass.c\r
+\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+#                              this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+  R9/TianoModulePkg/TianoModulePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+#                         this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+  ReportStatusCodeLib\r
+  UefiBootServicesTableLib\r
+  MemoryAllocationLib\r
+  BaseMemoryLib\r
+  DevicePathLib\r
+  UefiLib\r
+  BaseLib\r
+  UefiDriverEntryPoint\r
+  DebugLib\r
+\r
+\r
+################################################################################\r
+#\r
+# Protocol C Name Section - list of Protocol and Protocol Notify C Names\r
+#                           that this module uses or produces.\r
+#\r
+################################################################################\r
+\r
+[Protocols]\r
+  gEfiSimpleTextOutProtocolGuid                 # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiSimpleTextInProtocolGuid                  # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiVgaMiniPortProtocolGuid                   # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiPciIoProtocolGuid                         # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
+\r