PCI-IDE interrupt based driver fixes, works on QEMU

This commit is contained in:
2026-03-15 10:15:01 +01:00
parent 3c10b76b3f
commit 5b432b2b01
6 changed files with 167 additions and 132 deletions

View File

@@ -30,11 +30,14 @@ static int device_probe_partitions_dos (struct proc* proc, struct reschedule_ctx
[XDRV_WRITE] = &partdrv_write,
};
DEBUG ("1\n");
spin_lock (&device->lock, &fd);
device_op (device, XDRV_GET_SECTOR_SIZE, proc, rctx, &fd, &sector_size);
DEBUG ("2\n");
int ret = device_op (device, XDRV_READ, proc, rctx, &fd, &sector, &sector_count, &mbr);
DEBUG ("3\n");
if (ret < 0) {
spin_unlock (&device->lock, fd);
@@ -45,6 +48,7 @@ static int device_probe_partitions_dos (struct proc* proc, struct reschedule_ctx
spin_unlock (&device->lock, fd);
return -ST_PARTITION_ERROR;
}
DEBUG ("4\n");
for (size_t i = 0; i < lengthof (mbr.ptes); i++) {
struct dos_pte* pte = &mbr.ptes[i];
@@ -60,9 +64,11 @@ static int device_probe_partitions_dos (struct proc* proc, struct reschedule_ctx
snprintf (key, sizeof (key), "%sp%zu", device->key, i);
device_create (key, ops, lengthof (ops), &partdrv_init, &partdrv_fini, &init, proc, rctx);
DEBUG ("5\n");
}
spin_unlock (&device->lock, fd);
DEBUG ("6\n");
return ST_OK;
}