map bss to addr zero

Ritesh Harjani ritesh.harjani at gmail.com
Sat Sep 1 15:23:17 EDT 2012


On Mon, Aug 27, 2012 at 2:01 AM, Srinivas Ramanan <
srinivas.ramanan at gmail.com> wrote:

> Hi all,
> This is an interview question.
> "What is the implication of mapping BSS to the Virtual Memory Segment 0?"
>
>  I was not able to find the answer from web. So posting here.
> thanks,
> srinivas
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


Hi,

The bss section typically includes all uninitialized variables declared
with the static keyword.
The zero page which  is a copy-on-write page that reads as zero is used to
map the BSS segment. Any process referencing the zero page sees the page
filled with zeos and if it tries to writes to the page, it ends up
modifying a private copy. (LDD ch15. page 429)

Mulyadi,

Why it will generate a page fault later when process will tries to
reference it, while it already has mapped with the zero page?


Sorry if i am wrong anywhere.
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120902/b18f7568/attachment.html 


More information about the Kernelnewbies mailing list