1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

Kernel: Introduce two new boot arguments to assist with bare metal debug

The first one is for disabling the PS2 controller, the other one is for
disabling physical storage enumeration.
We can't be sure any machine will work with our implementation,
therefore this will help us to test more machines.
This commit is contained in:
Liav A 2021-04-08 21:18:48 +03:00 committed by Andreas Kling
parent 649564585e
commit a0be30f655
4 changed files with 24 additions and 9 deletions

View file

@ -65,18 +65,20 @@ bool StorageManagement::boot_argument_contains_partition_uuid()
UNMAP_AFTER_INIT NonnullRefPtrVector<StorageController> StorageManagement::enumerate_controllers(bool force_pio) const
{
NonnullRefPtrVector<StorageController> controllers;
if (kernel_command_line().is_ide_enabled()) {
if (!kernel_command_line().disable_physical_storage()) {
if (kernel_command_line().is_ide_enabled()) {
PCI::enumerate([&](const PCI::Address& address, PCI::ID) {
if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x1) {
controllers.append(IDEController::initialize(address, force_pio));
}
});
}
PCI::enumerate([&](const PCI::Address& address, PCI::ID) {
if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x1) {
controllers.append(IDEController::initialize(address, force_pio));
if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x6 && PCI::get_programming_interface(address) == 0x1) {
controllers.append(AHCIController::initialize(address));
}
});
}
PCI::enumerate([&](const PCI::Address& address, PCI::ID) {
if (PCI::get_class(address) == 0x1 && PCI::get_subclass(address) == 0x6 && PCI::get_programming_interface(address) == 0x1) {
controllers.append(AHCIController::initialize(address));
}
});
controllers.append(RamdiskController::initialize());
return controllers;
}