CmosRead.c
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
#include <Library/IoLib.h>
#define CMOS_INDEX 0x70
#define CMOS_DATA 0x71
INTN
EFIAPI
ShellAppMain (
IN UINTN Argc,
IN CHAR16 **Argv
)
{
UINT8 Value = 0;
UINT8 Index = 0xFF;
while (Index) {
IoWrite8 (CMOS_INDEX, 0xFF - Index);
Value = IoRead8 (CMOS_DATA);
Print (L"%02x ", Value);
if ((0xFF - Index + 1) % 0x10 == 0)
Print (L"\n");
Index--;
}
IoWrite8 (CMOS_INDEX, 0xFF);
Print (L"%02x\n", IoRead8 (CMOS_DATA));
return EFI_SUCCESS;
}
CmosRead.inf
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = CmosPrint
FILE_GUID = dc72d2c7-a48a-42fd-80b6-9d229d9943c8
MODULE_TYPE