diff --git a/source/Cosmos.HAL2/PciDevice.cs b/source/Cosmos.HAL2/PciDevice.cs index 572a6c928..6419beceb 100644 --- a/source/Cosmos.HAL2/PciDevice.cs +++ b/source/Cosmos.HAL2/PciDevice.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -198,6 +198,20 @@ namespace Cosmos.HAL WriteRegister16(0x04, command); } + public void EnableBusMaster(bool enable) + { + UInt16 command = ReadRegister16(0x04); + + UInt16 flags = (1 << 2); + + if (enable) + command |= flags; + else + command &= (ushort)~flags; + + WriteRegister16(0x04, command); + } + public class DeviceClass { public static string GetString(PCIDevice device) @@ -345,4 +359,4 @@ namespace Cosmos.HAL get { return isIO; } } } -} \ No newline at end of file +}