X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f NNTP-Posting-Date: Wed, 07 Aug 2013 20:47:21 -0500 From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp References: <09068ed9-d989-4db5-bc71-2eabcbf1db53 AT googlegroups DOT com> <44qdnVq6LIkpiGrMnZ2dnUVZ_tidnZ2d AT earthlink DOT com> <3f7ac344-a8b1-4300-b7cd-5aacd97293f2 AT googlegroups DOT com> Subject: Re: Beta Test: CWSDPMI r7 - 4GB support Date: Wed, 7 Aug 2013 20:47:16 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Message-ID: Lines: 59 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 64.91.136.221 X-Trace: sv3-7N2Jeeq4OFafXOgx7UkdHwe664NmCtTYQ3Zz+0Jvz6fqHA6tOh/pZdSt0pwx3FzOncQ+OdsDJ7uWBqz!TouOSsg1hd8kQfTryEd7jKjKEzX2ymeRlQib7j3w+sMdCt+45ogd3DVKA89v1lf7itoHKhIns+L2!mTlZMFaMf/mVOnC98Vwzy0v5K6wiVZF6 X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 4063 X-Original-Bytes: 4002 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > wrote in message >news:3f7ac344-a8b1-4300-b7cd-5aacd97293f2 AT googlegroups DOT com... >> Let's suppose your computer has 4GB physical memory. Typically between >> 2.5GB and 3.5GB of that memory is actually below the 4GB address point. >> The >> remaining typically starts at the 4GB address point. On this computer >> you >> could just sbrk() up to 4092K, >> then touch the memory in order (first byte in each 4MB aligned page). > > I think what you want to express is: the remaining memory will be > "re-mapped" to above 4GB address via sbrk(). Am I correct ? No - DJGPP only works with 32-bit addresses. As far as it is concerned, there is nothing beyond 4GB. PC hardware on the other hand typically stops with memory at 3GB. CWSDPMI works with memory mapping via page tables, so can collect memory from wherever it exists to make a virtual contiguous 4GB address space (even if there are memory holes in the physical memory). Even though memory is allocated it is not committed into memory until it is accessed (which makes lots of sense in a tight memory system with paging to disk, but provides weird physical mapping if unaware of this behavior - pages may appear to not exist until they are touched). The trick for knowing about memory over 4GB is looking at the page tables (an Intel hardware feature). So DJGPP may say that memory lives at the 3GB mark, but in reality the physical address is at 4GB. >> If you then look at the physical map, you will very likely >> have at least a 500MB buffer you can configure that actually is above the >> 4GB address. > > Here "at least a 500MB buffer you can configure" means: application(or > program) can access this buffer using "indirect" way, am I correct ? > (where indirect way means you have to invoke api(or system call) to get > pointer first, then access it...) There are many ways to set up the mapping. Unless you have very specific size needs the easiest way is to allocate memory with sbrk() and look for the memory chunk above 4GB and use it. More specific needs means more programming. In any case you just use an ordinary pointer to access it under DJGPP. > If above is correct, then can I get the "physical memory address" of that > buffer ? As referred to in the previous post, a modified copy of http://homer.rice.edu/~sandmann/djgpp/cwsdma2.zip would give you the physical memory mapping. > (the reason I ask is: H/W DMA transfer requires only the physical memory > address !) Which is why the code above has the letters DMA in the title.