/* $Id$ */
/** @file
* VBoxConsole.c - Helper driver waiting for Ready to Boot event to switch graphic mode into user-defined one.
*/
/*
* Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#include "VBoxConsole.h"
#include "VBoxPkg.h"
#include "DevEFI.h"
/* @todo understand the reasons why TextOutputProtocol.SetMode isn't enough to switch mode. */
/*b53865fd-b76c-4433-9e85-c0cadf65aab8*/
static EFI_GUID gVBoxConsoleVarGuid = { 0xb53865fd, 0xb76c, 0x4433, { 0x9e, 0x85, 0xc0, 0xca, 0xdf, 0x65, 0xaa, 0xb8}};
/*
* @todo move this function to the library.
*/
static UINT32
{
{
}
return VarLen;
}
static VOID
)
{
if (Gop)
{
}
else if (Uga)
{
UINT32 H = 1027;
UINT32 V = 768;
}
if(EFI_ERROR(r))
{
goto done;
}
if(EFI_ERROR(r))
{
goto done;
}
done:
return;
}
{
EFI_STATUS r;
if ( EFI_ERROR(r)
&& r == EFI_NOT_FOUND)
{
val = 1;
r = gRT->SetVariable(VBOX_CONSOLE_VAR, &gVBoxConsoleVarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, size, &val);
if (EFI_ERROR(r))
{
return r;
}
if(EFI_ERROR(r))
{
}
if(EFI_ERROR(r))
{
}
if(EFI_ERROR(r))
{
}
r = gBS->CreateEventEx(EVT_NOTIFY_SIGNAL, TPL_NOTIFY, ConsoleSwitchMode, NULL, &gEfiEventReadyToBootGuid, &event);
if (EFI_ERROR(r))
{
return r;
}
return r;
}
if (!EFI_ERROR(r))
{
return EFI_ALREADY_STARTED;
}
return r;
}
{
return EFI_SUCCESS;
}