Demo15 / Floppy Disk / DMA problem

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator: Moderators

Demo15 / Floppy Disk / DMA problem

Postby Insightsoft » Thu Jul 21, 2011 10:10 pm

Hi, guys...

the floppy/DMA/read is returning 0x00s. Any clue?
it's configured with buffer starting at 0x1000 (page 1)
_____________
Think it, build it, bit by bit...
Insightsoft
 
Posts: 63
Joined: Wed Jul 22, 2009 6:44 am

Re: Demo15 / Floppy Disk / DMA problem

Postby Insightsoft » Fri Jul 22, 2011 4:17 am

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,
_____________
Think it, build it, bit by bit...
Insightsoft
 
Posts: 63
Joined: Wed Jul 22, 2009 6:44 am

Re: Demo15 / Floppy Disk / DMA problem

Postby pathos » Mon Jul 25, 2011 1:12 pm

I had problems with my floppy read as well, and had to move the buffer. Try that.
pathos
Moderator
 
Posts: 97
Joined: Thu Jan 10, 2008 6:43 pm
Location: USA

Re: Demo15 / Floppy Disk / DMA problem

Postby Insightsoft » Tue Jul 26, 2011 12:13 am

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
_____________
Think it, build it, bit by bit...
Insightsoft
 
Posts: 63
Joined: Wed Jul 22, 2009 6:44 am


Return to Beginning OS Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron