(Latest Revision: 
Sun Sep  8 19:51:00 PDT 2002
)  
Chapter Three -- Operating System Structures -- Lecture Ideas
   
-  For a personal computer user, what are the advantages of
     multiprogramming?  
 -  An OS can be characterized by the services it offers, or the
     interface, or by its components and their interconnections.  
 -  We can think of an OS as an entity that allocates resources to
     processes (and deallocates).  
 -  How does Unix accomplish these aspects of process control?  
     
     -  process creation and destruction?  
      -  suspension/resumption  
      -  synchronization  
      -  communication  
      -  deadlock handling  
      
 
 -  do a "ps" on a Unix system and discuss interesting processes that are
     running (probably check processes that are vital to the running system
     first, then other processes owned by root.).  
 -  Discuss generally how the OS could do the following tasks connected
     with memory management:  
     
     -  Keep track of what parts of memory are allocated to which
          processes 
      -  Make the decision about which process should next be brought into
	  primary memory and be made runnable.  
      
 -  Discuss generally how the OS could do the following tasks connected
     with file management:  
     
     -  create/delete files  
      -  create delete directories  
      -  support file access primitives  
      -  map files to secondary storage  
      -  back-up files in RAM onto stable storage  
      
 -  Discuss generally how the OS could do the following tasks connected
     with disk management:  
     
     -  free-space management  
      -  storage allocation  
      -  disk scheduling  
      
     (Management of this bottleneck is critical.  One of the big
     developments of Unix was the re-design of the file system.  It greatly
     improved throughput.)  
 -  Discuss these basic OS services:  
     
     -  program execution  
      -  I/O operations  
      -  File-System manipulation  
      -  Communication  
      -  Error detection  
      -  Resource allocation -- something like a request/release paradigm
	  is necessary in a multiprogramming environment.  
      -  Accounting  
      -  Protection  
      
 -  Security Defined: any mechanism for controlling who is allowed
     entry to the system.  
 -  Protection Defined: any mechanism for controlling the accesses
     to resources that are made by users that have cleared security.
     
 -  System Calls  
     
     -  the operating system services mentioned above are furnished by
	  means of OS system calls.  
      -  If we think of the OS as a data structure, then system calls are
	  the operations of the data structure.  
      -  The "system call instruction" generates a trap (interrupt).
	  
      -  System call parameters may be left in registers, RAM, or program
	  stack.  Registers can hold pointers to areas in RAM containing
	  parameters.  
      -  Look on page 66 at the list of system call types.  Do we
	  understand what all these operations do?  
      
 -  Discuss "single-tasking approach" of DOS versus "multi-tasking"
     approach of Unix.  
 -  Any questions about the "message passing" and "shared memory"
     communication paradigms?  
 -  Discussion of shells?  -- internal versus external commands.
-  Operating System Structuring  
     
     -  Some OS's are not very modular  
      -  Some are built in layers, but the layers can "bypass" each other.
	  
      -  Some are more strictly layered -- bypassing is not common.
          Each layer depends on the one underneath.  
      -  layered design facilitates testing.  
      -  It's not easy to design layers without any "circular"
	  dependencies -- (e.g. backing store driver depends on
	  CPU-scheduler and vice-versa.)  
      -  Microkernel design puts just a few essential services (say
	  process & memory management plus process communication) in the
	  kernel and the rest is pushed to "user-level" 
      -  With microkernel architecture it becomes fairly easy (if not
	  maximally efficient) to emulate many different operating systems
	  "on top of" the microkernel.  The idea is to interpret foreign
	  system calls with microkernel system calls.  
      
 -  The virtual machine idea is to implement in software "an interface
     that is identical to the underlying bare hardware." -- nice way to
     isolate users -- secure -- each user can run a different operating
     system.  A user can experiment on a new operating system design
     without risking bringing down the part of the system being used by
     others.  The Java virtual machine is a modern instance of this type of
     design.  The IBM version dates back to the late sixties.  
 -  OS Implementation Principles  
      
     -  Separate policy from mechanism.  
      -  Write most of the OS in a high level language.  (one writes code
	  faster; code is more compact; code is easier to understand and
	  debug; the operating system is "portable." -- There is really no
	  downside -- modern compilers generate efficient assembly code.
	  Increases in efficiency of OS usually comes by using better data
	  structures and algorithms -- we can write a few small pieces of
	  the OS in assembly where that is really needed for efficiency or
	  for compatability with the hardware.)  
      
 
 -  System generation -- setting compile parameters for the OS versus
     table driven systems that are pre-compiled.  The trend is toward
     pre-compiling.