Lecture 4 - Protection in OS - Lecture 4 Week 4...

This preview shows page 1 - 14 out of 48 pages.

Lecture 4 Week 4
Image of page 1

Subscribe to view the full document.

Multiprogramming introduced the need for protection Protected items: Memory Sharable I/O devices (e.g. disks) Serially reusable I/O devices (e.g. printers) Sharable programs and sub procedures Sharable data 2
Image of page 2
Separation Keeping one user’s object separate from other users Can occur in several ways (Rushby & Randell): Physical separation Temporal separation Logical separation Cryptographic separation 3
Image of page 3

Subscribe to view the full document.

No protection Isolation Share all or share nothing Share via access limitation Share by capabilities Limit use of an object Granularity of protection! 4
Image of page 4
A system that prevents one process from corrupting the memory of another process running on the same computer at the same time usually employs hardware (i.e. a Memory management unit) and system software to allocate distinct memory to different processes and to handle exceptions arising when a process tries to access memory outside its bounds 5
Image of page 5

Subscribe to view the full document.

Fence Relocation Base/bound registers Tagged architecture Segmentation Paging Paging combined with segmentation 6
Image of page 6
Introduced in single-user operating systems To prevent a faulty user program from destroying part of the resident portion of the OS Implementation of fence: Fixed fence (fence was predefined memory address) A method to confine users to one side of a boundary Enabling the OS to reside on one side and the user to stay on the other. Predefined memory address (fixed) Fence register (used a hardware register) Contain address of the end of the OS Provide means of code relocation (The location of fence could be changed) If (address > fence address), instruction was executed If (address < fence address), error 7
Image of page 7

Subscribe to view the full document.

Note: 1. Implementation very restrictive 2. OS could not grow beyond the fence boundary 8
Image of page 8
9
Image of page 9

Subscribe to view the full document.

Note: 1. An OS can be protected from a single user but fence cannot protect one user from another user 2. Has the ability of relocate 10
Image of page 10
Process of taking a program written as if it: Begin at address 0 Changing all addresses to reflect the actual address at which the program is located How? By adding the a constant relocation factor to each address of the program Relocation factor is the starting address of the memory assigned for the program Important in a multi-user environment 11
Image of page 11

Subscribe to view the full document.

Base register also known as Variable fence register. All addresses are offset from base register Provide a lower bound (a starting address) but not an upper bound. Upper bound: useful in knowing how much space is allotted Useful in checking for overflows into prohibited areas To overcome the problem because of not provide a upper bound: Add second register called Bounds register (an upper address limit) 12
Image of page 12
Operating System User A Program Space User B Program Space User C Program Space User Program Space Addresses 0 n n + 1 p p + 1 q q + 1 High p n + 1 Base Register Bound Register Memory Note: 1.
Image of page 13

Subscribe to view the full document.

Image of page 14
  • Spring '16
  • OS, Virtual memory

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern