Commit Graph

255 Commits

Author SHA1 Message Date
Liav A
78ae4b0530 Kernel: Change the indexing of storage devices in IDEController class
Previously, the indexing scheme was that 0 is Primary-Master, 1 is
Primary-Slave, 2 is Secondary-Master, 3 is Secondary-Slave.

Instead of merely matching between numbers to the channel & position,
the IDEController code will try to find all available drives connected to
the two channels, then it will create a Vector with nonnull RefPtr to
them. Then we take use the given index with this Vector.
2020-12-21 00:19:21 +01:00
Liav A
6a691306b5 Kernel: Add a method to gather the devices count of a Storage controller
Also, change device() method to be const.
2020-12-21 00:19:21 +01:00
Liav A
e3b3805abf Kernel: Add a method to check the type of a StorageController
Also, the device method in the StorageController class is public now.
2020-12-21 00:19:21 +01:00
Liav A
28599af387 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.
2020-12-21 00:19:21 +01:00
Liav A
0a2b00a1bf Kernel: Introduce the new Storage subsystem
This new subsystem is somewhat replacing the IDE disk code we had with a
new flexible design.

StorageDevice is a generic class that represent a generic storage
device. It is meant that specific storage hardware will override the
interface. StorageController is a generic class that represent
a storage controller that can be found in a machine.

The IDEController class governs two IDEChannels. An IDEChannel is
responsible to manage the master & slave devices of the channel,
therefore an IDEChannel is an IRQHandler.
2020-12-21 00:19:21 +01:00