Sie sind auf Seite 1von 28

Chapter 2: Operating-System Structures

Operating System Concepts 8th Edition,

Silberschatz, Galvin and Gagne 2009

Last week Topics


What Operating Systems Do? Distributed /Clustered Systems Special-Purpose Systems

Open-Source Operating Systems

Operating System Concepts 8th Edition

2.2

Silberschatz, Galvin and Gagne 2009

Operating System News


Student 1 Student 2 Student 3

Share Latest OS news in 1 to 5 minutes

Operating System Concepts 8th Edition

2.3

Silberschatz, Galvin and Gagne 2009

Chapter 2: Operating-System Structures


Operating System Services User Operating System Interface System Programs

Operating System Design and Implementation


Virtual Machines

Operating System Concepts 8th Edition

2.4

Silberschatz, Galvin and Gagne 2009

Bit , Byte and Word

Operating System Concepts 8th Edition

2.5

Silberschatz, Galvin and Gagne 2009

Machine cycle

Operating System Concepts 8th Edition

2.6

Silberschatz, Galvin and Gagne 2009

Virtual Memory

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

Operating System Concepts 8th Edition

2.7

Silberschatz, Galvin and Gagne 2009

A View of Operating System Services

Operating System Concepts 8th Edition

2.8

Silberschatz, Galvin and Gagne 2009

Bourne Shell Command Interpreter

Operating System Concepts 8th Edition

2.9

Silberschatz, Galvin and Gagne 2009

The Mac OS X GUI

Operating System Concepts 8th Edition

2.10

Silberschatz, Galvin and Gagne 2009

API System Call OS Relationship

Operating System Concepts 8th Edition

2.11

Silberschatz, Galvin and Gagne 2009

Standard C Library Example


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

Operating System Concepts 8th Edition

2.12

Silberschatz, Galvin and Gagne 2009

Types of System Calls


Process control File management Device management

Information maintenance
Communications Protection

Operating System Concepts 8th Edition

2.13

Silberschatz, Galvin and Gagne 2009

Examples of Windows and Unix System Calls

Operating System Concepts 8th Edition

2.14

Silberschatz, Galvin and Gagne 2009

MS-DOS execution

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

Operating System Concepts 8th Edition

2.15

Silberschatz, Galvin and Gagne 2009

FreeBSD Running Multiple Programs

Operating System Concepts 8th Edition

2.16

Silberschatz, Galvin and Gagne 2009

MS-DOS Layer Structure

Operating System Concepts 8th Edition

2.17

Silberschatz, Galvin and Gagne 2009

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

Operating System Concepts 8th Edition

2.18

Silberschatz, Galvin and Gagne 2009

Traditional UNIX System Structure

Operating System Concepts 8th Edition

2.19

Silberschatz, Galvin and Gagne 2009

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

Operating System Concepts 8th Edition

2.20

Silberschatz, Galvin and Gagne 2009

Layered Operating System

Inner circle Is more protected Than outer circle

Operating System Concepts 8th Edition

2.21

Silberschatz, Galvin and Gagne 2009

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 Performance overhead of user space to kernel space communication

Detriments:

Operating System Concepts 8th Edition

2.22

Silberschatz, Galvin and Gagne 2009

Why do we need Virtual Machine?

http://www.youtube.com/watch?v=V 9AiN7oJaIM&feature=related

Operating System Concepts 8th Edition

2.23

Silberschatz, Galvin and Gagne 2009

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

Operating System Concepts 8th Edition

2.24

Silberschatz, Galvin and Gagne 2009

Virtual Machines (Cont)

Non-virtual Machine

Virtual Machine

(a) Nonvirtual machine (b) virtual machine

Operating System Concepts 8th Edition

2.25

Silberschatz, Galvin and Gagne 2009

Linux : CLI (COMMAND LINE INTERFACE)


26

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.

cd dir1

Change directory to dir1 Change directory to root dir Change Directory to home dir Change Directory to home dir Rename file1 to file2 Remove file file2

cd /

cd

cd ~

mv file1 file2

rm -f file2

rm I file2
Remove file in an interactive mode

Operating System Concepts 8th Edition

2.26

Silberschatz, Galvin and Gagne 2009

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

Operating System Concepts 8th Edition

2.27

Silberschatz, Galvin and Gagne 2009

End of Chapter 2

Operating System Concepts 8th Edition,

Silberschatz, Galvin and Gagne 2009

Das könnte Ihnen auch gefallen