| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
| From: | "Andrew Fairburn" <a DOT j DOT fairburn AT durham DOT ac DOT uk> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Allocating memory.... |
| Date: | Thu, 21 Feb 2002 14:59:06 -0000 |
| Organization: | University of Durham, Durham, UK |
| Lines: | 32 |
| Message-ID: | <a531ko$od$1@sirius.dur.ac.uk> |
| NNTP-Posting-Host: | secom189.dur.ac.uk |
| X-Trace: | sirius.dur.ac.uk 1014303192 781 129.234.207.189 (21 Feb 2002 14:53:12 GMT) |
| X-Complaints-To: | usenet AT durham DOT ac DOT uk |
| NNTP-Posting-Date: | Thu, 21 Feb 2002 14:53:12 +0000 (UTC) |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400 |
| X-Priority: | 3 |
| X-Newsreader: | Microsoft Outlook Express 5.50.4133.2400 |
| X-MSMail-Priority: | Normal |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
ive been trying to allocate a piece of memory so that both teh host itself
and a pci device reading straight from memory can acces it. Obviously its
not to hard to do this from the host point of view, but i need the real
address of the memory segment and offsets, not virtual, to access it via teh
pci device. At first i was attempting to use the
__dpmi_allocate_linear_memory() function to get the real addres, then used
a descriptor to get the virtual address for teh host acces.
i.e.
smi.size = 0xfff; // allocates size of host memory
if ((__dpmi_allocate_linear_memory(&smi, 1)) == -1) {
printf("out");
exit(32);
}
sysaddr = smi.address; // sets sysaddr to the start of smi memory
sys_sel = __dpmi_allocate_ldt_descriptors (2); //allocates sys_sel as a
descriptor
__dpmi_set_segment_base_address (sys_sel, smi.address); // sets the base
address of the host memory segment
__dpmi_set_segment_limit (sys_sel, smi.size - 1); // sets the size of
the host memory segment
Unfortunately i found out this call isnt supported by the windows or cws
dpmi library......
Is there any other way of doing this and/or a way of making this call work??
Thanks for any help,
Andy.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |