On 14 April 2012 07:17, Stas Sergeev <s...@list.ru> wrote: > I've just had a look into a possibility of using > LOWMEM() for the mappers, eliminating the > special meaning of MAPPING_LOWMEM and > MAPPING_HMA, which are adding lowmem_base > to the source. The mappers can use LOWMEM() > explicitly, instead of using the magic flags, because > the EMM can map from both the lowmem_base shm > and the malloc()'ed areas, so it needs to set the > source addr explicitly. > But it turned out that the mapping code is > over-complicated to do even that simple change.
I wonder if the best way to solve the issue with using conventional memory to map EMS memory is to have the mapping code set up and maintain some kind of page table: (conv+hma)/4k=(1024+64)/4=272 entries with pointers. That way, dosaddr_to_unixaddr just needs a quick table lookup like this: void* dosaddr_to_unixaddr(unsigned dosaddr) { /* use proper #define's in the real code ;) */ if (dosaddr < (1024+64)*1024) return alias_table[dosaddr/4096] + (dosaddr & 4095); else /*DPMI memory, no alias */ return &mem_base[dosaddr]; } Bart ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Dosemu-devel mailing list Dosemu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dosemu-devel