tailieunhanh - Lecture Operating system concepts - Lecture 11

In this chapter, we consider the various aspects of files and the major directory structures. We also discuss the semantics of sharing files among multiple processes, users, and computers. Finally, we discuss ways to handle file protection, necessary when we have multiple users and we want to control who may access files and how files may be accessed. | CSC 322 Operating Systems Concepts Lecture - 12: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Don’t have infinite RAM Do have a memory hierarchy Cache (Few MB very fast, expensive, volatile ) Main ( Few GB, medium speed, medium priced, volatile) Disk ( Few TB, slow, cheap, nonvolatile ) Memory manager has the job of using this hierarchy to create an abstraction (illusion) of easily accessible memory Memory Management Basics Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 3 OS loads a program from disk to memory and execute. One program at a time in memory Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 4 The simplest memory abstraction; no abstraction Early mainframe computers (before 1960), early minicomputers (before 1970), and early personal computers (before 1980) had no | CSC 322 Operating Systems Concepts Lecture - 12: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Don’t have infinite RAM Do have a memory hierarchy Cache (Few MB very fast, expensive, volatile ) Main ( Few GB, medium speed, medium priced, volatile) Disk ( Few TB, slow, cheap, nonvolatile ) Memory manager has the job of using this hierarchy to create an abstraction (illusion) of easily accessible memory Memory Management Basics Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 3 OS loads a program from disk to memory and execute. One program at a time in memory Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 4 The simplest memory abstraction; no abstraction Early mainframe computers (before 1960), early minicomputers (before 1970), and early personal computers (before 1980) had no memory abstraction Can only have one program in memory at a time. Bug in user program can trash the OS (a and c) Second on some embedded systems (b) Third on MS-DOS (early PCs) part in ROM called BIOS (Basic Input Output System) One program at a time Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 5 Save the entire contents of memory to a disk file, then bring in and run the next program Could swap new program into memory from disk and send old one out to disk Only one program at a time in the memory Not concurrent so no conflicts Running Multiple Programs Memory Abstraction Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 6 Schematic View of Swapping Lecture-12 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 7 Special hardware, it is possible to run multiple programs concurrently, even without swapping IBM 360 -divide memory into 2 KB blocks, and associate a 4 bit protection key with chunk. Keep keys in registers. A machine with a 1-MB memory needed 512 of 4-bit registers for a total