The making of my 32bit Floppy Driver..
Re:The making of my 32bit Floppy Driver..
i know this sounds dumb but is it really necessary to setup the DMA chip for the read sector command (0x66). I'm just testing the read sector command (with a dummy DMA function call) and wanted to know if it is absolutely necssary to setup DMA or should i get an interrupt even without this.
i'm not getting one so i wanted to be sure it was not my code.
i'm not getting one so i wanted to be sure it was not my code.
Only Human
Re:The making of my 32bit Floppy Driver..
you *SHOULD* still get an int, but dont quote me on that. You want my dma code too? http://halfix.osdever.net/public/OS/kernel
it's in there. Feel free to take whatever you want. I would appreciate if you let me know. I want to make a list of people who use halfix's code on the website. Thanks.
it's in there. Feel free to take whatever you want. I would appreciate if you let me know. I want to make a list of people who use halfix's code on the website. Thanks.
Re:The making of my 32bit Floppy Driver..
I'm back with some more questions.
1) What exactly is the IDAM and what is its use or purpose?
2) what is a "deleted sector"? how does it differ from the other sectors?
3) Are you sure that you get a IRQ even without using DMA for the read command? If this is yes, then when you use DMA how do you know that a DMA transfer is completed if the IRQ has already been received before the DMA transfer completes?
4) Should i give the virtual address of a buffer to the DMA chip(implying that the DMA figures out what the physical address is) ? or do I have to give it the physical address only?
If anyone here knows the answers to these i would be grateful.
1) What exactly is the IDAM and what is its use or purpose?
2) what is a "deleted sector"? how does it differ from the other sectors?
3) Are you sure that you get a IRQ even without using DMA for the read command? If this is yes, then when you use DMA how do you know that a DMA transfer is completed if the IRQ has already been received before the DMA transfer completes?
4) Should i give the virtual address of a buffer to the DMA chip(implying that the DMA figures out what the physical address is) ? or do I have to give it the physical address only?
If anyone here knows the answers to these i would be grateful.
Only Human
Re:The making of my 32bit Floppy Driver..
AFAIK, you get an interrupt with DMA as soon as the buffer is full. So, if you don't set the dma properly, you don't get an interrupt but a deadlock.Neo wrote: 3) Are you sure that you get a IRQ even without using DMA for the read command? If this is yes, then when you use DMA how do you know that a DMA transfer is completed if the IRQ has already been received before the DMA transfer completes?
As everybody keeps telling you it has to be below 16M physical, and it's such an artifact from the 8086 days, do you think it can convert from virtual to physical?4) Should i give the virtual address of a buffer to the DMA chip(implying that the DMA figures out what the physical address is) ? or do I have to give it the physical address only?
If anyone here knows the answers to these i would be grateful.
Re:The making of my 32bit Floppy Driver..
Thanks candy. does anyone know anything about the other 2 questions?
Can anyone give me the steps to be followed to read a sector off the floppy?
right now this is what i do
1) power on the FDC
2) calibrate it
3) fix-drive-data (defaults)
4) seek to the cylinder
((4.1) must init dma here )
5) delay for head-settle time
6) send the 9 bytes
7) wait for an int (this is where im stuck)
is this right?
Can anyone give me the steps to be followed to read a sector off the floppy?
right now this is what i do
1) power on the FDC
2) calibrate it
3) fix-drive-data (defaults)
4) seek to the cylinder
((4.1) must init dma here )
5) delay for head-settle time
6) send the 9 bytes
7) wait for an int (this is where im stuck)
is this right?
Only Human
Re:The making of my 32bit Floppy Driver..
<drum roll, trumpets, cymbals crashing and faint noise of a FDD motor in the background...........>
YES! YES! i finally got my floppy disk driver to read any sector off the disk last night (i couldnt post then as it was too late). There is a lot of info i've learnt and will share it all later. There are some things that i think most of you guys whose FDD code i've seen, have overlooked (or am i wrong??? :-\ ). I will get back with a post of these later (when i'm a little more certain). right now i'm too happy to do anything useful.
<still the music plays as Neo is on cloud nine>
of course i have a lot more to do till my code can be called "reliable".
I'll be back.
YES! YES! i finally got my floppy disk driver to read any sector off the disk last night (i couldnt post then as it was too late). There is a lot of info i've learnt and will share it all later. There are some things that i think most of you guys whose FDD code i've seen, have overlooked (or am i wrong??? :-\ ). I will get back with a post of these later (when i'm a little more certain). right now i'm too happy to do anything useful.
<still the music plays as Neo is on cloud nine>
of course i have a lot more to do till my code can be called "reliable".
I'll be back.
Only Human
Re:The making of my 32bit Floppy Driver..
here's a quote straight from the horse's mouth (intel). (I'm really surprised none of you guys who have implemented your FDD drivers saw this so far or if you have why hasnt anyone done this)
i have read debs refrence and he does not mention this (it is after all a reference so thats okay i guess). Fabian Nunez's code does not (or am i missing something), Code slashers tutorial has no reference to this, and so have a dozen others whose code i've chanced to see. Please dont get me wrong i'm not poking at anyone i just wanted to let you guys know.
Another thing is the get_byte() function. apparently intel says that the MSR have a value of 0xC0 ( 11xx_xxxx binary ) not 0xD0 (1101_0000 binary). They both work though (as testing the RDY bit should'nt be wrong IMHO).
if i see anything else ill let you know.
see 4 sense ints.Since polling is enabled after a reset of the 82077AA,four SENSE INTERRUPT STATUS commands need to be issued afterwards to clear the status flags for each drive.
i have read debs refrence and he does not mention this (it is after all a reference so thats okay i guess). Fabian Nunez's code does not (or am i missing something), Code slashers tutorial has no reference to this, and so have a dozen others whose code i've chanced to see. Please dont get me wrong i'm not poking at anyone i just wanted to let you guys know.
Another thing is the get_byte() function. apparently intel says that the MSR have a value of 0xC0 ( 11xx_xxxx binary ) not 0xD0 (1101_0000 binary). They both work though (as testing the RDY bit should'nt be wrong IMHO).
if i see anything else ill let you know.
Only Human
Re:The making of my 32bit Floppy Driver..
Nice! Now you can start writing on that "Writing a floppy driver for dummies" tutorial with asm source for me.. ;-P
Re:The making of my 32bit Floppy Driver..
i was thinking of something like that but not right now i've just started off on the floppy so maybe after some real hardwork later.
btw i've written in it in C and used only a bit of ASM (which actually could be written in C too) but the steps will be clear. (Hopefully )
btw i've written in it in C and used only a bit of ASM (which actually could be written in C too) but the steps will be clear. (Hopefully )
Only Human
Re:The making of my 32bit Floppy Driver..
is my layout(attached here) of a 3 1/2" 1.44MB FAT12 floppy correct? Thanks in advance.
[attachment deleted by admin]
[attachment deleted by admin]
Only Human
Re:The making of my 32bit Floppy Driver..
last sector == 2879 decimal.Neo wrote: is my layout(attached here) of a 3 1/2" 1.44MB FAT12 floppy correct? Thanks in advance.
Yes it's correct - for the default fat12 floppies. You can have more or less FATs than you take for granted. Read microsofts fat docs.