map bss to addr zero

Greg Freemyer greg.freemyer at gmail.com
Sun Aug 26 18:41:29 EDT 2012


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

As a guess,

Linux kernel developers leverage the fact that low address values are illegal, thus a pointer handling error that generates a low address value triggers a trap which allows the programmer to know he screwed up.

Using virtual memory segment zero makes those valid addresses and thus programming errors are more likely to slip through un-noticed.

HTH
Greg
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.



More information about the Kernelnewbies mailing list