From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Mon, 23 May 2011 12:26:45 +0700 Subject: Virtual memory question In-Reply-To: <274972.95837.qm@web137601.mail.in.yahoo.com> References: <274972.95837.qm@web137601.mail.in.yahoo.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Naman.... On Mon, May 23, 2011 at 12:12, Naman shekhar Mishra wrote: > Is the last gigabyte in the virtual address space of each process mapped to > the same memory location (which starts from the 2nd megabyte of physical > RAM)? I assume you're talking about 32 bits x86 system, with 3:1 vm split. Well then, you're right. That last 1 GiB address space maps to same place, that is kernel space. >And, what happens when a process makes a >system call - does the kernel > work on behalf of the process, Yes > i.e. use the process page tables, or uses its > own page tables for virtual addressing. If the >former is true, when are the > kernel page tables used? when it says "on behalf", it means that it acts inside that process' address space. However, the privilege is certainly lifted (CPL=0), segmentation used now is a bit different, and so on and so on. And since now it is likely calls codes in kernel space and accessing kernel variables, for sure kernel page tables are needed to locate and reference them. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com