From: russell DOT thamm AT dsto DOT defence DOT gov DOT au Newsgroups: comp.os.msdos.djgpp Subject: Accessing Reflective Memory using Pointers Date: Tue, 12 Jan 1999 03:33:53 GMT Organization: Deja News - The Leader in Internet Discussion Lines: 49 Message-ID: <77efr1$ti8$1@nnrp1.dejanews.com> NNTP-Posting-Host: 203.5.217.4 X-Article-Creation-Date: Tue Jan 12 03:33:53 1999 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95) X-Http-Proxy: 1.0 x12.dejanews.com:80 (Squid/1.1.22) for client 203.5.217.4 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am trying to use reflective memory from DJGPP. I have no problems accessing the reflective using _farpeek/_farpoke. However, the main attraction of using reflective memory is that it appears to be normal memory. Reflective memory access should be transparent to the program. Therefore, I wish to access this memory using pointers eg rfm->field1. The FAQ says that this can't be done (under DJGPP 2) but offers no explanation as to why. I am running under CWSDPMI with virtual memory disabled. It occurred to me that I should be able to create a pointer that points to the start of the reflective memory by finding the base address of the segment whose selector is in the DS register and subtracting it from the physical address of the Reflective Memory. However, when I examine the entry in the LDT, I noticed two problems: Firstly, the base address is 0x1000000 which is incomprehensible to me. I am assuming that a linear address is the same as the physical address because virtual memory is disabled. Secondly, the limit for this segment is too small. This limit appears to increase as memory is allocated but does not appear to decrease as memory is freed. Can I modify the limit to include the entire address space? Following is a printout of the LDT: 80 Code-cRA DPL 3 00017EB0:0FFFF Flg 0 88 Data-eWA DPL 3 00017EB0:0FFFF Flg 4 90 Data-eWA DPL 3 00017DB0:0FFFF Flg 0 98 Data-eWA DPL 3 00017B70:0FFFF Flg 0 A0 Code-cRA DPL 3 10000000:5FFFF Flg 4 CS A8 Data-eWA DPL 3 10000000:5FFFF Flg 4 DS,SS,ES B0 Data-eWA DPL 3 10000000:5FFFF Flg 4 B8 Data-eWA DPL 3 00000000:FFFFF Flg C GS C0 Data-eWA DPL 3 00020DC0:007FF Flg 4 C8 Data-eWA DPL 3 000219C0:00087 Flg 4 D0 Data-eWA DPL 3 000215C0:003FF Flg 4 FS I'd be grateful for any assistance, Russell Thamm -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own