Docsity

MEMORY MANAGEMENT NOTES - I, Study notes of Operating Systems

Toggle sidebar
bg1
Memory management requirements:
1. Relocation
2. Protection
3. Sharing
4. Logical Organization
5. Physical Organization
1. Relocation:
Programmer does not know where the program will be placed in memory when it is executed
while the program is executing, it may be swapped to disk and returned to main memory at a
different location (relocated). Memory references must be translated in the code to actual physical
memory address.
The address generated by CPU is said to be logical address. An address generated by MMU is
called physical address.
Physical address= Contents of Relocation register + logical address
2. Protection:
Processes should not be able to reference memory locations in another process without permission.
It must be checked at run time. Memory protection requirement must be satisfied by the processor
(hardware) rather than the operating system (software).
The word protection means provide security from
unauthorized usage of memory. The operating can protect the memory with the help of base and
limit register. Base registers consisting the starting address of next process. The limit specifies the
boundary of that job, so the limit register is also said to be fencing register.
3. Sharing:
Allow several processes to access the same portion of memory. It is better to allow each process
access to the same copy of the program rather than have their own separate copy.
pf3

Partial preview of the text

Download MEMORY MANAGEMENT NOTES - I and more Study notes Operating Systems in PDF only on Docsity!

Memory management requirements:

  1. Relocation
  2. Protection
  3. Sharing
  4. Logical Organization
  5. Physical Organization 1. Relocation: Programmer does not know where the program will be placed in memory when it is executed while the program is executing, it may be swapped to disk and returned to main memory at a different location (relocated). Memory references must be translated in the code to actual physical memory address.

The address generated by CPU is said to be logical address. An address generated by MMU is called physical address.

Physical address= Contents of Relocation register + logical address

2. Protection:

Processes should not be able to reference memory locations in another process without permission. It must be checked at run time. Memory protection requirement must be satisfied by the processor (hardware) rather than the operating system (software).

The word protection means provide security from unauthorized usage of memory. The operating can protect the memory with the help of base and limit register. Base registers consisting the starting address of next process. The limit specifies the boundary of that job, so the limit register is also said to be fencing register.

3. Sharing:

Allow several processes to access the same portion of memory. It is better to allow each process access to the same copy of the program rather than have their own separate copy.

4. Logical organization:

Programs are written in modules. Modules can be written and compiled independently. Different degrees of protection given to modules (read-only, execute-only). Modules are shared among processes.

5. Physical organization:

Memory available for a program plus its data may be insufficient .Overlaying allows various modules to be assigned the same region of memory.

A computer memory is organized into two levels: Main memory and secondary memory. Main memory provides fast access at relatively high cost and it is volatile that mean it cannot provide permanent storage whereas secondary memory is slower and cheaper and it is a non-volatile object.

Virtual memory : A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard disk that's set up to emulate the computer's RAM. The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory serves two purposes. First, it allows us to extend the use of physical memory by using disk. Second, it allows us to have memory protection, because each virtual address is translated to a physical address.

Modern microprocessors intended for general-purpose use, a memory management unit, or MMU, is built into the hardware. The MMU's job is to translate virtual addresses into physical addresses. A basic example is given below โˆ’