Sie sind auf Seite 1von 5

02745022

Rennie Ramlochan
Fundamentals Of Operating System
1)
Logical memory is the address space, assigned to a logical partition, that the
operating system perceives as its main storage. For a logical partition that
uses shared memory a subset of the logical memory is backed up by physical
main storage and the remaining logical memory is kept in auxiliary storage.
Logical address is generated by the CPU; also referred to as virtual address
while Physical address is address seen by the memory unit.
Logical and physical addresses are the same in compile-time and load-time
address-binding schemes and logical (virtual) and physical addresses differ in
execution-time address-binding scheme.
Physical memory is the amount of memory that is derived from hardware.
This is typically the RAM modules that are installed onto the motherboard. It
refers to the actual memory bank made of RAM chips. The term is generally
used when discussing virtual memory to differentiate what is in RAM versus
what has been swapped temporarily to disk.
Virtual memory is derived from the operating system's use of the hard disk
to temporarily write and read information to simulate a larger memory
capacity. Simulating more random access memory (RAM) than actually
exists, allowing the computer to run larger programs and multiple programs
concurrently. A common function in most every OS and hardware platform,
virtual memory uses the hard disk to temporarily hold what was in real
memory.
Virtual memory allows multiple programs to load in memory at the same
time. Each application addresses memory starting at zero, but virtual
memory takes control of the memory addressing and lets each application
function as if it had unlimited memory.
Or
Virtual memory is a technique that allows processes that may not be entirely
in the memory to execute by means of automatic storage allocation upon
request. The term virtual memory refers to the abstraction of separating
LOGICAL memory--memory as seen by the process--from PHYSICAL memory-memory as seen by the processor. Because of this separation, the

programmer needs to be aware of only the logical memory space while the
operating system maintains two or more levels of physical memory space.

1b) Memory Segmentation


In computing, memory segmentation is one of the most common ways to achieve memory
protection; another common one is paging. Using segmentation, an instruction operand that
refers to a memory location includes a value that identifies a segment and an offset within that
segment. A segment has a set of permissions, and a length, associated with it. If the currently
running process is allowed by the permissions to make the type of reference to memory that it is
attempting to make, and the offset within the segment is within the range specified by the length
of the segment, the reference is permitted; otherwise, a hardware exception is raised.
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 raised, 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, if the segmentation is implemented with paging. 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.
OR
In a segmented memory management system the blocks to be replaced in main memory are
potentially of unequal length and correspond to program and data ``segments.'' A program
segment might be, for example, a subroutine or procedure. A data segment might be a data
structure or an array. In both cases, segments correspond to logical blocks of code or data.
Segments, then, are ``atomic,'' in the sense that either the whole segment should be in main
memory, or none of the segment should be there. The segments may be placed anywhere in main
memory, but the instructions or data in one segment should be contiguous.
A segmented memory organization
----------SEGMENT 1
----------SEGMENT 5
----------SEGMENT 7
----------SEGMENT 2

----------SEGMENT 4
----------SEGMENT 9
----------Using segmented memory management, the memory controller needs to know where in physical
memory is the start and the end of each segment. When segments are replaced, a single segment
can only be replaced by a segment of the same size, or by a smaller segment. After a time this
results in a "memory fragmentation'', with many small segments residing in memory, having
small gaps between them. Because the probability that two adjacent segments can be replaced
simultaneously is quite low, large segments may not get a chance to be placed in memory very
often. In systems with segmented memory management, segments are often ``pushed together''
occasionally to limit the amount of fragmentation and allow large segments to be loaded.
This organization appears to be efficient because an entire block of code is available to the
processor. Also, it is easy for two processes to share the same code in a segmented memory
system; if the same procedure is used by two processes concurrently, there need only be a single
copy of the code segment in memory. (Each process would maintain its own, distinct data
segment for the code to access, however.)
Segmented memory management is not as popular as paged memory management, however. In
fact, most processors which presently claim to support segmented memory management actually
support a hybrid of paged and segmented memory management, where the segments consist of
multiples of fixed size blocks.

1c)
The steps taken when a page is needed but it is located on disk.

Therefore, the operating system must:


1. Determine the location of the data in auxiliary storage.
2. Obtain an empty page frame in RAM to use as a container for the data.
3. Load the requested data into the available page frame.
4. Update the page table to show the new data.

5. Return control to the program, transparently retrying the instruction that caused the page
fault.
The need to reference memory at a particular address arises from two main sources:

Processor trying to load and execute a program's instructions itself.

Data being accessed by a program's instruction.

In step 2, when a page has to be loaded and all existing pages in RAM are currently in use, one
of the existing pages must be swapped with the requested new page. The paging system must
determine the page to swap by choosing one that is least likely to be needed within a short time.
There are various page replacement algorithms that try to answer such issue. Most operating
systems use some approximation of the least recently used (LRU) page replacement algorithm
(the LRU itself cannot be implemented on the current hardware) or working set based algorithm.

Page Out, Page In


When memory is full and the current program needs instructions that are not in memory, pages
are swapped. In this example, program A needs a page from the disk, and a page from program C
is swapped out to make room.

References:
http://forums.techarena.in/motherboard-processor-ram/1161454.htm
http://stackoverflow.com/questions/1204018/memory-segmentation-onmodern-oses-why-do-you-need-4-segments
http://en.wikipedia.org/wiki/Memory_segmentation

Das könnte Ihnen auch gefallen