Thread (5 messages) flat view 5 messages, 4 authors, 2012-09-02

map bss to addr zero

From: Greg Freemyer <hidden>
Date: 2012-08-26 22:41:29

Srinivas Ramanan [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help