From d4faf0fd2f4e915e981ce96e93bf434510b52c97 Mon Sep 17 00:00:00 2001 From: MouriNaruto Date: Wed, 25 Dec 2024 23:30:46 +0800 Subject: [PATCH] Add Mobility.MinUap project. --- BuildAllTargets.proj | 6 ++ Mobility.MinUap/Mobility.MinUap.cpp | 77 +++++++++++++++++++++++++ Mobility.MinUap/Mobility.MinUap.vcxproj | 28 +++++++++ Mobility.sln | 14 +++++ 4 files changed, 125 insertions(+) create mode 100644 Mobility.MinUap/Mobility.MinUap.cpp create mode 100644 Mobility.MinUap/Mobility.MinUap.vcxproj diff --git a/BuildAllTargets.proj b/BuildAllTargets.proj index 983c426..a2ce5c3 100644 --- a/BuildAllTargets.proj +++ b/BuildAllTargets.proj @@ -12,6 +12,12 @@ Configuration=Release;Platform=x64 + + Configuration=Debug;Platform=ARM64 + + + Configuration=Release;Platform=ARM64 + + +#include + +#ifndef _In_ +#define _In_ +#endif // !_In_ + +#ifndef _Out_ +#define _Out_ +#endif // !_Out_ + +#define MOBILITY_MINUAP_VERSION_STRING \ + MILE_PROJECT_VERSION_STRING L" (Build " \ + MILE_PROJECT_MACRO_TO_STRING(MILE_PROJECT_VERSION_BUILD) L")" + +namespace +{ + static EFI_STATUS OutputWideString( + _In_ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL* Output, + _In_ const wchar_t* String) + { + return Output->OutputString( + Output, + const_cast(reinterpret_cast(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 Minimum UEFI Application Project" + L" " MOBILITY_MINUAP_VERSION_STRING L"\r\n" + L"(c) Kenji Mouri. All rights reserved.\r\n" + L"\r\n"); + + ::OutputWideString( + SystemTable->ConOut, + L"Hello World!\r\n"); + + ::OutputWideString( + SystemTable->ConOut, + L"\r\n" + L"Press any key to return to the boot menu...\r\n"); + { + UINTN Index = 0; + SystemTable->BootServices->WaitForEvent( + 1, + &SystemTable->ConIn->WaitForKey, + &Index); + } + + return EFI_SUCCESS; +} + +#pragma comment(linker, "/entry:UefiMain") diff --git a/Mobility.MinUap/Mobility.MinUap.vcxproj b/Mobility.MinUap/Mobility.MinUap.vcxproj new file mode 100644 index 0000000..de62e7b --- /dev/null +++ b/Mobility.MinUap/Mobility.MinUap.vcxproj @@ -0,0 +1,28 @@ + + + + {A158BB1B-480D-4622-B0F1-517D8F366BC1} + Mobility.MinUap + UefiApplication + MoMinUap + true + Mobility + Mobility Minimum UEFI Application Project + Mobility.MinUap + © Kenji Mouri. All rights reserved. + MoMinUap.efi + Mobility + 1.0.$([System.DateTime]::Today.Subtract($([System.DateTime]::Parse('2024-11-04'))).TotalDays).0 + Alpha 1 + + + + + + + + + + + + \ No newline at end of file diff --git a/Mobility.sln b/Mobility.sln index 448ff28..9422afa 100644 --- a/Mobility.sln +++ b/Mobility.sln @@ -5,16 +5,30 @@ 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 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mobility.MinUap", "Mobility.MinUap\Mobility.MinUap.vcxproj", "{A158BB1B-480D-4622-B0F1-517D8F366BC1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 + Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Debug|ARM64.ActiveCfg = Debug|x64 {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|ARM64.ActiveCfg = Release|x64 {30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Release|x64.ActiveCfg = Release|x64 {30B9DE98-9479-4E1B-AAFA-D754BD5F7182}.Release|x64.Build.0 = Release|x64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Debug|ARM64.Build.0 = Debug|ARM64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Debug|x64.ActiveCfg = Debug|x64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Debug|x64.Build.0 = Debug|x64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Release|ARM64.ActiveCfg = Release|ARM64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Release|ARM64.Build.0 = Release|ARM64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Release|x64.ActiveCfg = Release|x64 + {A158BB1B-480D-4622-B0F1-517D8F366BC1}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE