Virtual memory question

Mulyadi Santosa mulyadi.santosa at gmail.com
Mon May 23 01:26:45 EDT 2011


Hi Naman....

On Mon, May 23, 2011 at 12:12, Naman shekhar Mishra
<namanshekharmishra2 at yahoo.in> 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



More information about the Kernelnewbies mailing list