Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }