mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-26 21:42:11 +00:00
Moved extensions to Cosmos.Kernel
This commit is contained in:
parent
e2c9a8e8d9
commit
c54e466b88
23 changed files with 29 additions and 37 deletions
|
|
@ -17,8 +17,9 @@ namespace KudzuTest {
|
||||||
var xPCIDevice = Cosmos.Hardware.PC.Bus.PCIBus.Devices[d];
|
var xPCIDevice = Cosmos.Hardware.PC.Bus.PCIBus.Devices[d];
|
||||||
string xVendor = xDeviceIDs.FindVendor(xPCIDevice.VendorID);
|
string xVendor = xDeviceIDs.FindVendor(xPCIDevice.VendorID);
|
||||||
|
|
||||||
if (xVendor == default(string))
|
if (xVendor == null) {
|
||||||
xVendor = ToHex(xPCIDevice.VendorID, 4);
|
xVendor = ToHex(xPCIDevice.VendorID, 4);
|
||||||
|
}
|
||||||
|
|
||||||
System.Console.Write(xPCIDevice.Bus + "-" + xPCIDevice.Slot + "-" + xPCIDevice.Function);
|
System.Console.Write(xPCIDevice.Bus + "-" + xPCIDevice.Slot + "-" + xPCIDevice.Function);
|
||||||
System.Console.Write(" " + xVendor + ":" + ToHex(xPCIDevice.DeviceID, 4));
|
System.Console.Write(" " + xVendor + ":" + ToHex(xPCIDevice.DeviceID, 4));
|
||||||
|
|
|
||||||
|
|
@ -134,9 +134,6 @@ namespace Cosmos.Kernel.FileSystem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ATA _ata;
|
|
||||||
private Header _header;
|
|
||||||
|
|
||||||
public Fat16(ATA ata)
|
public Fat16(ATA ata)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +144,7 @@ namespace Cosmos.Kernel.FileSystem
|
||||||
|
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
_header = new Header();
|
//_header = new Header();
|
||||||
|
|
||||||
// TODO: Read the header.
|
// TODO: Read the header.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@
|
||||||
<Compile Include="Bus\USB\USBHostOHCI.cs" />
|
<Compile Include="Bus\USB\USBHostOHCI.cs" />
|
||||||
<Compile Include="Bus\USB\USBHostOHCIRegisters.cs" />
|
<Compile Include="Bus\USB\USBHostOHCIRegisters.cs" />
|
||||||
<Compile Include="Device.cs" />
|
<Compile Include="Device.cs" />
|
||||||
<Compile Include="Extension\NumberSystem\Binary.cs" />
|
|
||||||
<Compile Include="Extension\NumberSystem\Hex.cs" />
|
|
||||||
<Compile Include="KeyboardOld.cs" />
|
<Compile Include="KeyboardOld.cs" />
|
||||||
<Compile Include="Network\Devices\RTL8139\BinaryHelper.cs" />
|
<Compile Include="Network\Devices\RTL8139\BinaryHelper.cs" />
|
||||||
<Compile Include="Network\Devices\RTL8139\Packet.cs" />
|
<Compile Include="Network\Devices\RTL8139\Packet.cs" />
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Text;
|
||||||
using Cosmos.Hardware.Network;
|
using Cosmos.Hardware.Network;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139
|
namespace Cosmos.Hardware.Network.Devices.RTL8139
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
//using System.Linq;
|
//using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware;
|
using Cosmos.Hardware;
|
||||||
using Cosmos.Hardware.PC.Bus;
|
using Cosmos.Hardware.PC.Bus;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,6 @@ namespace Cosmos.Hardware.Network.Devices.RTL8139.Register
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Illegal Transmit Status Descriptor");
|
throw new Exception("Illegal Transmit Status Descriptor");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return xMem.Read32(address);
|
return xMem.Read32(address);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network
|
namespace Cosmos.Hardware.Network
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.TCPIPModel.NetworkLayer.IPv4
|
namespace Cosmos.Hardware.Network.TCPIPModel.NetworkLayer.IPv4
|
||||||
{
|
{
|
||||||
|
|
@ -21,12 +20,12 @@ namespace Cosmos.Hardware.Network.TCPIPModel.NetworkLayer.IPv4
|
||||||
|
|
||||||
//TODO: Get the correct bits and bytes...
|
//TODO: Get the correct bits and bytes...
|
||||||
//TODO: Maybe some endinan conversions are needed.
|
//TODO: Maybe some endinan conversions are needed.
|
||||||
var p = new IPv4Packet();
|
//var p = new IPv4Packet();
|
||||||
p.Version = data[0];
|
//p.Version = data[0];
|
||||||
p.HeaderLength = data[1];
|
//p.HeaderLength = data[1];
|
||||||
//etc...
|
//etc...
|
||||||
|
|
||||||
return p;
|
//return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
//using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Network.TCPIPModel.PhysicalLayer.Ethernet2
|
namespace Cosmos.Hardware.Network.TCPIPModel.PhysicalLayer.Ethernet2
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@
|
||||||
<Compile Include="AddressSpace.cs" />
|
<Compile Include="AddressSpace.cs" />
|
||||||
<Compile Include="CPU.cs" />
|
<Compile Include="CPU.cs" />
|
||||||
<Compile Include="CPUBus.cs" />
|
<Compile Include="CPUBus.cs" />
|
||||||
|
<Compile Include="Extension\Binary.cs" />
|
||||||
|
<Compile Include="Extension\Hex.cs" />
|
||||||
<Compile Include="Global.cs" />
|
<Compile Include="Global.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,8 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Extension.NumberSystem
|
namespace Cosmos.Kernel {
|
||||||
{
|
public static class BinaryExtension {
|
||||||
public static class Binary
|
|
||||||
{
|
|
||||||
#region Extension methods
|
#region Extension methods
|
||||||
|
|
||||||
public static string ToBinary(this byte n)
|
public static string ToBinary(this byte n)
|
||||||
|
|
@ -2,9 +2,8 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Cosmos.Hardware.Extension.NumberSystem
|
namespace Cosmos.Kernel {
|
||||||
{
|
public static class HexExtension
|
||||||
public static class Hex
|
|
||||||
{
|
{
|
||||||
|
|
||||||
#region C# 3.0 Extension Methods
|
#region C# 3.0 Extension Methods
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.Network.Devices.RTL8139;
|
using Cosmos.Hardware.Network.Devices.RTL8139;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace FrodeTest.Shell
|
namespace FrodeTest.Shell
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Text;
|
||||||
using Cosmos.Hardware.Network.TCPIPModel.NetworkLayer.IPv4;
|
using Cosmos.Hardware.Network.TCPIPModel.NetworkLayer.IPv4;
|
||||||
using Cosmos.Hardware.Network.TCPIPModel.PhysicalLayer.Ethernet2;
|
using Cosmos.Hardware.Network.TCPIPModel.PhysicalLayer.Ethernet2;
|
||||||
using Cosmos.Hardware.Network.Devices.RTL8139;
|
using Cosmos.Hardware.Network.Devices.RTL8139;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
using Cosmos.Hardware.Network;
|
using Cosmos.Hardware.Network;
|
||||||
|
|
||||||
namespace FrodeTest.Test
|
namespace FrodeTest.Test
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Cosmos.Hardware.Extension.NumberSystem;
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace FrodeTest.Test
|
namespace FrodeTest.Test
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ namespace SteveKernel
|
||||||
|
|
||||||
Console.WriteLine("dumping memory space:");
|
Console.WriteLine("dumping memory space:");
|
||||||
|
|
||||||
for (uint i = 0; i < mas.Size; i++)
|
//for (uint i = 0; i < mas.Size; i++)
|
||||||
// Conver to extensino method as per your commetns. :)
|
// Conver to extensino method as per your commetns. :)
|
||||||
//Console.Write(PCIBus.ToHex(mas.Read8Unchecked(i),2) +" ");
|
//Console.Write(PCIBus.ToHex(mas.Read8Unchecked(i),2) +" ");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue