mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-11 18:51:41 +00:00
display PCI devices
This commit is contained in:
parent
e9e854db38
commit
b286c77013
2 changed files with 34 additions and 5 deletions
|
|
@ -47,6 +47,10 @@
|
|||
<Project>{1F0EDE86-F6D4-4355-9A97-10E90457770C}</Project>
|
||||
<Name>Cosmos.Build.Windows</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Cosmos\Cosmos.Hardware\Cosmos.Hardware.csproj">
|
||||
<Project>{CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}</Project>
|
||||
<Name>Cosmos.Hardware</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Cosmos\Cosmos.Kernel\Cosmos.Kernel.csproj">
|
||||
<Project>{A1F83D9F-2D44-4264-A08B-416797123018}</Project>
|
||||
<Name>Cosmos.Kernel</Name>
|
||||
|
|
@ -56,6 +60,9 @@
|
|||
<Name>Cosmos.Sys</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using Cosmos.Build.Windows;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Kernel;
|
||||
using Cosmos.Sys;
|
||||
|
||||
namespace EsxTest
|
||||
|
|
@ -21,11 +23,31 @@ namespace EsxTest
|
|||
public static void Init()
|
||||
{
|
||||
Cosmos.Sys.Boot.Default();
|
||||
Console.WriteLine("Sleep 3000 ESX!");
|
||||
Thread.Sleep(3000);
|
||||
Console.WriteLine("Reboot");
|
||||
Deboot.Reboot();
|
||||
PCIBus.Init();
|
||||
var deviceIDs = new PCIBus.DeviceIDs();
|
||||
foreach (var device in PCIBus.Devices)
|
||||
{
|
||||
Console.WriteLine("DeviceID: " + device.DeviceID);
|
||||
Console.WriteLine("VendorID: " + device.VendorID);
|
||||
if (deviceIDs.FindVendor(device.VendorID) != null)
|
||||
{
|
||||
Console.WriteLine("Vendor: " + deviceIDs.FindVendor(device.VendorID));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Vendor: unknown");
|
||||
}
|
||||
Console.WriteLine("Type: " + device.HeaderType);
|
||||
Console.WriteLine("IRQ: " + device.InterruptLine);
|
||||
Console.WriteLine("Classcode: " + device.ClassCode);
|
||||
Console.WriteLine("SubClass: " + device.SubClass);
|
||||
Console.WriteLine(device.GetClassInfo());
|
||||
Console.ReadLine();
|
||||
}
|
||||
Console.WriteLine("No more devices");
|
||||
Console.WriteLine("Press Enter for Reboot");
|
||||
Console.ReadLine();
|
||||
Deboot.Reboot();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue