Top Banner
CSE325 Principles of Operating Systems Operating System Structure David Duggan [email protected] January 24, 2013
38

Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Apr 10, 2018

Download

Documents

hacong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 Principles of Operating Systems

Operating System Structure

David Duggan

[email protected]

January 24, 2013

Page 2: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

2

A View of Operating System Services

1/24/13 CSE325 - OS Structure

Page 3: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 3

Operating System Design and Implementation

n  Affected by choice of hardware, type of system

n  User goals and System goals n  User goals – operating system should be convenient to use,

easy to learn, reliable, safe, secure, and fast n  System goals – operating system should be easy to design,

implement, and maintain, as well as flexible, reliable, error-free, secure, and efficient

n  Important principle is separation Policy: What will be done? Mechanism: How to do it?

n  The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later

Page 4: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Operating Systems Structures

n  Structure/Organization/Layout of OSs: 1.  Monolithic (one unstructured program)

2.  Layered

3.  Microkernel

4.  Virtual Machines

n  The role of Virtualization

CSE325 - OS Structure

Page 5: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 - OS Structure

Monolithic Operating System

1/24/13 5

Page 6: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Monolithic OS – Basic Structure

n  Application programs that invoke the requested system services.

n  A set of system services that carry out the operating system procedures/calls.

n  A set of utility procedures that help the system services.

1/24/13 6 CSE325 - OS Structure

Page 7: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 - OS Structure

MS-DOS System Structure

n  MS-DOS – written to provide functionality in the least space: n  not divided into modules (monolithic).

n  Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated.

Page 8: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

MS-DOS Layer Structure

1/24/13 8

Page 9: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 9

n  UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts

n  The kernel n  Consists of everything below the system-call interface

and above the physical hardware

n  Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level

n  Systems programs

UNIX System Structure

Page 10: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Traditional UNIX System Structure

Page 11: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Traditional UNIX Kernel [Bach86]

Page 12: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Layered Approach

n  The operating system is divided into a number of layers (levels), each built on top of lower layers.

n  The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.

n  With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers.

CSE325 - OS Structure

Page 13: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Layered Operating System

1/24/13 13

Page 14: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 - OS Structure

Operating System Layers

1/24/13 14

Page 15: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Older Windows System Layers

15

Page 16: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Microkernel System Structure

n  Move as much functionality as possible from the kernel into “user” space.

n  Only a few essential functions in the kernel: n  primitive memory management (address space) n  I/O and interrupt management n  Inter-Process Communication (IPC) n  basic scheduling

n  Other OS services are provided by processes running in user mode (vertical servers): n  device drivers, file system, virtual memory…

1/24/13 16 CSE325 - OS Structure

Page 17: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Layered vs. Microkernel Architecture

17

Page 18: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Microkernel System Structure

n  Communication takes place between user modules using message passing

n  Benefits: n  Easier to extend a microkernel

n  Easier to port the operating system to new architectures

n  More reliable (less code is running in kernel mode)

n  More secure

n  Detriments: n  Performance overhead of user space to kernel space

communication

CSE325 - OS Structure

Page 19: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 - OS Structure

Microkernel Operating System

1/24/13

Page 20: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Benefits of a Microkernel Organization

n  Extensibility/Reliability n  modular design n  easier to extend a microkernel n  more reliable (less code is running in kernel mode) n  more secure (less code to be validated in kernel) n  small microkernel can be rigorously tested.

n  Portability n  changes needed to port the system to a new

processor is done in the microkernel, not in the other services.

1/24/13 20 CSE325 - OS Structure

Page 21: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Mach 3 Microkernel Structure

1/24/13 21 CSE325 - OS Structure

Page 22: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Mac OS X Structure

1/24/13 22 CSE325 - OS Structure

Page 23: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Windows NT Client-Server Structure

1/24/13 23 CSE325 - OS Structure

Page 24: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Windows NT 4.0 Architecture

Page 25: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Structure of the MINIX 3 System

Page 26: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 26

Kernel Modules

n  Most modern operating systems implement kernel modules n  Uses object-oriented approach

n  Each core component is separate

n  Each talks to the others over known interfaces

n  Each is loadable as needed within the kernel

n  Overall, similar to layers but more flexible

Page 27: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

CSE325 - OS Structure

Solaris Modular Approach

1/24/13 27

Page 28: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

XP Architecture

Page 29: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 29

Virtual Machines

n  A virtual machine takes the layered approach to its logical next step. It treats hardware and the operating system kernel as though they were all hardware

n  A virtual machine provides an interface identical to the underlying bare hardware

n  The operating system host creates the illusion that a process has its own processor (and virtual memory)

n  Each guest provided with a (virtual) copy of underlying computer

Page 30: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 30

Virtual Machines (Cont.)

(a) Non-virtual machine (b) virtual machine

Non-virtual Machine" Virtual Machine"

Page 31: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Testing a new Operating System

Page 32: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Integrating two Operating Systems

Page 33: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

The Role of Virtualization

(a)  General organization between a program, interface, and system.

(b)  General organization of virtualizing system A on top of system B. 33

Page 34: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Java Virtual Machine

n  Compiled Java programs are platform-neutral bytecodes executed by a Java Virtual Machine (JVM).

n  JVM consists of:

- class loader

- class verifier

- runtime interpreter

n  Just-In-Time (JIT) compilers increase performance.

CSE325 - OS Structure

Page 35: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

The Java Virtual Machine

1/24/13 35

Page 36: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Hypervisor/VMM

1/24/13 36 CSE325 - OS Structure

Page 37: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

Types of Hypervisors

(a) A type 1 hypervisor. (b) A type 2 hypervisor

1/24/13 37 CSE325 - OS Structure

Page 38: Operating System Structure - New Mexico Institute of ...cs325/spring2013/Lec04-OSStructure.pdf · Operating System Structure ... Inter-Process Communication (IPC) ! ... communication

1/24/13 CSE325 - OS Structure 38

Para- vs. Full-virtualization

n  Presents guest with system similar but not identical to hardware

n  Guest must be modified to run on paravirtualized hardware

n  Guest can be an OS, or in the case of Solaris 10 applications running in containers

n  Full-virtualization: unmodified guest OSes