diff --git a/Source/Boot/EFI/Libs.h b/Source/Boot/EFI/Libs.h index fd65aa1..c93419a 100644 --- a/Source/Boot/EFI/Libs.h +++ b/Source/Boot/EFI/Libs.h @@ -63,6 +63,20 @@ void InitializeLibs(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable) LocateProtocol(&SimpleFileSystemProtocolGuid, (void **)&FileSystem); } +CHAR16 *GetVersionString() +{ + CHAR16 *version = 0; + ALLOC((void **)&version, (18 + 1) * sizeof(CHAR16)); + + StrCat(version, IntToString(VERSION_MAJOR)); + StrCat(version, L"."); + StrCat(version, IntToString(VERSION_MINOR)); + StrCat(version, L"."); + StrCat(version, IntToString(VERSION_PATCH)); + + return version; +} + void Print(CHAR16 *string) { ConOut->OutputString(ConOut, string); diff --git a/Source/Boot/Globals.h b/Source/Boot/Globals.h index d3bee56..49cb54d 100644 --- a/Source/Boot/Globals.h +++ b/Source/Boot/Globals.h @@ -1,5 +1,11 @@ #pragma once +#define VERSION_MAJOR (__DATE__[7] - '0') * 1000 + (__DATE__[8] - '0') * 100 + (__DATE__[9] - '0') +#define VERSION_MINOR (__DATE__[0] - 'A' + 1) * 100 + (__DATE__[1] - 'A' + 1) +#define VERSION_PATCH (__DATE__[4] - '0') * 1000 + (__TIME__[0] - '0') * 100 + (__TIME__[1] - '0') + +BOOLEAN IsInShell = FALSE; + EFI_HANDLE ImageHandle; EFI_SYSTEM_TABLE *SystemTable; @@ -17,5 +23,3 @@ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem; EFI_GUID FileInfoId = EFI_FILE_INFO_ID; EFI_GUID FileSystemInfoId = EFI_FILE_SYSTEM_INFO_ID; - -BOOLEAN IsInShell = FALSE; diff --git a/Source/Boot/Shell.h b/Source/Boot/Shell.h index 4f7da10..570dc1a 100644 --- a/Source/Boot/Shell.h +++ b/Source/Boot/Shell.h @@ -168,9 +168,12 @@ CHAR16 *ReadInput() void OpenShell() { Print(L"Welcome to "); - SetColor(EFI_WHITE); + SetColor(EFI_LIGHTCYAN); Print(L"Kittnus Shell"); ResetColor(); + Print(L" ("); + Print(GetVersionString()); + Print(L")"); PrintLn(L"!"); PrintLn(L"Type \"Help\" to see available commands");