-
Notifications
You must be signed in to change notification settings - Fork 11
/
smbios.hpp
43 lines (38 loc) · 1.51 KB
/
smbios.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @file smbios.hpp
* @author Keeton Feavel (keetonfeavel@cedarville.edu)
* @brief
* @version 0.1
* @date 2019-11-15
*
* @copyright Copyright Keeton Feavel et al (c) 2019
*
*/
#ifndef PANIX_SMBIOS_HPP
#define PANIX_SMBIOS_HPP
#include <sys/sys.hpp>
// TODO: Need to make a function that will read the info from the SMBIO into this struct
struct SMBIOSEntryPoint {
int8_t EntryPointString[4]; //This is _SM_
uint8_t Checksum; //This value summed with all the values of the table, should be 0 (overflow)
uint8_t Length; //Length of the Entry Point Table. Since version 2.1 of SMBIOS, this is 0x1F
uint8_t MajorVersion; //Major Version of SMBIOS
uint8_t MinorVersion; //Minor Version of SMBIOS
uint16_t MaxStructureSize; //Maximum size of a SMBIOS Structure (we will se later)
uint8_t EntryPointRevision; //...
int8_t FormattedArea[5]; //...
int8_t EntryPointString2[5]; //This is _DMI_
uint8_t Checksum2; //Checksum for values from EntryPointString2 to the end of table
uint16_t TableLength; //Length of the Table containing all the structures
uint32_t TableAddress; //Address of the Table
uint16_t NumberOfStructures; //Number of structures in the table
uint8_t BCDRevision; //Unused
};
struct SMBIOSHeader {
uint8_t type;
uint8_t len;
uint16_t handle;
};
char* px_get_smbios_addr();
size_t px_get_smbios_table_len(struct SMBIOSHeader *hd);
#endif /* PANIX_SMBIOS_HPP */