Page 1 of 1

Inconsistency documentation floppies (and bochs error)

Posted: Thu Apr 23, 2009 2:31 pm
by Ferrarius
Hey everyone,

After having been out of OSdev for about half a year the virus thought it was time to infect me again. Good this time. half a year back I was working on an Operating System called MIK, I have rebooted that project, and it was going great until I started on the floppy read driver. I had little problem getting the basic commands working until I started the read function. As I have plenty of space and a good friend who once gave me his old computer I ha(d)(ve) both bochs and an actual computer as test systems. The first thing I ran into was bochs not firing an interrupt after the execution of a read command. I have already posted a bug report on the bochs page (I compiled the latest CVS snapshot, still not fixed). So when testing your floppy drivers under bochs, just comment out the waiting for the interrupt and hopefully it should work fine.
Second, I ran into a really strange thing with the result phase of the floppy drive. According to the documentation the result phase reports 7 results. the 8th of which is should return the read sector number (referred to in the documentation as R). When sending a sector number, this returns the sector number + the Sector Size (documentation => N). when reading in say Sector 7, the returned value (if successful) would be 9. This because N = 02, or sector size of 512 bytes. This was tested on two different computers, the only thing they have in common is their approximate age. Has anyone else ever encountered this apparent problem, or maybe even knows the source?