operating system concepts 8 th edition

19

Upload: giulia

Post on 05-Jan-2016

58 views

Category:

Documents


0 download

DESCRIPTION

Operating System Concepts 8 th Edition. Chapter 2. System Structures Gan Lin, OSLab . GNU. Contents. 2.1 Operating-System Services 2.2 User Operating-System Interface 2.3 System Calls 2.4 Types of System Calls 2.5 System Programs 2.6 Operating-System Design and Implementation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Operating System Concepts  8 th  Edition
Page 2: Operating System Concepts  8 th  Edition

2.1 Operating-System Services 2.2 User Operating-System Interface 2.3 System Calls 2.4 Types of System Calls 2.5 System Programs 2.6 Operating-System Design and Implementation 2.7 Operating-System Structure 2.8 Virtual Machines 2.9 Operating-System Debugging 2.10 Operating-System Generation 2.11 System Boot 2.12 Summary

23/4/20 - Ch.2 System Structures - 2

Page 3: Operating System Concepts  8 th  Edition

To describe the services an operating system provides to users, processes, and other systems.

To discuss the various ways of structuring an operating system.

To explain how operating systems are installed and customized and how they boot.

23/4/20 - Ch.2 System Structures - 3

Page 4: Operating System Concepts  8 th  Edition

Fig. 2.1 A view of operating system services

23/4/20 - Ch.2 System Structures - 4

user and other system programs

user interface

GUI batch command line

system calls

hardware

operating system

program execution

I/O operations

filesystems

communication

resource allocation

accounting

error detection

protection & securityservices

Page 5: Operating System Concepts  8 th  Edition

Command Interpreter Graphical User Interfaces

23/4/20 - Ch.2 System Structures - 5

Page 6: Operating System Concepts  8 th  Edition

Fig. 2.2 Example of how

system calls are used

23/4/20 - Ch.2 System Structures - 6

Example System Call SequenceAcquire input file name Write prompt to screen Accept inputAcquire output file name Write prompt to screen Accept inputOpen the input file if file doesn't exits, abortCreate out file if file exits, abortLoop Read from input file Write to output fileUntil read failsClose output fileWrite completion message to screenTerminate normally

source file

destination file

Page 7: Operating System Concepts  8 th  Edition

23/4/20 - Ch.2 System Structures - 7

API(Application Programming Interface)

- Win32 API, POSIX API, and Java API

BOOL ReadFile c (HANDLE file, LPVOID buffer, DWORD bytes To Read, LPDWORD bytes Read, LPOVERLAPPED ovl);

return value

function name

parameters

Fig. 2.3 The API for the ReadFile() function

Page 8: Operating System Concepts  8 th  Edition

23/4/20 - Ch.2 System Structures - 8

System-call interface

user application

system call interface

user mode

kernel mode .

.

.

.

.

i

open()

Implementation of open() system call … … return

open()

Fig.2.4 The handling of a user application invoking the open() system call

Page 9: Operating System Concepts  8 th  Edition

Windows Unix

Process Control CreateProcess() fork()

ExitProcess() exit()

WaitForSingleObject() wait()

File Manipulation CreateFile() open()

ReadFile() read()

WriteFile() write()

CloseHandle() close()

Device Manipulation SetConsoleMode() ioctl()

ReadConsole() read()

WriteConsole() write()

Information Maintenance GetCurrentProcessID() getpid()

SetTimer() alarm()

Sleep() sleep()

Communication CreatePipe() pipe()

CreateFileMapping() shmget()

MapViewOfFile() mmap()

Protection SetFileSecurity() chmod()

InitlializeSecurityDescriptor() umask()

SetSecurityDescriptorGroup() chown()

23/4/20 - Ch.2 System Structures - 9

Page 10: Operating System Concepts  8 th  Edition

File management-create, delete, copy, rename, print, dump, list, and generally manipulate files and directories

Status information-ask data, time, memory, disk, and user and such information

File modification-create, modify and search the contents of the files

23/4/20 - Ch.2 System Structures - 10

Page 11: Operating System Concepts  8 th  Edition

File management-create, delete, copy, rename, print, dump, list, and generally manipulate files and directories

Status information-ask data, time, memory, disk, and user and such information

File modification-create, modify and search the contents of the files

23/4/20 - Ch.2 System Structures - 11

Page 12: Operating System Concepts  8 th  Edition

Programming-language support-compilers, assemblers, debuggers and interpreters

Program loading and execution-absolute loaders, relocatable loaders, linkage editors and overlay loaders

Communications-create virtual connections among processes, users, and computer systems.

23/4/20 - Ch.2 System Structures - 12

Page 13: Operating System Concepts  8 th  Edition

Design GoalsMechanisms and PoliciesImplementation

23/4/20 - Ch.2 System Structures - 13

Page 14: Operating System Concepts  8 th  Edition

Simple Structure

23/4/20 - Ch.2 System Structures - 14

Application program

Resident system program

MS-DOS device drivers

Application program

Fig. 2.5 MS-DOS layer structure

Page 15: Operating System Concepts  8 th  Edition

Layered Approach

23/4/20 - Ch.2 System Structures - 15

Fig. 2.6 A layered operating system

layer Nuser interface

layer 1

layer 0hardware

Page 16: Operating System Concepts  8 th  Edition

Microkernels

-Mach: remove all nonessential components from the kernel and implement them as system and user-level programs.

-provide a communication facility between the client program and the various services that are also running in user space.

-easy to extend the operating system

23/4/20 - Ch.2 System Structures - 16

Page 17: Operating System Concepts  8 th  Edition

Modules

23/4/20 - Ch.2 System Structures - 17

Core Solaris kernel

scheduling classes

file systems

loadable system call

executable formats

STREAMS modules

miscellaneous modules

device and bus drivers

Fig. 2.7 Solaris loadable modules

Page 18: Operating System Concepts  8 th  Edition

An operating system is designed to run on any of a class of machines at a variety of sites with a variety of peripheral configurations.

SYSGEN(system generation)

-reads from a given file, or ask for information.

23/4/20 - Ch.2 System Structures - 18

Page 19: Operating System Concepts  8 th  Edition

Bootstrap program/loader-a small piece of code which locates the kernel and loads it into main memory, and starts its execution.

23/4/20 - Ch.2 System Structures - 19

1.Powered up2.IR load a predefined location3.Bootstrap perform a variety of tasks(diagnostics)4.Start the operating system