Unix Programming - More than one Code segment???

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2007 > More than one Code segment???





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author More than one Code segment???
J de Boyne Pollard

2007-10-25, 1:24 pm

BV> Ok.... I though that *nix called these segments (hence
BV> "segmentation fault") and Windows called them pages
BV> and they were the same except that pages are fixed
BV> size and segments can be any size. Are they at all similar?

The difference does not stem from operating systems. It stems from
processors. Some processors have paging. Some processors have
segmentation. Some, like those with the Intel x86 architecture, have
both. The reason that paging errors are "segmentation faults" on Unix
is an accident of Unix history. Early Unices ran on processors that
only had segmentation, not paging. (The very earliest Unices ran on
processors that had neither.) The nomenclature is preserved, even
though the actual hardware events that cause the signal to be raised
are not the same on (say) x86 processors as they are on PDP-11/45s.
Moreover: Some operating systems, most notably the *BSDs, map various
page faults onto the "bus error" signal rather than onto the
"segmentation fault" signal.

For the differences between paging and segmentation, get yourself a
good introductory-level textbook on computer architectures. Or attend
a course on the subject such as (picking at random from Google Web
results) these ones: <URL:http://faculty.juniata.edu./rhodes/os/
syllabus.htm#Lectures> <URL:http://www.cs.tau.ac.il./~amir1/COURSE/
2003/PPT/index.html> <URL:http://pages.cs.wisc.edu./~willb/537/other-
notes/> <URL:http://www.it.uu.se./edu/course/homepage/oskomp/vt07/
lectures>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com