floppy driver that does not use DMA
floppy driver that does not use DMA
Hello, I am writing a floppy driver and have written most of it, but cannot figure out how to use it without the DMA. Is this just a matter of enabling the DMA bit in the digital output register? I cant quite get it working, but I bet there are a lot of other errors since I have no way to test it yet.
Re: floppy driver that does not use DMA
Hi,
I had a go at this myself a while ago and hit a couple of problems:
1. Many VMs/Emulators did not appear to fully support floppy PIO because it's not very common. Apparently real hardware can be buggy too.
2. I seem to remember hitting a problem with not recieving the data I was expecting - I got the result phase OK, but not the data.
Basically, most tutorials use DMA. If you want PIO, you pretty much have to do it from the datasheet.
Cheers,
Adam
I had a go at this myself a while ago and hit a couple of problems:
1. Many VMs/Emulators did not appear to fully support floppy PIO because it's not very common. Apparently real hardware can be buggy too.
2. I seem to remember hitting a problem with not recieving the data I was expecting - I got the result phase OK, but not the data.
Basically, most tutorials use DMA. If you want PIO, you pretty much have to do it from the datasheet.
Cheers,
Adam
Re: floppy driver that does not use DMA
the reason i did not want to go this route is if you have to have a dma driver to test the floppy driver, and you need a floppy driver or some other disk driver to test the dma driver, youll never know why it doesnt work if it doesnt work
Re: floppy driver that does not use DMA
Fair point, but generally the reason that my floppy driver didn't work is because I used PIO
The DMA really isn't that hard - once it is set up to expect data, the floppy controller does the rest. The only reason why my OS has no place for a DMA floppy driver is that I much prefer stack physical frame allocation, and I see no reason why I should have a separate memory allocation routine specifically for low memory, purely because of legacy DMA. If you are using bitmap allocation or already have separate low memory allocation, I'd go with a DMA floppy driver every time.
Cheers,
Adam
The DMA really isn't that hard - once it is set up to expect data, the floppy controller does the rest. The only reason why my OS has no place for a DMA floppy driver is that I much prefer stack physical frame allocation, and I see no reason why I should have a separate memory allocation routine specifically for low memory, purely because of legacy DMA. If you are using bitmap allocation or already have separate low memory allocation, I'd go with a DMA floppy driver every time.
Cheers,
Adam
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: floppy driver that does not use DMA
Debugging a DMA driver and a floppy driver at the same time shouldn't be a big problem, once you have a clear interface between them. I assume:
- The floppy driver is called on a read / write request, programs the floppy controller for reading / writing data using DMA and calls the DMA driver to set um DMA.
- The DMA driver is called by the floppy driver and programs the DMA chip.
- Does the floppy driver send the right commands to the floppy controller? If not, the floppy driver is buggy.
- Does the floppy driver send the right request parameters to the DMA driver? If not, the floppy driver is buggy.
- Does the DMA driver send the right commands to the DMA controller? If not, the DMA driver is buggy.
Re: floppy driver that does not use DMA
Hi,
Just as an addition to the above, if you use bochs you can log all debug events for the DMA and (this will produce a lot of output) the FDD. This should let you know what all your commands have done to the internal device registers. If it then fails to work on real hardware, check timings first!
Cheers,
Adam
Just as an addition to the above, if you use bochs you can log all debug events for the DMA and (this will produce a lot of output) the FDD. This should let you know what all your commands have done to the internal device registers. If it then fails to work on real hardware, check timings first!
Cheers,
Adam