www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/10/18:24:23

From: Frederico Jeronimo <fjds AT rnl DOT ist DOT utl DOT pt>
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: <Pine.GSO.4.10.9912101710290.24634-100000@camoes>
References: <Pine DOT GSO DOT 4 DOT 10 DOT 9912101602570 DOT 5274-100000 AT camoes>
NNTP-Posting-Host: camoes.rnl.ist.utl.pt
Mime-Version: 1.0
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: <Pine.GSO.4.10.9912101602570.5274-100000@camoes>
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

	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 <stdio.h>
> #include <dos.h>
> #include <go32.h>
> #include <dpmi.h>
> #include <sys/farptr.h>
> #include <sys/movedata.h>
> #include <sys/nearptr.h>
> #include <crt0.h>
> 
> 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?
> 
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019