From: Kasper V. L. <ve...@da...> - 2000-02-29 16:51:50
|
In this mail I'll try to explain a way of implementing 'small address spaces', which rely on segmentation for protection rather than paging. The motivation for such address spaces is that switching between these doesn't require context switches. 1. Memory Layout 0x00000000 - 0x0fffffff : Physical memory and kernel 0x10000000 - 0x3fffffff : Small address space region 0x40000000 - 0xffbfffff : Application virtual memory 0xffc00000 - 0xffffffff : Page directory and page tables mapping 2. Small Address Space Region The small address space region consists of 192 small address spaces - each 4Mb in size. A process can allocate a slot, and map 4Mb (one page directory entry) of it's virtual memory into the small address space slot. All small address spaces (SASes) are shared among all address spaces in the system, and segmentation is employed to ensure proper protection: * code and data segment of applications have a base of 0x40000000. * each SAS has a separate code and data segment restricting access to the SAS itself. 3. Protected Control Transfer When registering the PCT entry a process can request that PCT go to a specified SAS. This applies to uncommanded PCT (like IRQ handling) as well. As a consequence handling the firing of an IRQ is reduced to (that is if the handler is in a SAS): 1) trap to the kernel 2) upcall to the SAS 3) handle IRQ 4) yield to the kernel 5) return to interrupted process The gain is that we avoid two context switches. 4. Scheduling It should be possible to schedule SASes. When allocating a CPU quantum a process can specify that the prologue/epilogue upcalls should go to a specified SAS - instead of a full application address space. 5. Considerations * is 192 SASes enough, and is 4Mb a reasonable limit? * can a process have multiple SASes? What do you think? It should make quite a difference performance wise, without sacrificing protection and modularity. /Kasper ------------------------------------------------------------------- Kasper Verdich Lund, Computer Science Department, Aarhus University Office: 34P.218 | Phone: (+45) 8942 5680 Email: ve...@da... | WWW: http://www.daimi.au.dk/~verdich |