summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-12-19 12:53:34 +0200
committerAndreas Kling <kling@serenityos.org>2020-12-21 00:19:21 +0100
commit28599af3873cb53a4b8c12415353231bfacea576 (patch)
treebdda0893079f205612df9f3fa4c6b2dee4bf4f0d /Kernel
parent0a2b00a1bf6fa1eb23fbf95a6759c8fc16d24b81 (diff)
downloadserenity-28599af3873cb53a4b8c12415353231bfacea576.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Storage/IDEChannel.cpp5
1 files 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);
}
}
}