User talk:Erarchit007

Segmentation
Users prefer to view memory as a collection of various size segments.Whenever you write a program,each of module is referred by a name.User isnot concerned about the addresses of the memory these elements occupy.Each of these segments is of variable length,the lenght is intrincially defined by the purpose of segment of program.Hence it can be concluded that SEGMENTATION is a memory management scheme that supports their user view of memory.A logical address space is a collection of segments.The addresses specify both segment name and offset within segment.For simplicity of implementation,each segment is numbered and referred by a segment number rather than a segment name. Logical address thus consist of two tuple:



Whenever the program is compiled,the compiler automatically constructs segments reflecting input program.Loader would take all these segments and assign them segment numbers.

Hardware implementation
Although the user can refer to objectsin program by a two dimensional address,physical memory is still a one dimensional sequence of bytes.Thus,an implementation is designed to map two dimensional user defined address to one dimensional physical address.The mapping is affected by segment table.Each entry of table has a segment base and segment limit.Segment base contain starting physical address where segment resides in memory and segment limit define size of segment.If the offset of user defined address is not between 0 to segment limit then we trap the operating system.If offset is legal,it is added to segment base to produce the address in physical memory of desired byte.