Presentation is loading. Please wait.

Presentation is loading. Please wait.

OS Organization 1 CS502 Spring 2006 A Note on Operating System Organization CS-502 – Spring 2006.

Similar presentations


Presentation on theme: "OS Organization 1 CS502 Spring 2006 A Note on Operating System Organization CS-502 – Spring 2006."— Presentation transcript:

1 OS Organization 1 CS502 Spring 2006 A Note on Operating System Organization CS-502 – Spring 2006

2 OS Organization 2 CS502 Spring 2006 The “THE” Operating System Dijkstra, E. W., “The Structure of the ‘THE’-Multiprogramming System,” Communications of ACM, vol.11, pp. 341-346, May 1968. Processes & Semaphores Memory Management Operator-Process Communication I/O Management User Programs System Operator

3 OS Organization 3 CS502 Spring 2006 Operating System Organizations The literature in operating systems is full of papers of simple, elegant systems like this one Simple Easy to build and maintain by small teams Very instructive for study Limited usefulness

4 OS Organization 4 CS502 Spring 2006 Question In a typical system, how do the layers or components talk to each other? Answer: one of two ways Messages between processes Procedure/function calls between “modules”

5 OS Organization 5 CS502 Spring 2006 Message-based systems Processes are isolated from each other – separate address spaces, etc. IPC primitives Send Message (socket, content) Wait For Message (socket, &content) Request, results, and status encoded in message contents Static processes to manage resources, create abstractions and layers

6 OS Organization 6 CS502 Spring 2006 Message-based systems – Resource manager while (true) { ReceiveMessage (socket, &content) switch (content.action) { case action1: case action2: case action3: case action4: <release previously held action & reply>... }

7 OS Organization 7 CS502 Spring 2006 E.g., File Manager void File_Manager(socket fileSocket) { while (true) { ReceiveMessage (fileSocket, &content) switch (content.action) { case write: case seek: case read: case readDone: <return result of read previously started>... }

8 OS Organization 8 CS502 Spring 2006 Message-based systems (continued) Resource manager Infinite loop Created at system start-up, assigned fixed sockets Effectively a critical section – one request or activity is handled at a time Maintains internal data structures for queuing up requests that cannot be replied to immediately No sharing of data with requesting processes Any status information is encoded in content Reply to specific socket of requester

9 OS Organization 9 CS502 Spring 2006 Message-based systems (continued) Requested actions encapsulated in function – e.g., void read(file f, char *p, int len) { socket s = new(socket); content c = {f, readAction,len, s}; content r = {char c[len]); SendMessage(fileManager, c); WaitForMessage(s, r); strcpy(r.c, p, len); } Examples MACH (Carnegie Mellon University Mac OS-X

10 OS Organization 10 CS502 Spring 2006 Procedure/Monitor-based systems Resource Manager represented as a Monitor – e.g., monitor class file { void read(file f, char *p, int len); void write(file f, char *p, int len); void seek(file f, position);... } Requester makes direct function calls to monitor

11 OS Organization 11 CS502 Spring 2006 Process/Monitor systems Resource manager Static object with functions; created at start-up Effectively a critical section –one request or activity is handled at a time Maintains internal data structures for queuing up requests that cannot be replied to immediately Shared address space, but internal data hidden from requesters Status maintained in stack of requesting process Examples Pilot

12 OS Organization 12 CS502 Spring 2006 Observation There is really no fundamental difference between systems organized by messages and those organized by monitors Choice depends upon what is available in underlying system Shared or separate address spaces Language support for monitor discipline … Lauer, H.C. and Needham, R.M., “On the Duality of Operating System Structures,” Operating Systems Review, vol 13, #2, April 1979, pp. 3-19.


Download ppt "OS Organization 1 CS502 Spring 2006 A Note on Operating System Organization CS-502 – Spring 2006."

Similar presentations


Ads by Google