ch02

28
Silberschatz, Galvin and Gagne ©2009 perating System Concepts – 8 th Edition, Chapter 2: Operating- System Structures

Upload: lisa-wheeler

Post on 23-Oct-2014

41 views

Category:

Documents


1 download

DESCRIPTION

2007 operating system ppt

TRANSCRIPT

Page 1: ch02

Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition,

Chapter 2: Operating-System Structures

Page 2: ch02

2.2 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Last week Topics

What Operating Systems Do?

Distributed /Clustered Systems

Special-Purpose Systems

Open-Source Operating Systems

Page 3: ch02

2.3 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Operating System News

Student 1

Student 2

Student 3

Share LatestOS news in 1 to 5minutes

Page 4: ch02

2.4 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Chapter 2: Operating-System Structures

Operating System Services

User Operating System Interface

System Programs

Operating System Design and Implementation

Virtual Machines

Page 5: ch02

2.5 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Bit , Byte and Word

Page 6: ch02

2.6 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Machine cycle

Page 7: ch02

2.7 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Virtual Memory

http://www.youtube.com/watch?v=Fx_I6-dL__0

Page 8: ch02

2.8 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

A View of Operating System Services

Page 9: ch02

2.9 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Bourne Shell Command Interpreter

Page 10: ch02

2.10 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

The Mac OS X GUI

Page 11: ch02

2.11 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

API – System Call – OS Relationship

Page 12: ch02

2.12 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Standard C Library Example

C program invoking printf() library call, which calls write() system call

Page 13: ch02

2.13 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Types of System Calls

Process control

File management

Device management

Information maintenance

Communications

Protection

Page 14: ch02

2.14 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Examples of Windows and Unix System Calls

Page 15: ch02

2.15 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

MS-DOS execution

(a) At system startup (b) running a program

Page 16: ch02

2.16 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

FreeBSD Running Multiple Programs

Page 17: ch02

2.17 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

MS-DOS Layer Structure

Page 18: ch02

2.18 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

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 19: ch02

2.19 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Traditional UNIX System Structure

Page 20: ch02

2.20 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

UNIX

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

Systems programs

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-system functions; a large number of functions for one level

Page 21: ch02

2.21 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Layered Operating System

Inner circleIs more protectedThan outer circle

Page 22: ch02

2.22 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Microkernel System Structure Moves as much from the kernel into “user” space

Communication takes place between user modules using message passing

Benefits:

Easier to extend a microkernel

Easier to port the operating system to new architectures

More reliable (less code is running in kernel mode)

More secure

Detriments:

Performance overhead of user space to kernel space communication

Page 23: ch02

2.23 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Why do we need Virtual Machine?

http://www.youtube.com/watch?v=V9AiN7oJaIM&feature=related

Page 24: ch02

2.24 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Virtual Machines

A virtual machine takes the layered 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 25: ch02

2.25 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Virtual Machines (Cont)

(a) Nonvirtual machine (b) virtual machine

Non-virtual Machine Virtual Machine

Page 26: ch02

2.26 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Linux : CLI (COMMAND LINE INTERFACE)

clear Clear screen

pwd Print Working Directory

cd Change Directory

mkdir Make Directory

rmdir Remove directory

ls List of directory

cp file1 file2 File2 would be created.

26

cd dir1 Change directory to dir1

cd / Change directory to root dir

cd Change Directory to home dir

cd ~ Change Directory to home dir

mv file1 file2 Rename file1 to file2

rm -f file2 Remove file file2

rm –I file2 Remove file in an interactive mode

Page 27: ch02

2.27 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition

Linux: CLI (COMMAND LINE INTERFACE)

27 cat <<filename>> See the content of file

rm <<filename> Remove the file

mv <<oldfilename>> <<newfilename>> Rename the file

more <<filename>> View the file content, it allows scroll down

less <<filename>> View the file content, it allows scroll up and down

touch <<filename>> Empty file will be created

grep <<word>> filename

Page 28: ch02

Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition,

End of Chapter 2