diff options
author | Regina König | 2020-07-18 01:40:52 +0200 |
---|---|---|
committer | Regina König | 2020-07-18 01:40:52 +0200 |
commit | ea1e168103b7ec72dc5ce78cc2d335eb4a347083 (patch) | |
tree | 2804afdf17c5eb5bd7adcbac34d5f00f52ecbbfd /efi_memtest/MemtestEfi.c | |
parent | Creating a logger which writes to a file (diff) | |
download | memtest86-ea1e168103b7ec72dc5ce78cc2d335eb4a347083.tar.gz memtest86-ea1e168103b7ec72dc5ce78cc2d335eb4a347083.tar.xz memtest86-ea1e168103b7ec72dc5ce78cc2d335eb4a347083.zip |
Added FileSystemInfo.h. Getting Information of Filesystem into buffer
Diffstat (limited to 'efi_memtest/MemtestEfi.c')
-rw-r--r-- | efi_memtest/MemtestEfi.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/efi_memtest/MemtestEfi.c b/efi_memtest/MemtestEfi.c index 1b0414a..2e79985 100644 --- a/efi_memtest/MemtestEfi.c +++ b/efi_memtest/MemtestEfi.c @@ -2,9 +2,11 @@ #include "Uefi.h" #include "Library/UefiLib.h" #include "Library/UefiApplicationEntryPoint.h" +#include "Guid/FileSystemInfo.h" #include "OUTPUT/main.h" + EFI_STATUS EFIAPI UefiMain ( @@ -36,18 +38,47 @@ UefiMain ( { EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL; - efiStatus = bs->HandleProtocol( + efiStatus = bs->HandleProtocol( // TODO Should use OpenProtocol() in new implementations handles[index], &sfspGuid, - (void**)&fs); - } + (void**)&fs + ); + Print(L"Volume %d found\n", index); + EFI_FILE_PROTOCOL* root = NULL; + efiStatus = fs->OpenVolume(fs, &root); + EFI_GUID fsiGuid = EFI_FILE_SYSTEM_INFO_ID; + UINTN bufSize = 0; + VOID* buffer = NULL; + + efiStatus = root->GetInfo( + root, + &fsiGuid, + &bufSize, + &buffer); + + Print(L"Status: %r\n", efiStatus); + Print(L"Required buffer size: %d\n", bufSize ); + + + efiStatus = bs->AllocatePool(EfiLoaderData, (UINTN) (bufSize) , (void **)&buffer); -/* EFI_FILE_PROTOCOL* root = NULL; + + efiStatus = root->GetInfo( + root, + &fsiGuid, + &bufSize, + &buffer); + + Print(L"Status: %r\n", efiStatus); + } + +/* ... -efiStatus = fs->OpenVolume(fs, &root); -EFI_FILE_PROTOCOL* token = NULL; + + + EFI_FILE_PROTOCOL* token = NULL; efiStatus = root->Open( root, &token, |