X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Roland Zitzke" Newsgroups: comp.os.msdos.djgpp Subject: Re: Obtaining the physical address of a pointer using PMODE Date: Wed, 16 Nov 2005 19:45:18 +0100 Organization: Tiscali Germany Usenet Lines: 43 Message-ID: References: <71078E41DDE3E541B024832F34BC3D0DA3081D AT cowexc03 DOT corp DOT mxtr DOT net> NNTP-Posting-Host: p83.129.38.186.tisdip.tiscali.de X-Trace: ulysses.news.tiscali.de 1132166719 95556 83.129.38.186 (16 Nov 2005 18:45:19 GMT) X-Complaints-To: abuse AT tiscali DOT de NNTP-Posting-Date: Wed, 16 Nov 2005 18:45:19 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello and thanks for the links. as far as I can tell people were discussing to allocate mory in a fassion suitable for different extenders. However if I use pmode/dj, isn't there a way to malloc a chunk of memory and somehow detect the physical address of this chunk? DOS with himem.sys installed and WITHOUT EMM386 is the only environment I am really interested in. > > Charles Sandmann gave us some example code, and put it at > ftp://clio.rice.edu/djgpp/cwsdma.zip. He was talking about cleaning > it up and making it more publicized; I don't know if that ever happened. > I had a look at this code and I'm not sure I understand it completely. In the test routine there's: ... dmabuf = AllocateDMABuffer(8*1024*1024); if(dmabuf) printf("Allocated 8M DMA buffer at DJGPP address 0x%x, physical 0x%x\n", dmabuf,Physical_Address(dmabuf)); ... and it appears to me if that's really all that is needed to allocate a chunk of memory and obtain the physical address for DMA. However, the code goes on: i = physical_map(0, __djgpp_selector_limit, MAXSIZE, virtual, physical, size); if(i == 2) return printf("CWSDPMI PD in UMB not supported, sorry\n"); if(i) ... and I have no idea what that is good for i.e. what I need the physical_map function for. Any hints? Thanks in advance and regards Roland