From: Antoine Pitrou Newsgroups: comp.os.msdos.djgpp Subject: paging memory problem ? Date: Sat, 21 Nov 1998 22:41:51 +0000 Organization: Magic On Line Lines: 32 Message-ID: <365741AF.C64484F4@mail.dotcom.fr> NNTP-Posting-Host: sofia.magic.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en X-Client: Magic On Line [unknown AT ppp10-105 DOT magic DOT fr] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi here is a problem I don't know how to solve with djgpp. I've got some memory areas (which are 4096-aligned) that I would like to switch together. In order to make that quickly I thought of using the paging facilities of the 386 in order to map these memory areas over another slice of memory, so I can just change of few physical addresses to swap some blocks. For example, I've got a 16384-byte array named _ram (4096-aligned), and I want to map the 4 pages contained in that array to another address named _mapped_ram, so that _mapped_ram contains in order page 2, 3, 1 and 0 of _ram. I've tried with __dpmi_physical_mapping and __djgpp_map_physical_memory, but both failed. The problem is that I don't have a good knowledge of protected mode and dpmi (and the dpmi doc on dj delorie's www isn't very easy to understand), and I'm not sure where the problem comes from : - CWSDPMI maybe doesn't allow it (I've tried under plain dos) ; I've tried with CSWDPR0 once and it didn't work either - I don't give the right physical address of the area to map (_ram in the example above) ; I've tried to add __djgpp_base_address (which strangely equals to 0x10000000, are the addresses below used by CWSDPMI for virtual memory ? that would explain the 256 MB limit) as well as to use the address by itself - I don't give a valid mapping address (_mapped_ram in the example above) ; I've tried numbers under 0x10000000 as well as very high numbers (0x80000000) - another problem I don't know of ? Please, could someone help me ? please reply by e-mail Thanks Antoine Pitrou.