Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!RICHTER.MIT.EDU!krowitz From: krowitz@RICHTER.MIT.EDU (David Krowitz) Newsgroups: comp.sys.apollo Subject: Re: Writing a Device Driver for AEGIS Message-ID: <8811141624.AA01255@richter.mit.edu> Date: 14 Nov 88 16:24:09 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 41 Some notes from my own struggles with DMA on the DN3000 ... 1) the buffer does not necessarily have to be page alligned. The actual working requirement is that the interrupt routine (and the actuall DMA operation), must not cause a page fault. As long as the DMA does not cross a page boundry and the page is wired into physical memory, you are OK. You can perform DMA to an arbitrary buffer by simply breaking up the operation into chunks which each fit within a single page. 2) Some of the routines which wire pages in memory may be the cause of the page allignment requirement. You can allign a buffer by putting it in a seperate data section (in Pascal, you would use the extension to the VAR statement to specify a new section) and then using the -ALIGN PAGE option with the binder. You can also simply allocate a buffer which is 1024 bytes larger than what you really need, and then calculate where the first page break would be (ie. if PTR points to you buffer, then (again in Pascal) the page aligned buffer can be found with NEW_PTR := NEW_POINTER_TYPE(((INTEGER32(PTR) DIV 1024)+1)*1024), which gives you the first page break after the start of the buffer -- note that all of the arithmetic is 32-bit integer operations) 3) At least some of the earlier DN3000's have a problem with their DMA hardware. Running two DMA devices at the same time will cause them to interfere with each other's I/O. This is why the hard disk and the cartridge tape drives don't use DMA on the DN3000. The floppy disk does use DMA, and I can not write floppies while my printer interface is sending data to the printer. Later model DN3000's are supposed to have this fixed. 4) You might be able to use the pub_$wire_buffer_special call to get your buffer wired into physical memory with physcially consecutive pages. This would allow you to do DMA to the entire buffer without having to worry about crossing a page boundry. I haven't tested this yet, though. -- David Krowitz krowitz@richter.mit.edu (18.83.0.109) krowitz%richter@eddie.mit.edu krowitz%richter@athena.mit.edu krowitz%richter.mit.edu@mitvma.bitnet (in order of decreasing preference)