Memory segmentation: Difference between revisions

Content deleted Content added
No edit summary
Give more details on segmentation, which lets us get rid of segmented memory and just redirect it here; the rest of the stuff in segmented memory is a bit dubious
Line 1:
{{Merge|Segmented memory|date=July 2007}}
{{Unreferenced|date=July 2007}}
'''Segmentation''' is one of the most common ways to achieve [[memory protection]]; another common one is [[paging]]. SegmentationIn meansa computer system using segmentation, an instruction operand that refers to a partmemory or___location partsincludes a value that identifies a segment and an offset within that segment. A segment has a set of thepermissions, memoryand willa belength, sealedassociated offwith fromit. If the currently running [[Process (computing)|process]], throughis theallowed useby ofthe [[hardwarepermissions register]]s.to Ifmake the datatype of reference to memory that it is aboutattempting to bemake, readand orthe writtenoffset towithin the segment is outsidewithin the permittedrange [[addressspecified space]]by the length of thatthe processsegment, the reference is permitted; otherwise, a hardware [[segmentationException faulthandling|exception]] willis resultdelivered.
 
In addition to the set of permissions and length, a segment also has associated with it information indicating where the segment is located in memory. It may also have a flag indicating whether the segment is present in main memory or not; if the segment is not present in main memory, an exception is delivered, and the [[operating system]] will read the segment into memory from secondary storage. The information indicating where the segment is located in memory might be the address of the first ___location in the segment, or might be the address of a [[page table]] for the segment. In the first case, if a reference to a ___location within a segment is made, the offset within the segment will be added to address of the first ___location in the segment to give the address in memory of the referred-to item; in the second case, the offset of the segment is translated to a memory address using the page table.
This usage should not be confused with that of the [[memory segment]]s used by early [[x86]] processor architectures.
 
In most systems in which a segment doesn't have a page table associated with it, the address of the first ___location in the segment is an address in main memory; in those systems, no [[paging]] is done. In the [[Intel 80386]] and later, that address can either be an address in main memory, if paging is not enabled, or an address in a paged "linear" address space, if paging is enabled.
For details of [[x86]]'s implementation of segmentation in both 16-bit and 32-bit mode, please see the article on [[memory segment]]s.
 
Segmentation is aA [[memory- management schemeunit]] that(MMU) supportsis thisresponsible userfor viewtranslating ofa memory.segment Aand logicaloffset addresswithin spacethat issegment actuallyinto a collectionmemory of segments. Each segment has a nameaddress, and afor length.performing Thechecks addressto specifiesmake bothsure the segmenttranslation namecan andbe thedone offsetand withinthat the segment.reference Theto user therefore specifies each address by 2 [[parameter]]s: athat segment name and an offset. is permitted.
 
This usage should not be confused with that of the [[memory segment]]s used by early [[x86]] processors such as the [[Intel 8086]] and [[Intel 8088]], as they did not provide any protection; segmentation in the [[Intel 80286]] and later provided protection.
 
For details of [[x86]]'s implementation of segmentation in both 16-bit and 32-bit mode, please see the article on [[memory segment]]s.
 
== See also ==
* [[Memory protection]]
* [[Memory segment]]
* [[Virtual memory]]
* [[Text segment]]