Bochs floppy error?!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
metallevel
Posts: 18
Joined: Thu May 17, 2012 12:43 pm
Location: in front of a computer

Bochs floppy error?!

Post by metallevel »

I've been writing a pmode floppy driver, and it seems to unexperienced me that it should be working. I haven't had the chance to test it on real hardware yet, but I seem to be getting real hardware errors IN BOCHS! Specifically, when I try to read a sector, the status registers are as follows:
ST0: 0x00
ST1: 0x03
ST2: 0x01
The FDC datasheet indicates that this means the disk is write protected (wtf?!) and missing address marks. First of all I'm pretty darn sure I'm reading, not writing. Maybe because the markers are missing the FDC is warning me that if I want to write I can't? Second, I've re-checked my code several times and, except for retries, it seems completely in order according to the FDC wiki page and a couple tutorials I'm gone through.

I'm gonna try adding retries soon, but right now my question is: does bochs now emulate floppy errors? I'm using version 2.5.1, and just tested my code on the smp derivative of that version as well. On there ST2 is 0xF5 (?). I'm not sure about that one, according to the datasheet on the wiki some of those bits should be zero (of course, I doubt bochs simulates the 82077AA perfectly or if it even intends to). Either way, address mark missing?! Has anyone else run into this using bochs?

BTW no my sector didn't get read, obviously.
metallevel
Posts: 18
Joined: Thu May 17, 2012 12:43 pm
Location: in front of a computer

Re: Bochs floppy error?!

Post by metallevel »

NVM, I found the problem: I was using the wrong register to store my floppy IRQ count. So I never waited for the interrupt and tried to read the result bytes during the execution phase. That must have stopped the read before anything had been transferred. I guess it makes sense now that no address mark was "found", but I'm still impressed that bochs emulated at least this behavior =D>
Post Reply