os2-3_str

56
 A. Frank - P . Weisberg Operating Systems Structure of Operating Systems

Transcript of os2-3_str

Page 1: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 1/56

 A. Frank - P. Weisberg

Operating Systems

Structure of

Operating Systems

Page 2: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 2/56

A. Frank - P. Weisberg

Operating Systems Structures

• Structure/Organization/Layout of OSs:

1. Monolithic (one unstructured program)

2. Layered3. Microkernel

4. Virtual Machines

• The role ofVirtualization

Page 3: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 3/56

A. Frank - P. Weisberg

Monolithic Operating System

Page 4: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 4/56

A. Frank - P. Weisberg

Monolithic OS –  basic structure

• Application programs that invokes the

requested system services.

• A set of system services that carry out the

operating system procedures/calls.

• A set of utility procedures that help the system

services.

Page 5: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 5/56

A. Frank - P. Weisberg

MS-DOS System Structure

• MS-DOS –  written to provide the most

functionality in the least space:

 – not divided into modules (monolithic).

 – Although MS-DOS has some structure, its

interfaces and levels of functionality are not well

separated.

Page 6: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 6/56

A. Frank - P. Weisberg

MS-DOS Layer Structure

Page 7: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 7/567 

A. Frank - P. Weisberg

UNIX System Structure

• UNIX –  limited by hardware functionality, theoriginal UNIX OS had limited structuring.

• The UNIX OS consists of two separable parts:

1. Systems Programs:

2. The Kernel:

 –  Consists of everything below the system-call

interface and above the physical hardware. –  Provides the file system, CPU scheduling,

memory management, and other operating-systemfunctions; a large number of functions for one

level.

Page 8: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 8/568 

A. Frank - P. Weisberg

Traditional UNIX System Structure

Page 9: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 9/569 

A. Frank - P. Weisberg

Traditional UNIX Kernel

Page 10: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 10/5610

 

LINUX Kernel Components

A. Frank - P. Weisberg

Page 11: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 11/5611

 

A. Frank - P. Weisberg

Layered Approach

• The operating system is divided into a number

of layers (levels), each built on top of lower

layers.

• The bottom layer (layer 0) is the hardware; the

highest (layer N) is the user interface.

• With modularity, layers are selected such that

each uses functions (operations) and services of

only lower-level layers.

Page 12: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 12/5612

 

A. Frank - P. Weisberg

Layered Operating System

Page 13: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 13/5613

 

A. Frank - P. Weisberg

An Operating System Layer 

Page 14: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 14/5614

 

A. Frank - P. Weisberg

General OS Layers

Page 15: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 15/56

15 

A. Frank - P. Weisberg

Operating System Layers

Page 16: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 16/56

16 

A. Frank - P. Weisberg

Structure of the THE operating system

Page 17: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 17/56

17 

A. Frank - P. Weisberg

Older Windows System Layers

Page 18: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 18/56

18 

A. Frank - P. Weisberg

OS/2 Layer Structure

Page 19: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 19/56

19 

A. Frank - P. Weisberg

Microkernel System Structure (1)

• Move as much functionality as possible fromthe kernel into “user ” space. 

• Only a few essential functions in the kernel:

 –  primitive memory management (address space)

 – I/O and interrupt management

 – Inter-Process Communication (IPC)

 –  basic scheduling• Other OS services are provided by processes

running in user mode (vertical servers):

 – device drivers, file system, virtual memory… 

Page 20: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 20/56

20 

A. Frank - P. Weisberg

Layered vs. Microkernel Architecture

Page 21: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 21/56

21 

A. Frank - P. Weisberg

Microkernel System Structure (2)

• Communication takes place between user

modules using message passing.

• More flexibility, extensibility, portability and

reliability.

• But performance overhead caused by replacing

service calls with message exchanges between

 processes.

Page 22: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 22/56

22 

A. Frank - P. Weisberg

Microkernel Operating System

Page 23: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 23/56

Page 24: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 24/56

24 

A. Frank - P. Weisberg

Benefits of Microkernel Organization (2)

• Distributed system support

 – message are sent without knowing what

the target machine is.• Object-oriented operating system

 – components are objects with clearly

defined interfaces that can be

interconnected to form software.

Page 25: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 25/56

25 

A. Frank - P. Weisberg

Mach 3 Microkernel Structure

Page 26: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 26/56

26 

A. Frank - P. Weisberg

Mac OS X Structure

Page 27: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 27/56

27 

A. Frank - P. Weisberg

Structure of the MINIX 3 system

Page 28: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 28/56

28 

A. Frank - P. Weisberg

Windows NT Client-Server Structure

Page 29: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 29/56

29 

A. Frank - P. Weisberg

Windows NT 4.0 Architecture

Page 30: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 30/56

30 

A. Frank - P. Weisberg

Windows XP Architecture

Page 31: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 31/56

31 

Windows 7.0 Architecture

A. Frank - P. Weisberg

Page 32: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 32/56

32 

A. Frank - P. Weisberg

The Neutrino Microkernel

Page 33: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 33/56

Page 34: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 34/56

34 

A. Frank - P. Weisberg

Solaris Modular Approach

Page 35: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 35/56

35 

A. Frank - P. Weisberg

Virtual Machines (1)

• A Virtual Machine (VM) takes the layered and

microkernel approach to its logical conclusion.

• It treats hardware and the operating system kernel as

though they were all hardware.• A virtual machine provides an interface identical to

the underlying bare hardware.

• The operating system host creates the illusion that a

 process has its own processor and (virtual memory).

• Each guest provided with a (virtual) copy of

underlying computer.

Page 36: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 36/56

Page 37: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 37/56

37 

A. Frank - P. Weisberg

on Bare MachineImplementationVM

Non-virtual Machine Virtual Machine

Page 38: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 38/56

38 

VM Implementation on Host OS

A. Frank - P. Weisberg

Page 39: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 39/56

39 

A. Frank - P. Weisberg

Advantages/Disadvantages of VMs

• The VM concept provides complete protection of

system resources since each virtual machine is isolated

from all other virtual machines. This isolation permits

no direct sharing of resources.• A VM system is a perfect vehicle for OS research

and development. System development is done on the

virtual machine, instead of on a physical machine and

so does not disrupt normal system operation.

• The VM concept is difficult to implement due to the

effort required to provide an exact duplicate to the

underlying machine.

Page 40: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 40/56

40 

A. Frank - P. Weisberg

Virtual Machines History and Benefits

• First appeared commercially in IBM mainframes in 1972.

• Fundamentally, multiple protected execution environments

(different operating systems) can share the same hardware.

• Protect from each other.

• Some sharing of file can be permitted, controlled.

• Commutate with each other, other physical systems via

networking.

• Useful for development and testing.• Consolidation of many low-resource use systems onto fewer

 busier systems.

• “Open Virtual Machine Format”, standard format of VMs,

allows a VM to run within many different VM (host) platforms.

Page 41: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 41/56

41 

A. Frank - P. Weisberg

Testing a new Operating System

Page 42: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 42/56

42 

A. Frank - P. Weisberg

Integrating two Operating Systems

Page 43: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 43/56

43 

A. Frank - P. Weisberg

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.

Page 44: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 44/56

44 

A. Frank - P. Weisberg

Architectures of Virtual Machines (1)

• There are interfaces at different levels.

• An interface between the hardware and

software, consisting of machine instructions

 –  that can be invoked by any program.

• An interface between the hardware and

software, consisting of machine instructions

 –  that can be invoked only by privileged

 programs, such as an operating system.

Page 45: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 45/56

45 

A. Frank - P. Weisberg

Architectures of Virtual Machines (2)

• An interface consisting of system calls

as offered by an operating system.

• An interface consisting of library calls: –  generally forming what is known as

an Application Programming Interface

(API).

 –  In many cases, the aforementioned

system calls are hidden by an API.

Page 46: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 46/56

46 

A. Frank - P. Weisberg

Architectures of Virtual Machines (3)

Various interfaces offered by computer systems

Page 47: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 47/56

Page 48: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 48/56

48 

A. Frank - P. Weisberg

Java Virtual Machine

• Compiled Java programs are platform-neutral

 bytecodes executed by a Java Virtual Machine

(JVM).

• JVM consists of:

- class loader

- class verifier

- runtime interpreter

• Just-In-Time (JIT) compilers increase

 performance.

Page 49: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 49/56

49 

A. Frank - P. Weisberg

The Java Virtual Machine

Page 50: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 50/56

50 

A. Frank - P. Weisberg

Hypervisor/VMM (Virtual Machine Monitor)

(b) A virtual machine monitor, with multipleinstances of (applications, operating system)

combinations.

Page 51: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 51/56

Page 52: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 52/56

52 

A. Frank - P. Weisberg

Types of Hypervisors

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

Page 53: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 53/56

53 

A. Frank - P. Weisberg

VM/370 with CMSs

Page 54: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 54/56

54 

A. Frank - P. Weisberg

VMware Architecture

Page 55: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 55/56

55 

A. Frank - P. Weisberg

Para-Virtualization

• Presents guest with system similar but not

identical to hardware.

• Guest must be modified to run on specialized

 para-virtualized hardware.

• Guest can be an OS, or in the case of Solaris 10

applications running in containers.

Page 56: os2-3_str

8/11/2019 os2-3_str

http://slidepdf.com/reader/full/os2-3str 56/56

Solaris 10 with Two Containers