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
Showing only changes of commit ba46399bbd - Show all commits

View File

@ -516,14 +516,6 @@ namespace ATA
kinfoln("ata: Drive %d capacity information: Block Count=%lu, Block Size=%lu, Total Capacity=%lu",
m_drive_index, m_block_count, m_block_size, total_capacity);
char buf[2048];
if (atapi_read_pio(0, buf, sizeof(buf)).has_error()) return false;
char readable[2049];
for (int i = 0; i < 2048; i++) { readable[i] = _iscntrl(buf[i]) ? '.' : buf[i]; }
readable[2048] = 0;
kinfoln("ata: Read first sector from CD-ROM: %s", readable);
return true;
}
@ -693,7 +685,6 @@ namespace ATA
const usize blocks_per_page = ARCH_PAGE_SIZE / m_block_size;
if (m_is_atapi)
{
kdbgln("ata: Reading %zu blocks from ATAPI drive using PIO, at LBA %ld", nblocks, lba);
while (nblocks > blocks_per_page)
{
TRY(atapi_read_pio(lba, out, ARCH_PAGE_SIZE));