You are on page 1of 3

SEGMENTED VIRTUAL MEMORY

MUHAMMAD EHSAN, ARIF-ULLAH-KHAN


Department of Computer Science
Govt. College University, Lahore, Pakistan
Ehsan0332@gmail.com, Khanarif9211@gmail.com

Abstract—this term paper gives an introduction to segmented Third, "demand paging" permits advantage to be taken of any
virtual memory. What is segmented virtual memory? When it area of reference irregular to a program by moving to core
was first implemented. What are the purposes for using only those pages of segments which are currently needed.
segmented virtual memory? How it works. The architecture of
x86 processor will be discussed.
Any additional overheads associated with demand paging
should of course be evaluated against the alternative
Keywords— Virtual memory, Segmented virtual memory, uselessness associated with dedicating core to entire segments
History, Hardware Implementation, x86 Architecture, Object
which must be swapped into core but which may be only
Files and Conclusion
partly referenced.
I. VIRTUAL MEMORY
Virtual memory is the memory which is allocated to a process Finally, demand paging allows the user a greater degree of
when the primary memory is full for a certain process. There machine freedom in that a large program designed to run well
are two types of virtual memories. in a large core memory configuration will continue to run at
• Paged Virtual Memory reduced performance on smaller configurations.
• Segmented Virtual Memory

III. SEGMENTED VIRTUAL MEMORY


II. PAGED VIRTUAL MEMORY
SEGMENTED VIRTUAL MEMORY is the memory
PAGED VIRTUAL MEMORY is the memory which which divides the primary memory into segments. These
divides the primary memory into pages. segments may be sections or Object files.
When in computer the size of each segment is smaller
compared to the core then we can do the swapping of whole
pages. Even in such a system, if all segments did not have the IV. OBJECT FILES
same maximum size, or had the same maximum size but were
allowed to grow from initially smaller sizes, there remains the Segments or sections are also defined in object files.
difficult core management problem of providing space for Segments in different object files may be combined by the
segments of different sizes. Virtual memory, although, linker according to rules specified when the segments are
provides for segments of sufficient maximum size so that only defined. Bonds exist for segments shared between object files,
some of the pages can be swapped. Also, these segments can for instance, in DOS there are different memory models that
grow from any initial size smaller than the maximum specify the names of special segments and whether or not they
permissible size. may be combined .
So segments are divided in equal sub parts called pages and
A. HISTORY OF SEGMENTED VIRTUAL MEMORY
providing for the travel of individual pages in and out of the
core as demand dictates, the disadvantages of fragmentation The first computer which implements
are incurred.. However, several practical problems segmentation is BURROUGHS CORPORATION
encountered in the implementation of a segmented virtual B5000. It is the commercial computer whose virtual
memory are solved.
memory is based on segmentation. The version of
First, since pages are all of equal size, space allocation of
simplicity. The problems of "compacting" information in core B5000 is still in used on Unisys Clear Path Libra
and on secondary storage, characteristic of systems dealing servers. In 1964 a computer is designed which
with variable-sized segments or pages, are thereby eliminated. supports Multics with segmentation in addition with
Second, since only the referenced page of a segment needs paging support is GE-645 which is the latest version
to be in the core at any one instant, segments does not need to of GE-635. In 1975 the computer with name Intel
be small compared to core memory.
iPAX 432 begins which truly implement the
segmentation with memory protection on a
microprocessor.
B. MULTICS

Multics simulates the flawless memory, using the


segmentation and paging features of the 645 assisted by the
appropriate software features. The result of the simulation is
referred to as the "Multics Virtual Memory." The user can
keep a large number of segments in this memory and
reference them by symbolic name; upon first reference to a
segment, the supervisor automatically converts the symbolic
name into the appropriate hardware address which is directly
used by the processor for succeeding references.

C. HARDWARE IMPLEMENTATION In a
segmented virtual memory the blocks to be replaced in main
Segmentation is a memory management system. A logical
memory are potentially of unequal length and correspond to
address space is a collection of segments. Each segment has a
program and data segments. A data segment might be a data
name and a length. The addresses specify both the segment
structure or an array. In both cases, segments correspond to
name and offset within the segment. Therefore, the user has to
logical blocks of code or data. Segments, then, are atomic, in
specify each address by segment name and an offset. For
the sense that either the whole segment should be in main
simplicity of implementation, segments are numbered and are
memory, or none of the segment should be there. The
referred by a segment number than a segment name thus a
segments may be placed anywhere in main memory, but the
logical address consists of two tuples (segment-number,
instructions or data in one segment should be contiguous as
offset). Normally the user program is compiled and the
shown in figure below,
compiler automatically constructs the segments. A ‘C’
compiler might create segments for the code, global variables,
the heap (from which memory is allocated), the stacks used by
SEGMENT 1
each thread and the standard C library. Segments that are
linked in during compile time might be assigned separate Size of this segment(0-150)
segments. The loader will take all these segments and assign
them segment numbers. A logical address consists of two SEGMENT 5
parts, a segment number s and an offset into that segment, d.
Size of this segment(0-130)
The segment number is used as an index to the segment table.
The offset d of the logical address must between 0 and
segment length. When the offset is legal, it is added to the SEGMENT 7
segment base to produce the address in physical memory of Size of this segment(0-100)
the desired byte. The segments are stored in physical memory.
The segment table has a separate entry for each segment, SEGMENT 9
giving the beginning address of the segment in the physical
Size of this segment(0-70)
memory and the length of that segment. Each segment has no
fixed size. If the length of one segment starts from 0 and ends
SEGMENT 2
at 200 then the second one does not start from 200 to 210 it
will start from 0 to 10. Size of this segment(0-50)

SEGMENT 4

Size of this segment(0-10)


References:
V. X86 ARCHITECTURE • Operating System Concepts and overview 8edition
The memory segmentation used by early” x86 processors”, Silberschatz, Galvin, Gagne.
beginning with the Intel 8086, does not provide any
• Belady, L.A. A study of replacement algorithms for a
protection. Any program running on these processors can virtual storage computer.
access any segment with no limits. A segment is only
identified by its starting location; there is no length checking. • Comfort, W.T. A computing system design for user
Segmentation in the Intel 80286 and later provides protection: service.
with the introduction of the 80286, Intel retroactively named
the sole operating mode of the previous x86 CPU models "real
• Corbató, F.J., and Vyssotsky, V.A. Introduction and
overview of the Multics System.
mode" and introduced a new "protected mode" with protection
features. For backward compatibility, all x86 CPUs start in
"real mode" with no memory protection, fixed 64 KB
segments, and only 20-bit (1024 KB) addressing. An 80286 or
later processor must be switched into another mode by
software in order to use its full address space and advanced
MMU features. The x86-64 architecture does not use
segmentation in long mode (64-bit mode). Four of the
segment registers: CS, SS, DS, and ES are forced to 0, and the
limit to 264. The segment registers FS and GS can still have a
nonzero base address. This allows operating systems to use
these segments for special purposes.

VI. CONCLUSIONS
Segmented Virtual Memory allows for the protection and
relocation of processes, memory segments as well as the
sharing of libraries between processes.

You might also like