On Tuesday 10 April 2007 10:43:50 Sandeep Sanjay Patil wrote: > 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. I.e., kernel pages are swapable (since when the kernel needs the data in the page it needs to swap out the user pages)? I.e. When the user mode application works it will see certain kinds of page, but when the kernel will work on behalf of the application those pages will be swapped and replaced by kernel pages (unless it will use copy_from_user). 10x. -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ