Mail Archives: djgpp/1999/12/11/01:32:10
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 -