summaryrefslogtreecommitdiff
path: root/Kernel/Storage
AgeCommit message (Collapse)Author
2020-12-27Kernel: Introduce a new partitioning subsystemLiav A
The partitioning code was very outdated, and required a full refactor. The new subsystem removes duplicated code and uses more AK containers. The most important change is that all implementations of the PartitionTable class conform to one interface, which made it possible to remove unnecessary code in the EBRPartitionTable class. Finding partitions is now done in the StorageManagement singleton, instead of doing so in init.cpp. Also, now we don't try to find partitions on demand - the kernel will try to detect if a StorageDevice is partitioned, and if so, will check what is the partition table, which could be MBR, GUID or EBR. Then, it will create DiskPartitionMetadata object for each partition that is available in the partition table. This object will be used by the partition enumeration code to create a DiskPartition with the correct minor number.
2020-12-27Kernel: Add DiskPartitionMetadata ClassLiav A
This class will be used to describe a partition of a StorageDevice, without creating a DiskPartition object.
2020-12-27Kernel: Move Partition code files to the Storage folderLiav A
This folder is more appropriate for these files.
2020-12-27Kernel: Add a method to determine the desired permissions of a DeviceLiav A
This method will be used later in DevFS, to set the appropriate permissions for each device node.
2020-12-25AK: Remove custom %b format string specifierAndreas Kling
This was a non-standard specifier alias for %02x. This patch replaces all uses of it with new-style formatting functions instead.
2020-12-21Kernel: Introduce the StorageManagement classLiav A
The StorageManagement class has 2 roles: 1. During boot, it should find all storage controllers in the machine, and then determine what is the boot device. 2. Later on boot, it is a registrar of all storage controllers and storage devices. Thus, it could be used to show information about these devices when implemented. This change allows the user to specify a boot driver other than /dev/hda and if it's connected in the machine - it will boot.
2020-12-21Kernel: Change the indexing of storage devices in IDEController classLiav A
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-21Kernel: Add a method to gather the devices count of a Storage controllerLiav A
Also, change device() method to be const.
2020-12-21Kernel: Add a method to check the type of a StorageControllerLiav A
Also, the device method in the StorageController class is public now.
2020-12-21Kernel: Allow to initialize an IDE device on the secondary channelLiav A
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-21Kernel: Introduce the new Storage subsystemLiav A
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.