<< Chapter < Page Chapter >> Page >

Static relocation with protection keys (IBM S/360 approach):

  • Protection Key = a small integer stored with each chunk of memory. The chunks are likely to be 1k-4k bytes.
  • Keep an extra hardware register to identify the current process. This is called the process id, or PID. 0 is reserved for the operating system'sprocess id.
  • On every memory reference, check the PID of the current process against the key of the memory chunk being accessed. PID 0 is allowed to touchanything, but any other mismatch results in an error trap.
  • Additional control: who is allowed to set the PID? How does OS regain control once it has given it up?
  • This is the scheme used for the IBM S/360 family. It is safe but inconvenient:
    • Programs have to be relocated before loading. In some systems (e.g. MPS) this requires completerelinking. Expensive.
    • Cannot share information between two processes very easily
    • Cannot swap a process out to secondary storage and bring it back to a different location

Dynamic memory relocation: instead of changing the addresses of a program before it is loaded, we change the address dynamicallyduring every reference.

  • Under dynamic relocation, each program-generated address (called a logical or virtual address) is translated in hardware to a physical, or realaddress. This happens as part of each memory reference.

  • Show how dynamic relocation leads to two views of memory, called address spaces. With static relocation we force the views to coincide so thatthere can be several levels of mapping.

Base and bounds, segmentation

Base&bounds relocation:

  • Two hardware registers: base address for process, bounds register that indicates the last valid address the process may generate.

Each process must be allocated contiguously in real memory.

  • On each memory reference, the virtual address is compared to the bounds register, then added to the base register. A bounds violation results inan error trap.
  • Each process appears to have a completely private memory of size equal to the bounds register plus 1. Processes are protected from each other. Noaddress relocation is necessary when a process is loaded.
  • Typically, the OS runs with relocation turned off, and there are special instructions to branch to and from the OS while at the same time turningrelocation on and off. Modification of the base and bounds registers must also be controlled.
  • Base&bounds is cheap -- only 2 registers -- and fast -- the add and compare can be done in parallel.
  • Explain how swapping can work.
  • Examples: CRAY-1.

Problem with base&bound relocation:

  • Only one segment. How can two processes share code while keeping private data areas (e.g. shared editor)? Draw a picture to show that it cannotbe done safely with a single-segment scheme.

Multiple segments.

  • Permit process to be split between several areas of memory. Each area is called a segment and contains a collection of logically-relatedinformation, e.g. code or data for a module.

  • Use a separate base and bound for each segment, and also add a protection bit (read/write).
  • Each memory reference indicates a segment and offset in one or more of three ways:
    • Top bits of address select segment, low bits the offset. This is the most common, and thebest.
    • Or, segment is selected implicitly by the operation being performed (e.g. code vs. data, stack vs. data).
    • Or, segment is selected by fields in the instruction (as in Intel x86 prefixes).

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Operating systems. OpenStax CNX. Aug 13, 2009 Download for free at http://cnx.org/content/col10785/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Operating systems' conversation and receive update notifications?

Ask