Organization: University of Mining and Metallurgy Address: Mickiewicza 30, 30-059 Krakow, POLAND Date: Thu, 27 Apr 95 13:05:44 +0200 From: s709 AT icslab DOT agh DOT edu DOT pl (chojnacki) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: more on extended memory >>> How can I access the particular addresses of extended memory (above 1MB) ? >>> I know the first 1MB is mapped to 0xE0000000 in the program's address space >>> but how is it with above 1MB memory ? >>> I need to access the memory of DT2862 frame grabber which grabs images >>> into extended memory from address 0xA00000. >>> How compiler handles that memory ? >>> Please help ! >>The entire 256M of memory is mapped to 0xe0000000 (unless you don't have >>that much... :->). If you want to access 0xa00000, just use 0xe0a00000. >>BTW, that will not work under DPMI, unless you do some assembly coding to >>map the memory yourself. >I think only 16M of memory gets mapped to go32_conventional_memory_selector() >(sp?) [which returns 0xe0000000 if you aren't in DPMI, but a value which may >change from session to session otherwise]. No hand coding should be necessary. Thanks to all who responded to my please. I'd like to ask some more questions about it. In my opinion _go32_conventional_mem_selector() returns selector which pointers to an item in the descriptor table which includes base addresses of segments. For example I tried this: #include #include main() { u_short i = _go32_conventional_mem_selector(); printf("i = 0x%x\n", (int)i); } and I got: i = 0x38 I think this is an index in the descriptor table which includes among other things base addresses of the segments and their length. Next I wanted to view contents of item in the descriptor table and ran this: #include #include main() { u_short i = _go32_conventional_mem_selector(); printf("value = %x\n", *((int *)(int)i )); } and I got: Segmentation violation in pointer 0x00000038 at d8:11ca ... I think this area of memory is protected but is there any way to access the descriptor table to see what is real segment's base address and its length ? I understand that to access first 16M memory in DPMI mode (and also in non-DPMI) I can use _go32_conventional_mem_selector() which gives me a selector which is used as pointer to an item in the desriptor table from which I get base address of my segment. But for example if I have 32M memory - can't I access second half of 16M in DPMI without hand coding (only 16M of memory gets mapped to _go32_conventional_mem_selector() ?). If my understanding is not correct at any point please let me know of it. Thanks, Tom Chojnacki (s709 AT icslab DOT agh DOT edu DOT pl)