Page 1 of 1

Question about bochs/architectures [fixed/answered]

Posted: Tue Feb 27, 2007 11:09 am
by subbeh
Alright, well, my question is concerning any differences between bochs 2.2.5 and 2.3 in concern to their floppy device. Here's why I ask:

At home, on a linux box with bochs 2.3 and i think gcc 3.4.3 ( may be a newer version ), I have the following occurring during my reads issued from my floppy controller (summarized version):

calibrates the drive
seeks to the sector
transfers data into buffer using DMA
issues an interrupt
reads the results and finishes

This is how it's supposed to operate, I believe. Unless I've forgotten something, it should throw an interrupt when the read is complete. Now at school I'm using Mac Os X with bochs 2.2.5 and i386-gcc-3.4.3. Here's the sequence of events at school:

calibrates the drive
seeks to the sector
transfers data into buffer using DMA
then never throws an interrupt.

So, I guess to be more specific, my question is why would on one system an interrupt be thrown and, at least to my eyes, the read work perfectly... but on a different machine/architecture using the same, albeit older, version of an x86 emulator not work perfectly, or hardly right at all?

you can find my floppy controller code here:
http://users.csc.tntech.edu/~WFAderhold21/src/floppy.h

and all my code, if it might be a problem there, here:
http://users.csc.tntech.edu/~WFAderhold ... 07.os.3.gz

I appreciate your help.

Posted: Tue Feb 27, 2007 12:25 pm
by bubach
I you checked bochs changelogs, not likely but, maybe it did contain a bug?

If not, try comparing your code againts some well known source like:
http://bos.asmhackers.net/docs/floppy/snippet_9/fdc.c

And also double and triple check against:
http://bos.asmhackers.net/docs/floppy/docs/29047403.PDF

Posted: Tue Feb 27, 2007 12:48 pm
by subbeh
Hmm.. Well I just installed bochs 2.2.5 on a windows machine and found out that it didn't throw an interrupt either. And after reading your post, and thinking that I looked at the change logs before, found out that in the change from 2.2.5 to 2.2.6, they switched over to the 82077AA for the floppy controller type which is what my code would work for.

I will double check my code against the code you linked though and thanks for the link to that pdf. I was using the 82077AA data sheet up until now praying that bochs supported that :P

Thank you, bubach :D