On Mon, 2007-04-09 at 23:19 +0300, Tzahi Fadida wrote: > Yes it did help. 10x. > Still, if i have only 800MB RAM or 512MB RAM, how does the allocation between > kernel protected memory and user mode allocation goes? 256MB for kernel and > the rest for user? Or mixed? In that (mixed) case how will the processor know > this area is protected for kernel mode? > No, your assumption is wrong, if we consider 512MB of RAM present, then kernel will map the whole of ram in addresses 0xc0000000 onwards, i.e.(3GB {virt} onwards..). Now these mappings will remain there, and will be included in every process's page tables for 3gb-4gb virtual memory. This allows, kernel to access the whole of RAM and the page table entries for addresses beyond 3GB, will only be accessibly to kernel code (on i386 previledge level = 0). So, whenever a process is created, or memory is to be allocated to a user process, kernel picks up a chunk of RAM and maps that using process's page tables with Previledge level 3(user mode) so that it becomes accessible to user mode. So at this time, there can be 2 mappings for the same page(if only one page is requested from hte user space) one will be the previledged one for kernel, and the other will be for user space. cheers, sandeep -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ