Page 1 of 1

Demo15 / Floppy Disk / DMA problem

PostPosted: Thu Jul 21, 2011 10:10 pm
by Insightsoft
Hi, guys...

the floppy/DMA/read is returning 0x00s. Any clue?
it's configured with buffer starting at 0x1000 (page 1)

Re: Demo15 / Floppy Disk / DMA problem

PostPosted: Fri Jul 22, 2011 4:17 am
by Insightsoft
Hi,

Code: Select all
//! initialize DMA to use phys addr 84k-128k
void flpydsk_initialize_dma ()
{
   outportb (0x0a,0x06);   //mask dma channel 2

   outportb (0xd8,0xff);   //reset master flip-flop

   outportb (0x04, 0);     //address=0x1000
   outportb (0x04, 0x10);

   outportb (0xd8, 0xff);  //reset master flip-flop

   outportb (0x05, 0xff);  //count to 0x23ff (number of bytes in a 3.5" floppy disk track)
   outportb (0x05, 0x23);

   outportb (0x80, 0);     //external page register = 0

   outportb (0x0a, 0x02);  //unmask dma channel 2
}


Questions:
1) Why are you using D8 port? where to find more details about ports ranging from 0x0c0 to 0x0df (8237 DMA controller 2 (AT))?? (I'm looking for 'Microprocessor and Peripherals Handbook' from 70/80's)
2) Why are you using 80 port? why not the 81? (Hight order 4 bits of DMA channel 2 address)

Thanks,

Re: Demo15 / Floppy Disk / DMA problem

PostPosted: Mon Jul 25, 2011 1:12 pm
by pathos
I had problems with my floppy read as well, and had to move the buffer. Try that.

Re: Demo15 / Floppy Disk / DMA problem

PostPosted: Tue Jul 26, 2011 12:13 am
by Insightsoft
even it works, I don't understand why using port 0x80 and not 0x81 (that is specific for channel 2). Why D8 and not 0C??? (for flip flop)...
I'm using different ports, is working with any address supported by the chips...
But, as always, I need to know why that ports... can you, please, explain? Thanks