public static void DebugEntryPoint(EntryPointTable entry) { Debugger.DoSend("TEST PARSE"); Debugger.DoSend(entry.EntryPointString[0].ToString() + entry.EntryPointString[1] + entry.EntryPointString[2] + entry.EntryPointString[3]); Debugger.DoSend("Revision: " + entry.EntryPointRevision); Debugger.DoSend("Version: " + entry.MajorVersion + "." + entry.MinorVersion); Debugger.DoSend("Max structure size: " + entry.MaxStructureSize); Debugger.DoSend("Formatted area: " + entry.FormattedArea[0].ToString() + entry.FormattedArea[1] + entry.FormattedArea[2] + entry.FormattedArea[3] + entry.FormattedArea[4] ); Debugger.DoSend("Entry point string 2: " + entry.EntryPointString2[0].ToString() + entry.EntryPointString2[1] + entry.EntryPointString2[2] + entry.EntryPointString2[3] + entry.EntryPointString2[4] ); Debugger.DoSend("Number of structures:" + entry.NumberOfStructures); Debugger.DoSend("Structures length: " + entry.TableLength); Debugger.DoSend("First table: " + (byte)entry.TableAddress[0]); Debugger.DoSend("Contents: "); }
public CPUInfo(EntryPointTable entryPointTable, byte *BeginningAddress) : base(BeginningAddress) { this.beginningAddress = BeginningAddress; this.entryPointTable = entryPointTable; AssetTag = ""; PartNumber = ""; SerialNumber = ""; ProcessorVersion = ""; ProcessorManufacturer = ""; SocketDesignation = ""; }
public static SMBIOSStructure BeginParseSMBIOS() { byte *memPtr = SMBIOS.SearchEntryPointTable(); EntryPointTable entry = new EntryPointTable(); //We dont return an address since we need to use a pointer that //its inside the table entry.Parse(memPtr); //entry.GetTableAddress(); SMBIOSStructure smbiosStructure = SMBIOS.ParseStructures(entry); smbiosStructure.EntryPointTable = entry; return(smbiosStructure); }
public static SMBIOSStructure ParseStructures(EntryPointTable entryPointTable) { SMBIOSStructure smbiosStructure = new SMBIOSStructure(); List <CPUInfo> cpuList = new List <CPUInfo>(); byte * currentAddress = entryPointTable.GetTableAddress(); DebugSMBIOS.DebugEntryPoint(entryPointTable); for (int i = 0; i < entryPointTable.NumberOfStructures; i++) { //We need to compare the type (which will be always the 0 fo current address) if (currentAddress[0] == SMBIOSTypes.BiosTable) { if (smbiosStructure.BiosInfo == null) { smbiosStructure.BiosInfo = new BIOSInfo(entryPointTable, currentAddress); currentAddress = smbiosStructure.BiosInfo.Parse(); DebugSMBIOS.DebugBIOSInfo(smbiosStructure.BiosInfo); } else { //If we fail skipping the table currentAddress = currentAddress + 1; Cosmos.Debug.Kernel.Debugger.DoSend("Skipping not bios table"); } continue; } if (currentAddress[0] == SMBIOSTypes.ProcessorTable) { CPUInfo cpuInfo = new CPUInfo(entryPointTable, currentAddress); currentAddress = cpuInfo.Parse(); smbiosStructure.CpuInfoList.Add(cpuInfo); DebugSMBIOS.DebugCPUInfo(cpuInfo); continue; } //In [1] we have the length of the formatted section. Cosmos.Debug.Kernel.Debugger.DoSend("Skipping table type: " + currentAddress[0] + " Length: " + currentAddress[1]); Cosmos.Debug.Kernel.Debugger.DoSend("Is 4?" + (currentAddress[0] == 4)); currentAddress = SkipTable(currentAddress[1], currentAddress); } return(smbiosStructure); }
//We asume that the smbios is always greater than 2.0 //TODO: independice the hardcoded numbers with a variable (which we will use to move through memory) public BIOSInfo(EntryPointTable entryPointTable, byte *BeginningAddress) : base(BeginningAddress) { this.BeginningAddress = BeginningAddress; this.EntryPointTable = entryPointTable; }