ATAPI setback.
Posted: Thu Nov 03, 2005 4:34 am
My name is Exabyte, I'm creating a CD-ROM based operating system. I've been at work for several weeks now, and throughout that time, I've mostly read developers documents and books.
I do not program features until I understand how they work and why they work, so it's been quite slow to begin with, mainly because of problems with the endian system malforming my GDT data.
I'm at a point where I need to load my kernel into the memory (from the CD-ROM), but there is a setback: The commands do not return any data.
Here's what I'm doing:
Select Correct Drive
Wait For Correct Status
Send Packet
Wait For DRQ
Recieve Data
I know the packet commands work, if I change the command to a NOP or something, then the DRQ stays blank and the program freezes because it waits forever until it's ready.
When I recieve the data though, that's a whole different story. For every read (of port 0x1F0) the result returns 0xFF, at least that's what bochs says.
Please could someone point out what I'm missing here? This is such an annoying problem, and the documentation just doesn't cover it.
I do not program features until I understand how they work and why they work, so it's been quite slow to begin with, mainly because of problems with the endian system malforming my GDT data.
I'm at a point where I need to load my kernel into the memory (from the CD-ROM), but there is a setback: The commands do not return any data.
Here's what I'm doing:
Select Correct Drive
Wait For Correct Status
Send Packet
Wait For DRQ
Recieve Data
I know the packet commands work, if I change the command to a NOP or something, then the DRQ stays blank and the program freezes because it waits forever until it's ready.
When I recieve the data though, that's a whole different story. For every read (of port 0x1F0) the result returns 0xFF, at least that's what bochs says.
Please could someone point out what I'm missing here? This is such an annoying problem, and the documentation just doesn't cover it.