Upload
ahmad-shdifat
View
220
Download
0
Embed Size (px)
Citation preview
8/2/2019 Operating Systems -ch3-F06
1/26
Chapter 3 Operating Systems 1
Chapter 3: Operating-System Structures
This Chapter covers:1. System Components2. Operating System Services3. System Calls4. System Programs5. System Structure6. Virtual Machines
7. System Design and Implementation8. System Generation
8/2/2019 Operating Systems -ch3-F06
2/26
Chapter 3 Operating Systems 2
1. Common System Components
Process ManagementMain Memory ManagementFile ManagementI/O System ManagementSecondary ManagementNetworkingProtection System
Command-Interpreter System
8/2/2019 Operating Systems -ch3-F06
3/26
Chapter 3 Operating Systems 3
2-Command-Interpreter System (The Shell)
Interface between users and OS.Many commands are given to the operatingsystem by control statements which deal with:
process creation and management
I/O handlingsecondary-storage managementmain-memory managementfile-system accessprotectionnetworking
8/2/2019 Operating Systems -ch3-F06
4/26
Chapter 3 Operating Systems 4
Command-Interpreter System (Cont.)
The program that reads andinterprets control statementsis called variously:
command-line interpretershell (in UNIX)MS-DOS prompt
Its function is to get andexecute the next command
statement.
OS
System Calls
Shell
Request or
ControlStatement
Sequenceof
User
8/2/2019 Operating Systems -ch3-F06
5/26
Chapter 3 Operating Systems 5
3. System Calls
System calls provide the interface between a runningprogram and the operating system.Generally available as assembly-languageinstructions.Languages defined to replace assembly language for
systems programming allow system calls to be madedirectly (e.g., C, C++)Three general methods are used to pass parametersbetween a running program and the operating system.
Pass parameters in registers .
Store the parameters in a table in memory , and thetable address is passed as a parameter in a register.Push (store) the parameters onto the stack by theprogram, and pop off the stack by operating system.
8/2/2019 Operating Systems -ch3-F06
6/26
Chapter 3 Operating Systems 6
Passing of Parameters As A Table
8/2/2019 Operating Systems -ch3-F06
7/26
Chapter 3 Operating Systems 7
Types of System Calls
Process controlFile managementDevice managementInformation maintenance
Communications
8/2/2019 Operating Systems -ch3-F06
8/26
Chapter 3 Operating Systems 8
Examples :MS-DOS and UNIX
At System Start-up Running a Program
8/2/2019 Operating Systems -ch3-F06
9/26
Chapter 3 Operating Systems 9
Process Communication Models
Message Passing Shared Memory
Communication may take place using eithermessage passing or shared memory .
8/2/2019 Operating Systems -ch3-F06
10/26
Chapter 3 Operating Systems 10
4. System Programs
System programs provide a convenientenvironment for program development andexecution. They can be divided into:
File manipulationStatus informationFile modificationProgramming language supportProgram loading and executionCommunicationsApplication programs
Most users view of the operation system isdefined by system programs, not the actualsystem calls.
8/2/2019 Operating Systems -ch3-F06
11/26
Chapter 3 Operating Systems 11
5. MS-DOS System Structure
MS-DOS written toprovide the mostfunctionality in the leastspace
not divided intomodulesAlthough MS-DOS hassome structure, itsinterfaces and levels of functionality are notwell separated
8/2/2019 Operating Systems -ch3-F06
12/26
Chapter 3 Operating Systems 12
UNIX System Structure
UNIX limited by hardware functionality,the original UNIX operating system hadlimited structuring. The UNIX OS consists of two separable parts.
Systems programsThe kernel
Consists of everything below thesystem-call interface and above thephysical hardware
Provides the file system, CPUscheduling, memory management, andother operating-system functions; alarge number of functions for onelevel.
8/2/2019 Operating Systems -ch3-F06
13/26
Chapter 3 Operating Systems 13
UNIX System Structure
8/2/2019 Operating Systems -ch3-F06
14/26
Chapter 3 Operating Systems 14
Layered Approach
The operating system is divided into a number of layers(levels), each built on top of lower layers. The bottomlayer (layer 0), is the hardware; the highest (layer N) isthe user interface.With modularity, layers are selected such that each usesfunctions (operations) and services of only lower-levellayers.
8/2/2019 Operating Systems -ch3-F06
15/26
Chapter 3 Operating Systems 15
OS/2 Layer Structure
8/2/2019 Operating Systems -ch3-F06
16/26
Chapter 3 Operating Systems 16
Microkernel System Structure
Moves as much from the kernel into user space.Communication takes place between usermodules using message passing.
Benefits:- easier to extend a microkernel- easier to port the operating system to newarchitectures
- more reliable (less code is running in kernelmode)- more secure
8/2/2019 Operating Systems -ch3-F06
17/26
Chapter 3 Operating Systems 17
Windows NT Client-Server Structure
8/2/2019 Operating Systems -ch3-F06
18/26
Chapter 3 Operating Systems 18
6. Virtual Machines
A virtual machine takes the layered approachto its logical conclusion. It treats hardwareand the operating system kernel as thoughthey were all hardware.
A virtual machine provides an interfaceidentical to the underlying bare hardware.The operating system creates the illusion of multiple processes, each executing on its ownprocessor with its own (virtual) memory.
8/2/2019 Operating Systems -ch3-F06
19/26
Chapter 3 Operating Systems 19
Virtual Machines (Cont.)
The resources of the physical computer areshared to create the virtual machines.CPU scheduling can create the appearancethat users have their own processor.
Spooling and a file system can providevirtual card readers and virtual line printers.A normal user time-sharing terminal servesas the virtual machine operators console.
8/2/2019 Operating Systems -ch3-F06
20/26
Chapter 3 Operating Systems 20
System Models
Non-virtual Machine Virtual Machine
8/2/2019 Operating Systems -ch3-F06
21/26
Chapter 3 Operating Systems 21
Advantages/Disadvantages of Virtual Machines
The virtual-machine concept provides completeprotection of system resources since each virtualmachine is isolated from all other virtualmachines. This isolation, however, permits nodirect sharing of resources.A virtual-machine system is a perfect vehicle foroperating-systems research and development.System development is done on the virtualmachine, instead of on a physical machine and
so does not disrupt normal system operation.The virtual machine concept is difficult toimplement due to the effort required to providean exact duplicate to the underlying machine.
8/2/2019 Operating Systems -ch3-F06
22/26
Chapter 3 Operating Systems 22
Java Virtual Machine
Compiled Java programs areplatform-neutral byte codesexecuted by a Java VirtualMachine (JVM).JVM consists of
- class loader- class verifier- runtime interpreterJust-In-Time (JIT) compilersincrease performance
8/2/2019 Operating Systems -ch3-F06
23/26
Chapter 3 Operating Systems 23
7. System Design Goals
User goals operating system should beconvenient to use, easy to learn, reliable, safe,and fast.System goals operating system should beeasy to design, implement, and maintain, aswell as flexible, reliable, error-free, andefficient.
8/2/2019 Operating Systems -ch3-F06
24/26
Chapter 3 Operating Systems 24
Mechanisms and Policies
Mechanisms determine how to do something,policies decide what will be done.The separation of policy from mechanism is avery important principle, it allows maximumflexibility if policy decisions are to be changedlater.
8/2/2019 Operating Systems -ch3-F06
25/26
Chapter 3 Operating Systems 25
System Implementation
Traditionally written in assembly language,operating systems can now be written inhigher-level languages.Code written in a high-level language:
can be written faster.is more compact.is easier to understand and debug.
An operating system is far easier to port (move
to some other hardware) if it is written in ahigh-level language.
8/2/2019 Operating Systems -ch3-F06
26/26
Chapter 3 Operating Systems 26
8. System Generation (SYSGEN)
Operating systems are designed to run on anyof a class of machines; the system must beconfigured for each specific computer site.SYSGEN program obtains informationconcerning the specific configuration of thehardware system.Booting starting a computer by loading thekernel.Bootstrap program code stored in ROM thatis able to locate the kernel, load it intomemory, and start its execution.