Sender: nate AT cartsys DOT com Message-ID: <35871BF5.D67C1447@cartsys.com> Date: Tue, 16 Jun 1998 18:29:25 -0700 From: Nate Eldredge MIME-Version: 1.0 To: vicking AT etud DOT insa-tlse DOT fr CC: djgpp AT delorie DOT com Subject: Re: Memory under djgpp References: <199806151250 DOT OAA23029 AT jaures DOT etud DOT insa-tlse DOT fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk vicking AT etud DOT insa-tlse DOT fr wrote: > > I'm a beginner with djgpp and i want information about memory management > under djgpp. > > What is exactly linear Memory ??? > (I use it to access to lfb with univbe ) > > Is djgpp pointers refer to linear memory ??? Ok, crash course. DJGPP pointers refer to virtual memory. Here is an approximate explanation of how memory management on the 386 works. Program dereferences virtual pointer V Segment checking/translation done. Virtual memory is relative to a segment, which has a base address and a limit. (For DJGPP, it's normally the DS segment.) If the pointer value is greater than the limit, a fault occurs. Otherwise, the base address is added to the pointer. The address space to which the new pointer refers is called "linear memory". V Paging mechanisms. The linear address space is divided into "pages", each of which is 4K in size. The page on which the linear address resides is looked up in a table maintained by the DPMI server, called (appropriately) the page table. The page table tells whether or not the page is in physical memory, and if so, where. If the page isn't present, a fault occurs so the DPMI server can load the page from the swap space. Otherwise, the base address of the page is added to the offset of the pointer into that page, and the memory access is done at that location in physical memory. I believe the case of a "linear frame buffer" may be different from this. I don't do much graphics hacking, so I'm not sure. > Where can i get more info about this ??? Hmm... I learned from Intel's "386 Programmer's Reference Manual". That, however, is hard to find. Maybe someone can follow up with a good tutorial/reference. -- Nate Eldredge nate AT cartsys DOT com