diff --git a/source/Cosmos/Cosmos.Hardware/Cosmos.Hardware.csproj b/source/Cosmos/Cosmos.Hardware/Cosmos.Hardware.csproj index 2bedf9e59..1097b9b5b 100644 --- a/source/Cosmos/Cosmos.Hardware/Cosmos.Hardware.csproj +++ b/source/Cosmos/Cosmos.Hardware/Cosmos.Hardware.csproj @@ -52,7 +52,6 @@ - @@ -81,9 +80,8 @@ - - - + + diff --git a/source/Cosmos/Cosmos.Hardware/Network/Devices/RTL8139/RTL8139.cs b/source/Cosmos/Cosmos.Hardware/Network/Devices/RTL8139/RTL8139.cs index 38661ff85..471b9aad0 100644 --- a/source/Cosmos/Cosmos.Hardware/Network/Devices/RTL8139/RTL8139.cs +++ b/source/Cosmos/Cosmos.Hardware/Network/Devices/RTL8139/RTL8139.cs @@ -531,7 +531,8 @@ namespace Cosmos.Hardware.Network.Devices.RTL8139 * The address is stored in the Transmit Start Address which corresponds to the Transmit Status Descriptor we are currently using (0-3). */ - IOSpace.Write32(address, GetMemoryAddress(ref bytearray)); + var xMem = new MemoryAddressSpace(address, 1); + xMem.Write32(0, GetMemoryAddress(ref bytearray)); } /// diff --git a/source/Cosmos/Cosmos.Hardware/PC/Bus/AddressSpace.cs b/source/Cosmos/Cosmos.Hardware/PC/Bus/AddressSpace.cs index a6ca0b06d..ebe0ea1ed 100644 --- a/source/Cosmos/Cosmos.Hardware/PC/Bus/AddressSpace.cs +++ b/source/Cosmos/Cosmos.Hardware/PC/Bus/AddressSpace.cs @@ -181,64 +181,64 @@ namespace Cosmos.Hardware.PC.Bus { { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - return CPUBus.Read8((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read8((UInt16)(this.Offset + offset)); } public override UInt16 Read16(UInt32 offset) { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - return CPUBus.Read16((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read16((UInt16)(this.Offset + offset)); } public override UInt32 Read32(UInt32 offset) { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - return CPUBus.Read32((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read32((UInt16)(this.Offset + offset)); } public override byte Read8Unchecked(UInt32 offset) { - return CPUBus.Read8((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read8((UInt16)(this.Offset + offset)); } public override UInt16 Read16Unchecked(UInt32 offset) { - return CPUBus.Read16((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read16((UInt16)(this.Offset + offset)); } public override UInt32 Read32Unchecked(UInt32 offset) { - return CPUBus.Read32((UInt16)(this.Offset + offset)); + return Kernel.CPUBus.Read32((UInt16)(this.Offset + offset)); } public override void Write8(UInt32 offset, byte value) { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - CPUBus.Write8((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write8((UInt16)(this.Offset + offset), value); } public override void Write16(UInt32 offset, UInt16 value) { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - CPUBus.Write16((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write16((UInt16)(this.Offset + offset), value); } public override void Write32(UInt32 offset, UInt32 value) { if (offset < 0 || offset > Size) throw new ArgumentOutOfRangeException("offset"); - CPUBus.Write32((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write32((UInt16)(this.Offset + offset), value); } public override void Write8Unchecked(UInt32 offset, byte value) { - CPUBus.Write8((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write8((UInt16)(this.Offset + offset), value); } public override void Write16Unchecked(UInt32 offset, UInt16 value) { - CPUBus.Write16((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write16((UInt16)(this.Offset + offset), value); } public override void Write32Unchecked(UInt32 offset, UInt32 value) { - CPUBus.Write32((UInt16)(this.Offset + offset), value); + Kernel.CPUBus.Write32((UInt16)(this.Offset + offset), value); } } } diff --git a/source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/Keyboard.cs b/source/Cosmos/Cosmos.Hardware/PC/Bus/Keyboard.cs similarity index 85% rename from source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/Keyboard.cs rename to source/Cosmos/Cosmos.Hardware/PC/Bus/Keyboard.cs index 58b511339..b786a6f5a 100644 --- a/source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/Keyboard.cs +++ b/source/Cosmos/Cosmos.Hardware/PC/Bus/Keyboard.cs @@ -10,7 +10,7 @@ namespace Cosmos.Hardware.PC.Bus.CPU { } public void InterruptReceived() { - byte xByte = PC.Bus.CPUBus.Read8(0x60); + byte xByte = Kernel.CPUBus.Read8(0x60); ByteReceived(xByte); } public override string Name { diff --git a/source/Cosmos/Cosmos.Hardware/PC/Bus/PCIBus.cs b/source/Cosmos/Cosmos.Hardware/PC/Bus/PCIBus.cs index bba96df30..1800289de 100644 --- a/source/Cosmos/Cosmos.Hardware/PC/Bus/PCIBus.cs +++ b/source/Cosmos/Cosmos.Hardware/PC/Bus/PCIBus.cs @@ -587,38 +587,38 @@ namespace Cosmos.Hardware.PC.Bus protected UInt32 Read32(byte aRegister) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - return CPUBus.Read32(ConfigData); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + return Kernel.CPUBus.Read32(ConfigData); } protected UInt16 Read16(byte aRegister) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - return CPUBus.Read16(ConfigData); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + return Kernel.CPUBus.Read16(ConfigData); } protected byte Read8(byte aRegister) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - return CPUBus.Read8(ConfigData); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + return Kernel.CPUBus.Read8(ConfigData); } protected void Write32(byte aRegister, UInt32 value) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - CPUBus.Write32(ConfigData, value); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + Kernel.CPUBus.Write32(ConfigData, value); } protected void Write16(byte aRegister, UInt16 value) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - CPUBus.Write16(ConfigData, value); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + Kernel.CPUBus.Write16(ConfigData, value); } protected void Write8(byte aRegister, byte value) { - CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); - CPUBus.Write8(ConfigData, value); + Kernel.CPUBus.Write32(ConfigAddr, GetAddress(aRegister)); + Kernel.CPUBus.Write8(ConfigData, value); } } } \ No newline at end of file diff --git a/source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/PIC.cs b/source/Cosmos/Cosmos.Hardware/PC/Bus/PIC.cs similarity index 54% rename from source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/PIC.cs rename to source/Cosmos/Cosmos.Hardware/PC/Bus/PIC.cs index ef6b3b5d6..87fa46f68 100644 --- a/source/Cosmos/Cosmos.Hardware/PC/Bus/CPU/PIC.cs +++ b/source/Cosmos/Cosmos.Hardware/PC/Bus/PIC.cs @@ -16,31 +16,31 @@ namespace Cosmos.Hardware.PC.Bus.CPU { const ushort DataPort2 = 0xA1; public static void SignalPrimary() { - PC.Bus.CPUBus.Write8(CmdPort1, 0x20); + Kernel.CPUBus.Write8(CmdPort1, 0x20); } public static void SignalSecondary() { - PC.Bus.CPUBus.Write8(CmdPort2, 0x20); - PC.Bus.CPUBus.Write8(CmdPort1, 0x20); + Kernel.CPUBus.Write8(CmdPort2, 0x20); + Kernel.CPUBus.Write8(CmdPort1, 0x20); } public static void Init() { // Init - PC.Bus.CPUBus.Write8(CmdPort1, 0x11); - PC.Bus.CPUBus.Write8(CmdPort2, 0x11); + Kernel.CPUBus.Write8(CmdPort1, 0x11); + Kernel.CPUBus.Write8(CmdPort2, 0x11); // Offsets - PC.Bus.CPUBus.Write8(DataPort1, 0x20); - PC.Bus.CPUBus.Write8(DataPort2, 0x28); + Kernel.CPUBus.Write8(DataPort1, 0x20); + Kernel.CPUBus.Write8(DataPort2, 0x28); // More Init - PC.Bus.CPUBus.Write8(DataPort1, 0x04); - PC.Bus.CPUBus.Write8(DataPort2, 0x02); + Kernel.CPUBus.Write8(DataPort1, 0x04); + Kernel.CPUBus.Write8(DataPort2, 0x02); // 8086 mode - PC.Bus.CPUBus.Write8(DataPort1, 0x01); - PC.Bus.CPUBus.Write8(DataPort2, 0x01); + Kernel.CPUBus.Write8(DataPort1, 0x01); + Kernel.CPUBus.Write8(DataPort2, 0x01); // Masks - 0 = receive all IRQ's // MTW, to disable PIT, send 0x1 to DataPort1 - PC.Bus.CPUBus.Write8(DataPort1, 0x00); - PC.Bus.CPUBus.Write8(DataPort2, 0x00); + Kernel.CPUBus.Write8(DataPort1, 0x00); + Kernel.CPUBus.Write8(DataPort2, 0x00); } } }