From 28599af3873cb53a4b8c12415353231bfacea576 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 19 Dec 2020 12:53:34 +0200 Subject: [PATCH] Kernel: Allow to initialize an IDE device on the secondary channel We now use major number 3, and the minor number is set to 0 or 2 if initialized on the primary channel, otherwise 1 or 3 on the secondary channel. --- Kernel/Storage/IDEChannel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Kernel/Storage/IDEChannel.cpp b/Kernel/Storage/IDEChannel.cpp index 3a2aa3eb73..0bb1e41e34 100644 --- a/Kernel/Storage/IDEChannel.cpp +++ b/Kernel/Storage/IDEChannel.cpp @@ -356,11 +356,10 @@ void IDEChannel::detect_disks() continue; klog() << "IDEChannel: Name=" << ((char*)bbuf.data() + 54) << ", C/H/Spt=" << cyls << "/" << heads << "/" << spt; - int major = (m_channel_number == 0) ? 3 : 4; if (i == 0) { - m_master = PATADiskDevice::create(m_parent_controller, *this, PATADiskDevice::DriveType::Master, cyls, heads, spt, major, 0); + m_master = PATADiskDevice::create(m_parent_controller, *this, PATADiskDevice::DriveType::Master, cyls, heads, spt, 3, (m_channel_number == 0) ? 0 : 2); } else { - m_slave = PATADiskDevice::create(m_parent_controller, *this, PATADiskDevice::DriveType::Slave, cyls, heads, spt, major, 1); + m_slave = PATADiskDevice::create(m_parent_controller, *this, PATADiskDevice::DriveType::Slave, cyls, heads, spt, 3, (m_channel_number == 0) ? 1 : 3); } } }