Page 1 of 1

IDE + DMA setup - no interrupts

Posted: Tue Dec 30, 2014 7:52 am
by Mirimar
Hello there,

I've read the following post in this forum: http://forum.osdev.org/viewtopic.php?t=19056

Unfortunately I'm facing the same problems as the author of this post (but with qemu). PIO is working but if I try to switch to UDMA/DMA I get no more interrupts.

Maybe somone has already a working driver and can help me do overcome this problem. I've tried the same things as in the above montioned post stated, so it is obviouse to me that there is something missing in the list of things todo . Ar, maybe this helps you to help: I can get interrupts when i forget to set the EOT bit in the PRD, of course no data has been transfered then.

Thx for your patience and help ;)

Edit: Here is my code, it is only the snippet setting up the transfer, i've double checked the addresses they are fullfilling the requierment (alignment)

Code: Select all

    descriptors_[0].setAddress((uint32)calculatePhysicalAddressOfKernelAddress((pointer)data), num_sectors * 256);
    descriptors_[0].setEot();
    outbp(bus_master_base_ + BM_COMMAND, 0x0);
    outportl(bus_master_base_ + BM_PRD_ADDR, (uint32)calculatePhysicalAddressOfKernelAddress((pointer)descriptors_));
    outbp(bus_master_base_ + BM_COMMAND, 0x1);
    outbp(port + 6, (drive | head)); // drive and head selection
    outbp(port + 2, num_sectors); // number of sectors to read
    outbp(port + 3, sect); // starting sector
    outbp(port + 4, lo); // cylinder low
    outbp(port + 5, high); // cylinder high
    /* Wait for drive to set DRDY */
    jiffies = 0;
    while (!(inbp(port + 7) & 0x40) && jiffies++ < IO_TIMEOUT)
      ArchInterrupts::yieldIfIFSet();
    if (jiffies >= IO_TIMEOUT)
    {
      TIMEOUT_WARNING();
      return -1;
    }
    outbp(port + 7, 0xC8);
    debug("Send UDMA read request for %d sectors\n", num_sectors);