Kernel: ATABuses are but to compatibility mode if possible

I don't support native mode ata bus (irq sharing) so ata buses are
but to compatibility mode if possible.
This commit is contained in:
2023-10-16 16:56:12 +03:00
parent c4a640bcb6
commit 0c88c74b76
2 changed files with 18 additions and 3 deletions

View File

@@ -41,6 +41,20 @@ namespace Kernel
uint8_t prog_if = m_pci_device.read_byte(0x09);
if ((prog_if & ATA_PROGIF_CAN_MODIFY_PRIMARY_NATIVE) && (prog_if & ATA_PROGIF_PRIMARY_NATIVE))
{
prog_if &= ~ATA_PROGIF_PRIMARY_NATIVE;
m_pci_device.write_byte(0x09, prog_if);
dprintln("enabling compatibility mode for bus 1");
}
if ((prog_if & ATA_PROGIF_CAN_MODIFY_SECONDARY_NATIVE) && (prog_if & ATA_PROGIF_SECONDARY_NATIVE))
{
prog_if &= ~ATA_PROGIF_SECONDARY_NATIVE;
m_pci_device.write_byte(0x09, prog_if);
dprintln("enabling compatibility mode for bus 2");
}
if (!(prog_if & ATA_PROGIF_PRIMARY_NATIVE))
{
auto bus_or_error = ATABus::create(0x1F0, 0x3F6, 14);
@@ -54,7 +68,6 @@ namespace Kernel
dprintln("unsupported IDE ATABus in native mode");
}
// BUS 2
if (!(prog_if & ATA_PROGIF_SECONDARY_NATIVE))
{
auto bus_or_error = ATABus::create(0x170, 0x376, 15);