Operating System Concepts 8 Edition th Contents l

  • Slides: 19
Download presentation
Operating System Concepts 8 Edition th

Operating System Concepts 8 Edition th

Contents l l l 2. 1 Operating-System Services 2. 2 User Operating-System Interface 2.

Contents l l l 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 2020/12/5 - Ch. 2 System Structures - 2

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

Objectives To describe the services an operating system provides to users, processes, and other systems. l To discuss the various ways of structuring an operating system. l To explain how operating systems are installed and customized and how they boot. l 2020/12/5 - Ch. 2 System Structures - 3

2. 1 Operating-System Services user and other system programs GUI batch command line user

2. 1 Operating-System Services user and other system programs GUI batch command line user interface system calls program execution I/O operations error detection file systems communic ation services resource allocation accounting protection & security operating system hardware Fig. 2. 1 A view of operating system services 2020/12/5 - Ch. 2 System Structures - 4

2. 2 User Operating-System Interface Command Interpreter l Graphical User Interfaces l 2020/12/5 -

2. 2 User Operating-System Interface Command Interpreter l Graphical User Interfaces l 2020/12/5 - Ch. 2 System Structures - 5

2. 3 System Calls Example System Call Sequence Acquire input file name Write prompt

2. 3 System Calls Example System Call Sequence Acquire input file name Write prompt to screen Accept input Acquire output file name Write prompt to screen Accept input Open the input file if file doesn't exits, abort Create out file if file exits, abort Loop Read from input file Write to output file Until read fails Close output file Write completion message to screen Terminate normally 2020/12/5 source file Fig. 2. 2 Example of how system calls are used destination file - Ch. 2 System Structures - 6

2. 3 System Calls l API(Application Programming Interface) - Win 32 API, POSIX API,

2. 3 System Calls l API(Application Programming Interface) - Win 32 API, POSIX API, and Java API return value BOOL Read. File c (HANDLE LPVOID DWORD LPDWORD function name LPOVERLAPPED file, buffer, bytes To Read, parameters bytes Read, ovl); Fig. 2. 3 The API for the Read. File() function 2020/12/5 - Ch. 2 System Structures - 7

2. 3 System Calls l System-call interface user application user mode kernel mode open()

2. 3 System Calls l System-call interface user application user mode kernel mode open() system call interface. . . i. . open() Implementation of open() system call … … return Fig. 2. 4 The handling of a user application invoking the open() system call 2020/12/5 - Ch. 2 System Structures - 8

2. 4 Types of System Calls Process Control File Manipulation Device Manipulation Information Maintenance

2. 4 Types of System Calls Process Control File Manipulation Device Manipulation Information Maintenance Communication Protection 2020/12/5 Windows Unix Create. Process() fork() Exit. Process() exit() Wait. For. Single. Object() wait() Create. File() open() Read. File() read() Write. File() write() Close. Handle() close() Set. Console. Mode() ioctl() Read. Console() read() Write. Console() write() Get. Current. Process. ID() getpid() Set. Timer() alarm() Sleep() sleep() Create. Pipe() pipe() Create. File. Mapping() shmget() Map. View. Of. File() mmap() Set. File. Security() chmod() Initlialize. Security. Descriptor() umask() Set. Security. Descriptor. Group() chown() - Ch. 2 System Structures - 9

2. 5 System Programs l File management -create, delete, copy, rename, print, dump, list,

2. 5 System Programs l File management -create, delete, copy, rename, print, dump, list, and generally manipulate files and directories l Status information -ask data, time, memory, disk, and user and such information l File modification -create, modify and search the contents of the files 2020/12/5 - Ch. 2 System Structures - 10

2. 5 System Programs l File management -create, delete, copy, rename, print, dump, list,

2. 5 System Programs l File management -create, delete, copy, rename, print, dump, list, and generally manipulate files and directories l Status information -ask data, time, memory, disk, and user and such information l File modification -create, modify and search the contents of the files 2020/12/5 - Ch. 2 System Structures - 11

2. 5 System Programs l Programming-language support -compilers, assemblers, debuggers and interpreters l Program

2. 5 System Programs l Programming-language support -compilers, assemblers, debuggers and interpreters l Program loading and execution -absolute loaders, relocatable loaders, linkage editors and overlay loaders l Communications -create virtual connections among processes, users, and computer systems. 2020/12/5 - Ch. 2 System Structures - 12

2. 6 Operating-System Design and Implementation l Design Goals l Mechanisms and Policies l

2. 6 Operating-System Design and Implementation l Design Goals l Mechanisms and Policies l Implementation 2020/12/5 - Ch. 2 System Structures - 13

2. 7 Operating-System Structure l Simple Structure Application program Resident system program MS-DOS device

2. 7 Operating-System Structure l Simple Structure Application program Resident system program MS-DOS device drivers Application program Fig. 2. 5 MS-DOS layer structure 2020/12/5 - Ch. 2 System Structures - 14

2. 7 Operating-System Structure l Layered Approach layer N user interface layer 1 layer

2. 7 Operating-System Structure l Layered Approach layer N user interface layer 1 layer 0 hardware Fig. 2. 6 A layered operating system 2020/12/5 - Ch. 2 System Structures - 15

2. 7 Operating-System Structure l Microkernels -Mach: remove all nonessential components from the kernel

2. 7 Operating-System Structure l 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 2020/12/5 - Ch. 2 System Structures - 16

2. 7 Operating-System Structure l Modules device and bus drivers miscellaneous modules scheduling classes

2. 7 Operating-System Structure l Modules device and bus drivers miscellaneous modules scheduling classes file systems Core Solaris kernel STREAMS modules loadable system call executable formats Fig. 2. 7 Solaris loadable modules 2020/12/5 - Ch. 2 System Structures - 17

2. 10 Operating-System Generation l An operating system is designed to run on any

2. 10 Operating-System Generation l 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. l SYSGEN(system generation) -reads from a given file, or ask for information. 2020/12/5 - Ch. 2 System Structures - 18

2. 11 System Boot l Bootstrap program/loader -a small piece of code which locates

2. 11 System Boot l Bootstrap program/loader -a small piece of code which locates the kernel and loads it into main memory, and starts its execution. 1. Powered up 2. IR load a predefined location 3. Bootstrap perform a variety of tasks(diagnostics) 4. Start the operating system 2020/12/5 - Ch. 2 System Structures - 19