Skip to content

Commit

Permalink
Add Mobility.HvGcs project.
Browse files Browse the repository at this point in the history
  • Loading branch information
MouriNaruto committed Dec 11, 2024
1 parent 81a69a5 commit 0fa43f3
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 7 deletions.
6 changes: 0 additions & 6 deletions BuildAllTargets.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
<ProjectReference Include="$(SolutionPath)">
<AdditionalProperties>Configuration=Release;Platform=x64</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="$(SolutionPath)">
<AdditionalProperties>Configuration=Debug;Platform=ARM64</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="$(SolutionPath)">
<AdditionalProperties>Configuration=Release;Platform=ARM64</AdditionalProperties>
</ProjectReference>
</ItemGroup>
<Target Name="Restore" >
<MSBuild
Expand Down
59 changes: 59 additions & 0 deletions Mobility.HvGcs/Mobility.HvGcs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* PROJECT: Mobility
* FILE: Mobility.HvGcs.cpp
* PURPOSE: Implementation for Mobility Hyper-V Guest Compatibility Shim
*
* LICENSE: The MIT License
*
* MAINTAINER: MouriNaruto ([email protected])
*/

#include <Uefi.h>
#include <Protocol/GraphicsOutput.h>

#include <sal.h>
#include <string.h>

namespace
{
static EFI_STATUS OutputWideString(
_In_ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL* Output,
_In_ const wchar_t* String)
{
return Output->OutputString(
Output,
const_cast<CHAR16*>(reinterpret_cast<const CHAR16*>(String)));
}
}

/**
* Entry point to UEFI Application.
*
* @param ImageHandle The image handle of the UEFI Application.
* @param SystemTable A pointer to the EFI System Table.
* @return EFI_STATUS. If the function succeeds, the return value is
* EFI_SUCCESS.
*/
EFI_STATUS EFIAPI UefiMain(
_In_ EFI_HANDLE ImageHandle,
_In_ EFI_SYSTEM_TABLE* SystemTable)
{
::OutputWideString(
SystemTable->ConOut,
L"Mobility Hyper-V Guest Compatibility Shim\r\n"
L"================================================================\r\n"
L"Hello World!\r\n"
L"================================================================\r\n"
L"Press any key to return to the boot menu...");
{
UINTN Index = 0;
SystemTable->BootServices->WaitForEvent(
1,
&SystemTable->ConIn->WaitForKey,
&Index);
}

return EFI_SUCCESS;
}

#pragma comment(linker, "/entry:UefiMain")
33 changes: 33 additions & 0 deletions Mobility.HvGcs/Mobility.HvGcs.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}</ProjectGuid>
<RootNamespace>Mobility.HvGcs</RootNamespace>
<MileProjectType>UefiApplication</MileProjectType>
<TargetName>MoHvGcs</TargetName>
<MileProjectUseProjectProperties>true</MileProjectUseProjectProperties>
<MileProjectCompanyName>Mobility</MileProjectCompanyName>
<MileProjectFileDescription>Mobility Hyper-V Guest Compatibility Shim</MileProjectFileDescription>
<MileProjectInternalName>Mobility.HvGcs</MileProjectInternalName>
<MileProjectLegalCopyright>© Kenji Mouri. All rights reserved.</MileProjectLegalCopyright>
<MileProjectOriginalFilename>Mobility.HvGcs.efi</MileProjectOriginalFilename>
<MileProjectProductName>Mobility</MileProjectProductName>
<MileProjectVersion>1.0.$([System.DateTime]::Today.Subtract($([System.DateTime]::Parse('2024-11-04'))).TotalDays).0</MileProjectVersion>
<MileProjectVersionTag Condition="false">Alpha 1</MileProjectVersionTag>
</PropertyGroup>
<Import Sdk="Mile.Project.Configurations" Version="1.0.1426" Project="Mile.Project.Platform.x64.props" />
<Import Sdk="Mile.Project.Configurations" Version="1.0.1426" Project="Mile.Project.Cpp.Default.props" />
<Import Sdk="Mile.Project.Configurations" Version="1.0.1426" Project="Mile.Project.Cpp.props" />
<Import Project="..\Mile.Uefi\Mile.Uefi.props" />
<Import Project="..\Mile.Uefi.RuntimeLibrary\Mile.Uefi.RuntimeLibrary.props" />
<ItemGroup>
<ClCompile Include="Mobility.HvGcs.cpp" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mile.HyperV">
<Version>1.1.419</Version>
</PackageReference>
</ItemGroup>
<Import Project="..\Mile.Uefi\Mile.Uefi.targets" />
<Import Sdk="Mile.Project.Configurations" Version="1.0.1426" Project="Mile.Project.Cpp.targets" />
</Project>
14 changes: 13 additions & 1 deletion Mobility.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113 d17.12
VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mobility.HvGcs", "Mobility.HvGcs\Mobility.HvGcs.vcxproj", "{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Debug|x64.ActiveCfg = Debug|x64
{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Debug|x64.Build.0 = Debug|x64
{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Release|x64.ActiveCfg = Release|x64
{30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
Expand Down

0 comments on commit 0fa43f3

Please sign in to comment.