ch02

Post on 23-Oct-2014

40 views 1 download

Tags:

description

2007 operating system ppt

transcript

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

Chapter 2: Operating-System Structures

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

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

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

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

Bit , Byte and Word

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

Machine cycle

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

Virtual Memory

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

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

A View of Operating System Services

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

Bourne Shell Command Interpreter

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

The Mac OS X GUI

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

API – System Call – OS Relationship

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

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

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

Examples of Windows and Unix System Calls

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

MS-DOS execution

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

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

FreeBSD Running Multiple Programs

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

MS-DOS Layer Structure

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

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

Traditional UNIX System Structure

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

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

Layered Operating System

Inner circleIs more protectedThan outer circle

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

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

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

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

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

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

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

End of Chapter 2