Ata interrupts fires constantly on real hardware

63 views Asked by At

I have been writing some ata stuff recently. On real hardware the ata controller uses IRQ_11. To get the driver to work I had to mask IRQ_11 because it would constantly fire after issuing the identify command. Down here is some simplified code which will cause the problem.

  mov si, 45056 ;Real hardware port

  mov dx, si
  add dx, 6
  mov al, 0xA0
  out dx, al ;Select drive (master in this test)
  
  
  push 10 ;Give controller a bit more time
  call wait_milliseconds
    
  ;These things should be set to 0
    
  mov dx, si
  add dx, 3
  mov al, 0
  out dx, al ;Set to 0
    
  mov dx, si
  add dx, 4
  mov al, 0
  out dx, al ;Set to 0
    
  mov dx, si
  add dx, 5
  mov al, 0
  out dx, al ;Set to 0
  
  ;Send identify command
  mov dx, si
  add dx, 7
  mov al, 0xEC
  out dx, al

I have made sure my handler sends a EOI. I am also sure that my Pic is remapped. I have also tried reading the status port after, as well as in the handler. I really have no idea why this thing will constantly fire and filling the screen with the message I put in my handler.

0

There are 0 answers