Add ATA drive support #27

Merged
apio merged 28 commits from please-read-my-ata-drive into main 2023-06-16 19:40:11 +00:00
2 changed files with 9 additions and 0 deletions
Showing only changes of commit 268252c89e - Show all commits

View File

@ -187,6 +187,14 @@ namespace ATA
m_io_base = io_base_address;
m_control_base = control_port_base_address + 2;
auto io_busmaster = m_controller->device().getBAR(4);
if (!io_busmaster.is_iospace())
{
kwarnln("ata: Channel %d's busmaster base BAR is not in IO space", m_channel_index);
return false;
}
m_busmaster_base = io_busmaster.port() + (u16)(m_channel_index * 8u);
if (m_is_pci_native_mode) m_interrupt_line = PCI::read8(m_controller->device().address, PCI::InterruptLine);
else
m_interrupt_line = m_channel_index ? 15 : 14;

View File

@ -120,6 +120,7 @@ namespace ATA
u16 m_io_base;
u16 m_control_base;
u16 m_busmaster_base;
u8 m_current_drive = (u8)-1;