Cosmos/source/SteveKernel/Program.cs
smremde_cp 9a7261a782 addressspace sizes in pci now correctly identified. see SteveKernel for example (hacked a fix for 0xfffffff0 not working.)
ioaddressspace needs implementing... i'm not sure how these work exactly so will look it up!
2008-03-19 03:16:11 +00:00

52 lines
No EOL
1.3 KiB
C#

using System;
using Cosmos.Build.Windows;
using Cosmos.Driver.RTL8139;
using Cosmos.Hardware.PC.Bus;
namespace SteveKernel
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
var xBuilder = new Builder();
xBuilder.Build();
}
#endregion
// Main entry point of the kernel
public static void Init()
{
Console.WriteLine("Done booting");
Cosmos.Kernel.Boot.Default();
//Cosmos.Hardware.PC.Bus.PCIBus.DebugLSPCI();
PCIDeviceNormal rtlpci = PCIBus.GetPCIDevice(0, 3, 0) as PCIDeviceNormal;
if (rtlpci != null)
Console.WriteLine("got rtl pci");
MemoryAddressSpace mas = rtlpci.GetAddressSpace(1) as MemoryAddressSpace;
if (mas != null)
Console.WriteLine("got mas");
Console.WriteLine("dumping memory space:");
for (uint i = 0; i < mas.Size; i++)
Console.Write(PCIBus.ToHex(mas.Read8Unchecked(i),2) +" ");
while (true)
;
}
}
}