Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Neil DOT Jarvis AT proteon DOT com, djgpp AT delorie DOT com, hotpulp AT netidea DOT com Date: Tue, 14 Jan 1997 14:36:31 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: DMA buffer in protected mode Hi Neil you wrote: > Hi Shawn and SET, > > >> In protected mode, to make a DMA buffer, one must allocate memory under > >> 1M, correct? > > > >Yes. > > No. It depends for what device we are talking about. For example I > have program the DMA for an ISA device that can address any memory > up to 16M. Seems that I wasn't enough clear: The 8237 can address ONLY 64Kb, the pages are hence 64Kb long. To address 1Mb the PC uses some registers that adds 4 bits to the 16 in the 8237 so you CAN'T address more than 1Mb. You are talking about a 16 bits DMA channel where: 1) The 8237 address WORDs not bytes. 2) The registers to extend the 8237 adds the necesary bits to get 8Mb of WORDs and hence 16Mb. But the last is only for 16 bits DMA channels. > > The trick about using memory above 1M is getting the physical address > to program the DMA with. If you are interested I have a piece of code > that lets me malloc() the DMA buffer and then work out its the > physical address. You MUST use the DPMI services, because you never know where your program will be loaded so even if you are using a 16 bits DMA channel you can't suppose that part of your program will be loaded in the first 16Mb, so malloc doesn't work. Or, are you talking about a "malloc" that calls to the DPMI services? SET --------------- 0 -------------------------------- Salvador Eduardo Tropea (SET). Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013