Support up to 4 ATA drives (primary and secondary bus)

This commit is contained in:
2025-10-19 15:46:56 +02:00
parent 4452f1b196
commit c3621a33dc
4 changed files with 155 additions and 66 deletions

View File

@ -32,7 +32,10 @@ void storedev_register_dev_entry(StoreDev *sd, int32_t sdtype) {
if (sdtype == STOREDEV_RAMSD) {
ksprintf(key, "ramsd-%zu", ramsd_counter++);
} else if (sdtype == STOREDEV_ATASD) {
ksprintf(key, "atasd-ch0-%c", sd->sd.atasd.devno == 0x00 ? 'M' : 'S');
ksprintf(key, "atasd-ch%d-%c",
sd->sd.atasd.iobase == 0x1F0 ? 0 : 1,
sd->sd.atasd.devno == 0x00 ? 'M' : 'S'
);
}
spinlock_acquire(&DEVTABLE.spinlock);