| delorie.com/archives/browse.cgi | search |
| From: | "Denis Bélanger" <dbelang AT mediom DOT qc DOT ca> |
| Subject: | Problems with dpmi address mapping under dos and win 3.1 |
| Newsgroups: | comp.os.msdos.djgpp |
| Message-ID: | <01be0886$5ae74b60$458860cf@dbelang> |
| X-Newsreader: | Microsoft Internet News 4.70.1155 |
| Lines: | 42 |
| Date: | Thu, 05 Nov 1998 06:24:50 GMT |
| NNTP-Posting-Host: | 207.96.136.69 |
| X-Complaints-To: | abuse AT videotron DOT net |
| X-Trace: | wagner.videotron.net 910247090 207.96.136.69 (Thu, 05 Nov 1998 01:24:50 EDT) |
| NNTP-Posting-Date: | Thu, 05 Nov 1998 01:24:50 EDT |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
From: dbelang AT mediom DOT qc DOT ca
I need a selector for access a pci card. Under windows 95 ms-dos box a my
program works fine and I can access the card. But when I try the same
program in an ms-dox bos under windows 3.1 or under dos with cwsdpmi the
program always halt at the same place. The call to
__dpmi_physical_address_mapping fail and my program exit. Can somebody help
me, thanks.
here is the piece of code I talk :
int allocate_linear_from_physical(dword physical_addr, dword region_size,
int* selector, dword* linear_addr)
{
long last_addressable_byte = region_size - 1;
union REGS r;
__dpmi_meminfo info;
r.w.ax = 0x1686;
int386(0x2f, &r, &r);
// Vérifie si l'hôte peut rouler DPMI
if ((r.w.ax != 0x0000))
{
printf("Error-> Not in protected mode. Exiting ... \n");
exit(0);
}
info.address = physical_addr;
info.size = 0x20; //region_size;
if (__dpmi_physical_address_mapping(&info) == DPMI_ERROR)
{
printf("Error-> Mapping Pass-Thru Physical Address. Exiting ...\n");
exit(0);
}
*linear_addr = info.address;
*selector = __dpmi_allocate_ldt_descriptors(1);
.etc etc etc
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |