operating system concepts 8 th edition
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 PresentationTRANSCRIPT
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
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
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
Command Interpreter Graphical User Interfaces
23/4/20 - Ch.2 System Structures - 5
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
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
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
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
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
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
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
Design GoalsMechanisms and PoliciesImplementation
23/4/20 - Ch.2 System Structures - 13
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
Layered Approach
23/4/20 - Ch.2 System Structures - 15
Fig. 2.6 A layered operating system
layer Nuser interface
layer 1
layer 0hardware
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
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
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
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