TianoCore EDK2 master
Loading...
Searching...
No Matches
VbeShim.c File Reference
#include <IndustryStandard/LegacyVgaBios.h>
#include <Library/DebugLib.h>
#include <Library/PciLib.h>
#include <Library/PrintLib.h>
#include "Gop.h"
#include "VbeShim.h"

Go to the source code of this file.

Data Structures

struct  IVT_ENTRY
 

Macros

#define NUM_VBE_MODES   3
 
#define VBE_MODE_ENABLED   0x00BB
 
#define VBE_MODE_DISABLED   0x00BA
 

Functions

VOID InstallVbeShim (IN CONST CHAR16 *CardName, IN EFI_PHYSICAL_ADDRESS FrameBufferBase)
 

Variables

STATIC CONST CHAR8 mProductRevision [] = "2.0"
 
STATIC CONST UINT16 vbeModeIds []
 
STATIC VBE2_MODE_INFO vbeModes []
 

Detailed Description

Install a fake VGABIOS service handler (real mode Int10h) for the buggy Windows 2008 R2 SP1 UEFI guest.

The handler is never meant to be directly executed by a VCPU; it's there for the internal real mode emulator of Windows 2008 R2 SP1.

The code is based on Ralf Brown's Interrupt List: http://www.cs.cmu.edu/~ralf/files.html http://www.ctyme.com/rbrown.htm

Copyright (C) 2020, Rebecca Cran rebec.nosp@m.ca@b.nosp@m.sdio..nosp@m.com Copyright (C) 2015, Nahanni Systems, Inc. Copyright (C) 2014, Red Hat, Inc. Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file VbeShim.c.

Macro Definition Documentation

◆ NUM_VBE_MODES

#define NUM_VBE_MODES   3

Definition at line 42 of file VbeShim.c.

◆ VBE_MODE_DISABLED

#define VBE_MODE_DISABLED   0x00BA

Definition at line 51 of file VbeShim.c.

◆ VBE_MODE_ENABLED

#define VBE_MODE_ENABLED   0x00BB

Definition at line 50 of file VbeShim.c.

Function Documentation

◆ InstallVbeShim()

VOID InstallVbeShim ( IN CONST CHAR16 *  CardName,
IN EFI_PHYSICAL_ADDRESS  FrameBufferBase 
)

Install the VBE Info and VBE Mode Info structures, and the VBE service handler routine in the C segment. Point the real-mode Int10h interrupt vector to the handler. The only advertised mode is 1024x768x32.

Parameters
[in]CardNameName of the video card to be exposed in the Product Name field of the VBE Info structure.
[in]FrameBufferBaseGuest-physical base address of the video card's frame buffer.

Definition at line 97 of file VbeShim.c.

Variable Documentation

◆ mProductRevision

STATIC CONST CHAR8 mProductRevision[] = "2.0"

Definition at line 40 of file VbeShim.c.

◆ vbeModeIds

STATIC CONST UINT16 vbeModeIds[]
Initial value:
= {
0x13f,
0x140,
0x141
}

Definition at line 43 of file VbeShim.c.

◆ vbeModes

STATIC VBE2_MODE_INFO vbeModes[]

Definition at line 53 of file VbeShim.c.