QEMU - Add an IDE drive.
Posted: Wed Jul 21, 2021 1:05 pm
Hi
I want to develop an IDE driver (using https://wiki.osdev.org/PCI_IDE_Controller). In that article, it says that an IDE should be listed in the PCI with class 0x1 and subclass 0x1. This is my code of finding PCI devices: (Please ignore the mess... It just for testing. I will rewrite it later..)
When I run this code, I don't get any IDE device (I do get another devices).
So I went to Google, to check how to add an IDE disk to my emulator (QEMU). I didn't find how to do that.
Can someone please help me?
Thank's!
I want to develop an IDE driver (using https://wiki.osdev.org/PCI_IDE_Controller). In that article, it says that an IDE should be listed in the PCI with class 0x1 and subclass 0x1. This is my code of finding PCI devices: (Please ignore the mess... It just for testing. I will rewrite it later..)
Code: Select all
void PCI::check_device(uint8_t bus, uint8_t device)
{
uint16_t vendor_id = get_vendor_id(bus, device, 0);
if (vendor_id == PCI_VENDOR_ID_DEVICE_DOES_NOT_EXIST)
return;
uint8_t header_type = get_header_type(bus, device, 0);
if (header_type & PCI_HAS_MULTIPLE_FUNCTIONS_MASK)
{
for (int function = 0; function < PCI_NUMBER_OF_DEVICES_PER_BUS; function++)
{
uint8_t class_code = get_class_code(bus, device, function);
uint8_t sub_class_code = get_sub_class_code(bus, device, function);
kprintf("Class Code: %x, Sub Class Code: %x", (int) class_code, (int) (sub_class_code));
}
}
else
{
uint8_t class_code = get_class_code(bus, device, 0);
uint8_t sub_class_code = get_sub_class_code(bus, device, 0);
kprintf("Class Code: %x, Sub Class Code: %x", (int) class_code, (int) (sub_class_code));
}
}
So I went to Google, to check how to add an IDE disk to my emulator (QEMU). I didn't find how to do that.
Can someone please help me?
Thank's!