Ashish
Ashish

Reputation: 569

Page tables in Linux

Question 1 :- During the booting process, Linux creates the page tables. However, when a new process is executed, it also has its own page table. How are these two tables different?

Question 2 :- On x86 arch, Linux uses a well defined scheme (which includes Page directory, page table entries and likewise) to translate the linear address to physical address. Suppose we have a linear address X in the process address space A which when translated using the page tables corresponds to physical address Y. There is some other process B which also has valid linear address X belonging to its own address space. Now if process B wants to access X, would X once again corresponds to the same physical address Y?

Upvotes: 1

Views: 3223

Answers (2)

Dan
Dan

Reputation: 167

Question 1: Their permissions are different.

Question 2: No.

You might want to check this out too, if you're really curious and not just looking for easy answers for your homework: http://duartes.org/gustavo/blog/post/how-the-kernel-manages-your-memory

Upvotes: 1

Karmastan
Karmastan

Reputation: 5696

Question 1: Page tables aren't created only at boot. A new page table is created every time a processes is forked. The new tables follow a template set up by the kernel at boot, but each is an independent data structure that can change per-process. They generally differ to allow each process to have its own working memory that only it can access.

Question 2: No, and this behavior is one of the reasons paging is used in the first place.

Upvotes: 3

Related Questions