Skip to contentSkip to conversation

Virtual memory question

DISCUSSION Naman shekhar Mishra 2 participants 2 messages May 23, 2011

lore
Share & tools
lore
#0 lore raw

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)? And, what happens when a process makes a system call - does the kernel work on behalf of the process, 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? -------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110523/4c3a634c/attachment.html

#1 lore raw

Hi Naman....

Quoted 3 lines · Naman shekhar Mishra

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.

Quoted 2 lines

And, what happens when a process makes a >system call - does the kernel work on behalf of the process,

Yes

Quoted 3 lines

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.

Signature · 7 lines
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com