Secondary ATA Controller causes exception (SOLVED)
Posted: Thu Oct 11, 2007 7:12 pm
Hello again, I've finally gotten my ATA driver to read sectors successfully from my primary master drive. However, when I use the same code to try to access my secondary master drive, I get an exception (99.99% sure it's exception 6, Invalid Opcode). The only change I make is changing the 0x1f0 in the finddrive() function to 0x170.
Here's the code:
<removed>
The strange thing is, the exception is never thrown at the same point. Once (and only once) it managed to successfully read in the secondary master drive's MBR with no problem. Sometimes it gets halfway through a kprint() before the exception comes. Other times it doesn't get past the READSECTORS command.
I'm not sure if it has any relevance at all, but the hardware *might* have something to do with it. My motherboard has a JMicron AHCI for its IDE interface, so I can't communicate with my ATA drives like I would be able to in most computers (my Gentoo couldn't see my ATA drive until I recompiled my Linux kernel with JMicron support).
I have two SATA drives in the computer, one that is my main and one for storage. My motherboard does ATA emulation with these; the main drive appears as a Primary Master ATA disk, and the storage drive appears as the Secondary Master ATA disk. I can read from my main hard drive (the "primary master") fine, but the problem comes up when I try to read from the storage drive (the "secondary master").
Here's the code:
<removed>
The strange thing is, the exception is never thrown at the same point. Once (and only once) it managed to successfully read in the secondary master drive's MBR with no problem. Sometimes it gets halfway through a kprint() before the exception comes. Other times it doesn't get past the READSECTORS command.
I'm not sure if it has any relevance at all, but the hardware *might* have something to do with it. My motherboard has a JMicron AHCI for its IDE interface, so I can't communicate with my ATA drives like I would be able to in most computers (my Gentoo couldn't see my ATA drive until I recompiled my Linux kernel with JMicron support).
I have two SATA drives in the computer, one that is my main and one for storage. My motherboard does ATA emulation with these; the main drive appears as a Primary Master ATA disk, and the storage drive appears as the Secondary Master ATA disk. I can read from my main hard drive (the "primary master") fine, but the problem comes up when I try to read from the storage drive (the "secondary master").