From: Frederico Jeronimo Newsgroups: comp.os.msdos.djgpp Subject: Map physical memory(again) Date: Fri, 10 Dec 1999 17:13:23 +0000 Organization: Universidade Tecnica de Lisboa Lines: 77 Message-ID: References: NNTP-Posting-Host: camoes.rnl.ist.utl.pt Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: utl2.reitoria.utl.pt 944846271 552 193.136.164.11 (10 Dec 1999 17:17:51 GMT) X-Complaints-To: usenet AT utl2 DOT reitoria DOT utl DOT pt NNTP-Posting-Date: 10 Dec 1999 17:17:51 GMT X-Sender: fjds AT camoes In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk I'm sorry for posting this message again, but I was told my university server was having a few problems lately... Better safe than sorry. Frederico Jeronimo On Fri, 10 Dec 1999, Frederico Jeronimo wrote: > Hi all, > > I'm having a little problem and I was wondering if you could help > me out. I'm > trying to map a range of physical memory over a set of addresses using > '__djgpp_map_physical_memory()'. For this I need a page-aligned linear > buffer, I think. However, when I call '__dpmi_allocate_linear_memory()' > the function returns -1. I tried other DPMI functions present in Djgpp > and found out that all DPMI 0.9 functions work whereas most DPMI 1.0 > functions don't and I really can't figure out why... I'm running Djggp > v.201 in a windows DOS prompt and I have CWSDPMI.exe in the 'djgpp/bin' dir > (although the result is the same if I run the program in "pure" dos). I > searched the info docs, the net, the faq and nothing seemed to help. > > Here's a testing code fragment. Perhaps I'm doing something wrong... > > #include > #include > #include > #include > #include > #include > #include > #include > > int main() > { > __dpmi_meminfo r; > __dpmi_memory_info p; > short my_sel = 0; > unsigned long addr = 0; > extern unsigned short __dpmi_error; > > [...] > > /* test values */ > r.address=0x00; > r.size=16; > > /* If I use uncommited pages, the result is the same. > Error code in my system is 1291(0x50b) (what does it > mean?) */ > if(__dpmi_allocate_linear_memory(&r,1) == -1) > { > printf("\nError code is %ld",__dpmi_error); > abort(); > } > > /* If I replace the previous function with this one the result is > the same. Error code changes to 1284 (0x504). Again, > no clue to its meaning...*/ > //__dpmi_get_memory_information(&p); > > /* The next two functions work just fine, after I create a selector > of course... */ > // __dpmi_get_coprocessor_status(); > //__dpmi_get_segment_base_address(my_sel,&addr); > > [...] > } > > Please go easy on me. I'm new to DPMI programming. Thanks > in advance for all the help, > > Frederico Jeronimo > > Ps: How can I check what DPMI host I'm using? > >