diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/Cosmos.Core.csproj b/source2/Kernel/System/Hardware/Core/Cosmos.Core/Cosmos.Core.csproj index b9e32189d..1442c3bf9 100644 --- a/source2/Kernel/System/Hardware/Core/Cosmos.Core/Cosmos.Core.csproj +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/Cosmos.Core.csproj @@ -55,6 +55,7 @@ + diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/DeviceIDAttribute.cs b/source2/Kernel/System/Hardware/Core/Cosmos.Core/DeviceIDAttribute.cs index 134e34517..b1db92b1f 100644 --- a/source2/Kernel/System/Hardware/Core/Cosmos.Core/DeviceIDAttribute.cs +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/DeviceIDAttribute.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; namespace Cosmos.Core { + [AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)] public class DeviceIDAttribute : Attribute { public UInt16 VendorID; public UInt16 DeviceID; diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/IOGroup/PciDevice.cs b/source2/Kernel/System/Hardware/Core/Cosmos.Core/IOGroup/PciDevice.cs new file mode 100644 index 000000000..040784162 --- /dev/null +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/IOGroup/PciDevice.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Cosmos.Core.IOGroup { + public class PciDevice { + internal PciDevice() { + } + } +} diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.cs b/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.cs index 9d030b1e6..0d2b5fee8 100644 --- a/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.cs +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.cs @@ -6,6 +6,17 @@ using Cosmos.Common.Extensions; namespace Cosmos.Core { public class PciBus { + public class PciInfo { + public readonly UInt16 VendorID; + public readonly UInt16 DeviceID; + + public PciInfo(UInt16 aVendorID, UInt16 aDeviceID) { + VendorID = aVendorID; + DeviceID = aDeviceID; + } + } + static public Action OnPCIDeviceFound; + protected IOGroup.PciBus IO = new IOGroup.PciBus(); public PciBus() { @@ -50,7 +61,9 @@ namespace Cosmos.Core { UInt16 xVendorID = (UInt16)(x & 0xFFFF); UInt16 xDeviceID = (UInt16)(x >> 16); - Global.Dbg.Send("PCI Ven:" + xVendorID.ToHex() + " Dev:" + xDeviceID.ToHex()); + var xInfo = new PciInfo(xVendorID, xDeviceID); + var xIO = new IOGroup.PciDevice(); + OnPCIDeviceFound(xInfo, xIO); } diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.html b/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.html index 648eb188d..e4b4fbcef 100644 --- a/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.html +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/PciBus.html @@ -19,51 +19,24 @@

VMWare Worksation

Intel: 8086
-PCI Ven:8086 Dev:7190
-PCI Ven:8086 Dev:7191
-PCI Ven:8086 Dev:7110
-PCI Ven:8086 Dev:7111
-PCI Ven:8086 Dev:7113
-PCI Ven:8086 Dev:7112
-
PCI Ven:104b Dev:1040
-
PCI Ven:1022 Dev:2000
-
PCI Ven:1274 Dev:1371
-
PCI Ven:15ad Dev:0740
-PCI Ven:15ad Dev:0405
-PCI Ven:15ad Dev:0790
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:07a0
-PCI Ven:15ad Dev:0770
+7190: 440BX/ZX AGPset Host Bridge +7191: 440BX/ZX AGPset PCI-to-PCI bridge +7110: PIIX4/4E/4M ISBridgeA +7111: PIIX4/4E/4M IDE Controller 82371AB/EB/MB +7113: PIIX4/4E/4M Power Management Controller +7112: PIIX4/4E/4M USB Interface +
Mylex / Buslogic: 104B
+1040: BT958 SCSI Host Adaptor
+
Advanced Micro Devices: 1022
+2000: PCnet LANCE PCI Ethernet Controller Am79C970/1/2/3/5/6
+
Ensoniq: 1274
+1371: AudioPCI ES 1371
+
VMWare: 15AD
+0740: VMWare VMCI Bus Device
+0405: NVIDIA 9500MGS Graphics
+0790: PCI bridge
+07A0: (32 instances) EHCI USB Controller
+0770: Standard Enhanced PCI to USB Host Controller
 
diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/ATA.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/ATA.cs index 9a1750db0..a3148e1f9 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/ATA.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/ATA.cs @@ -5,5 +5,10 @@ using System.Text; namespace Cosmos.Hardware { public class ATA { + protected Core.IOGroup.PciDevice IO; + + public ATA(Core.IOGroup.PciDevice aIO) { + IO = aIO; + } } } diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/Cosmos.Hardware.csproj b/source2/Kernel/System/Hardware/Cosmos.Hardware/Cosmos.Hardware.csproj index 19fb25c76..251c690cf 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/Cosmos.Hardware.csproj +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/Cosmos.Hardware.csproj @@ -74,6 +74,7 @@ + diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/Drivers/ReadMe.html b/source2/Kernel/System/Hardware/Cosmos.Hardware/Drivers/ReadMe.html new file mode 100644 index 000000000..4b9d1f4b2 --- /dev/null +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/Drivers/ReadMe.html @@ -0,0 +1,16 @@ + + + + + + + +

+ Dynamically loaded drivers are contained in this folder. In the future they may + be in different assemblies which are loaded on demand. The drivers in the root + folder are not dynamic, and are drivers that are required for all systems, or + are common bases used by dynamic drivers. For example, ATA exists in the root, + but actual ATA chipsets should exist in this directory.

+ + + \ No newline at end of file diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs index 033026919..dd179ff7b 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs @@ -10,11 +10,20 @@ namespace Cosmos.Hardware { static public Keyboard Keyboard = new Keyboard(); static public PIT PIT = new PIT(); static public TextScreen TextScreen = new TextScreen(); + static public ATA ATA; static public void Init() { Global.Dbg.Send("Cosmos.Hardware.Global.Init"); + Core.PciBus.OnPCIDeviceFound = PCIDeviceFound; Cosmos.Core.Global.Init(); } + static void PCIDeviceFound(Core.PciBus.PciInfo aInfo, Core.IOGroup.PciDevice aIO) { + // Later we need to dynamically load these, but we need to finish the design first. + if ((aInfo.VendorID == 0x8086) && (aInfo.DeviceID == 0x7111)) { + ATA = new ATA(aIO); + } + } + } }