From 6c1a549057d56b1771efc6aa89e264e9b8c41976 Mon Sep 17 00:00:00 2001 From: Jesse Buhagiar Date: Fri, 1 Nov 2019 14:30:10 +1100 Subject: [PATCH] PATAChannel: Alert user when no PCI device is found This helps aid debugging of issues such as #695, where the bridge chip that controls IDE is NOT a PIIX3/4 compatible controller. Instead of just hanging when the DMA registers can't be accessed, the system will inform the user that no valid IDE controller has been found. In this case, the system will not attempt to initialise the DMA registers and instead use PIO mode. --- Kernel/Devices/PATAChannel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/Devices/PATAChannel.cpp b/Kernel/Devices/PATAChannel.cpp index 4d78562a8d..8ba881d02f 100644 --- a/Kernel/Devices/PATAChannel.cpp +++ b/Kernel/Devices/PATAChannel.cpp @@ -124,6 +124,8 @@ void PATAChannel::initialize() m_bus_master_base = PCI::get_BAR4(m_pci_address) & 0xfffc; m_dma_buffer_page = MM.allocate_supervisor_physical_page(); kprintf("PATAChannel: PIIX Bus master IDE: I/O @ %x\n", m_bus_master_base); + } else { + kprintf("PATAChannel: Unable to find valid PATAChannel controller! Falling back to PIO mode!\n"); } }