Пример #1
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);
        }
Пример #2
0
 public static void DebugCPUInfo(CPUInfo cpuInfo)
 {
     Debugger.DoSend("==================CPU==========================");
     Debugger.DoSend("Type:" + cpuInfo.Type);
     Debugger.DoSend("Length: " + cpuInfo.Length);
     Debugger.DoSend("Handle: " + cpuInfo.Handle);
     Debugger.DoSend("Socket designation (ID): " + cpuInfo.SocketDesignationID);
     Debugger.DoSend("Processor Type: " + cpuInfo.ProcessorType);
     Debugger.DoSend("Processor family: " + cpuInfo.ProcessorFamily);
     Debugger.DoSend("Processor manufacturer (ID): " + cpuInfo.ProcessorManufacturerID);
     Debugger.DoSend("Processor ID: " + cpuInfo.ProcessorID);
     Debugger.DoSend("Processor version (ID): " + cpuInfo.ProcessorVersionID);
     Debugger.DoSend("Voltage: " + cpuInfo.Voltage);
     Debugger.DoSend("External clock: " + cpuInfo.ExternalClock);
     Debugger.DoSend("Max Speed: " + cpuInfo.MaxSpeed + " MHZ");
     Debugger.DoSend("Current speed: " + cpuInfo.CurrentSpeed + " MHZ");
     Debugger.DoSend("Status: " + cpuInfo.Status);
     Debugger.DoSend("Processor upgrade: " + cpuInfo.ProcessorUpgrade);
     Debugger.DoSend("L1 Cache Handle: " + cpuInfo.L1HandleCache);
     Debugger.DoSend("L2 Cache Handle: " + cpuInfo.L2HandleCache);
     Debugger.DoSend("L3 Cache Handle: " + cpuInfo.L3HandleCache);
     Debugger.DoSend("Serial number (ID): " + cpuInfo.SerialNumberID);
     Debugger.DoSend("Asset Tag (ID): " + cpuInfo.AssetTagID);
     Debugger.DoSend("Par number (ID): " + cpuInfo.PartNumberID);
     Debugger.DoSend("Core count: " + cpuInfo.CoreCount);
     Debugger.DoSend("Core enabled: " + cpuInfo.CoreEnabled);
     Debugger.DoSend("Thread Count: " + cpuInfo.ThreadCount);
     Debugger.DoSend("Processor characteristics: " + cpuInfo.ProcessorCharacteristics);
     Debugger.DoSend("Processor family 2: " + cpuInfo.ProcessorFamily2);
     Debugger.DoSend("  ===========STRINGS==========");
     Debugger.DoSend("Asset Tag: " + cpuInfo.AssetTag);
     Debugger.DoSend("PartNumber: " + cpuInfo.PartNumber);
     Debugger.DoSend("ProcessorManufacturer: " + cpuInfo.ProcessorManufacturer);
     Debugger.DoSend("ProcessorVersion: " + cpuInfo.ProcessorVersion);
     Debugger.DoSend("SerialNumber: " + cpuInfo.SerialNumber);
     Debugger.DoSend("SocketDesignation: " + cpuInfo.SocketDesignation);
     Debugger.DoSend("Part Number: " + cpuInfo.PartNumber);
     Debugger.DoSend("  ===================================================\n");
 }