diff --git a/Kernel/core/pci.cpp b/Kernel/core/pci.cpp index d8e9b3c3..f521bff5 100644 --- a/Kernel/core/pci.cpp +++ b/Kernel/core/pci.cpp @@ -982,6 +982,18 @@ namespace PCI } } + void Manager::InitializeDevice(PCIDevice Device, Memory::PageTable *Table) + { + this->MapPCIAddresses(Device, Table); + + PCI::PCIDeviceHeader *Header = Device.Header; + + Header->Command |= PCI_COMMAND_MASTER | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY; + Header->Command &= ~PCI_COMMAND_INTX_DISABLE; + } + void Manager::EnumerateFunction(uint64_t DeviceAddress, uint32_t Function, PCIDevice dev) { dev.Function = Function; diff --git a/Kernel/include/pci.hpp b/Kernel/include/pci.hpp index f945d814..4b110400 100644 --- a/Kernel/include/pci.hpp +++ b/Kernel/include/pci.hpp @@ -232,6 +232,7 @@ namespace PCI public: std::list GetDevices() { return Devices; } void MapPCIAddresses(PCIDevice Device, Memory::PageTable *Table); + void InitializeDevice(PCIDevice Device, Memory::PageTable *Table); void EnumerateFunction(uint64_t DeviceAddress, uint32_t Function, PCIDevice dev); void EnumerateDevice(uint64_t BusAddress, uint32_t Device, PCIDevice dev); void EnumerateBus(uint64_t BaseAddress, uint32_t Bus, PCIDevice dev);