Operating System Concepts

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Operating System Structures
Chap 2 System Structures.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 2: Operating-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
1/26/2004CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
Os31 Chapter 3 Operating-System Structures. os32 Outlines System Components Operating System Services System Calls System Programs System Structure Virtual.
Silberschatz, Galvin and Gagne  Operating System Concepts Common OS Components Process Management Memory Management File Management I/O System.
Silberschatz, Galvin and Gagne  Operating System Concepts Common System Components Process Management Main Memory Management File Management.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: Operating-System Structures.
System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation.
Prof. Hsien-Hsin Sean Lee
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 3: Operating-System Structures System Components OS Services System.
Module 1.1: Operating-System Structures
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
3.1 Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
3.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 3: Operating-System Structures System Components Operating System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
2.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition System Programs (p73) System programs provide a convenient environment.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
23/06/ :54:20 CSC Alliance — 1 Kimera Richard Phone: INSTITUTE OF COMPUTER SCIENCE DEPARTMENT.
System Components Operating System Services System Calls.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Chapter three 3.1 Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs.
Module 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Chapter 3: Operating-System Structures
Chapter 3: Operating-System Structures
Introduction to Operating Systems Concepts
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Module 3: Operating-System Structures
Operating System Structures
Operating System Structure
Chapter 2: Operating-System Structures
Ch 2 - Overview Interacting with services provided by the OS
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Chapter 1 Introduction to Operating System Part 5
Basic Concepts Protection: Security:
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Outline Chapter 2 (cont) OS Design OS structure
Chapter 2: Operating-System Structures
System calls….. C-program->POSIX call
Chapter 2: Operating-System Structures
Operating Systems Structure
III. Operating System Structures
Presentation transcript:

Operating System Concepts Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University

Chapter 3 Operating System Structures An operating system can be viewed from several vantage points. Services Interfaces to users and programmers Components and their interconnections Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1 System Components Common system components Process Management Main Memory Management File Management I/O System Management Secondary Management Networking Protection System Command-Interpreter System Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.1 Process Management A process A program in execution Resources CPU time Memory Files I/O devices Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Process v.s. Program A program by itself is not a process. A program is a passive entity Contents of a file stored on disk A process is an active entity A program counter specifies the next instruction to execute A program spawns many processes as it runs. Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Process Management A computer Consists of a collection of processes Operating-system processes User processes Be executed concurrently, by multiplexing the CPU among them. OS is responsible for Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling (Chapters 4 through 7) Ku-Yaw Chang Chapter 3 Operating-System Structures

3.1.2 Main-Memory Management a large array of words or bytes, each with its own address. a repository of quickly accessible data shared by the CPU and I/O devices. a volatile storage device OS is responsible for Keeping track of which parts of memory are currently being used and by whom Deciding which processes are to be loaded into memory when memory space becomes available Allocating and deallocating memory space as needed (Chapters 9 and 10) Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.3 File Management Physical Media Magnetic tape Magnetic disk Optical disk OS provides a uniform logical view of information storage – the file Map files onto physical media Access files via storage devices A file a collection of related information defined by its creator represent programs (both source and object forms) and data Directory (or folder) Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.3 File Management OS is responsible for Creating and deleting files Creating and deleting directories Supporting primitives for manipulating files and directories Mapping files onto secondary storage Backing up files on stable (nonvolatile) storage media (Chapters 11 and 12) Ku-Yaw Chang Chapter 3 Operating-System Structures

3.1.4 I/O-System Management The peculiarities of I/O devices are hidden from the bulk of the operating system itself by the I/O subsystem. A memory-management component that includes buffering, caching, and spooling A general device-driver interface Drivers for specific hardware devices (Chapter 13) Ku-Yaw Chang Chapter 3 Operating-System Structures

3.1.5 Secondary-Storage Management Primary storage Main memory Secondary storage Disks Principal on-line storage medium Source and destination of processing OS is responsible for Free-space management Storage allocation Disk scheduling (Chapter 14) Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.6 Networking A distributed system is a collection processors that do not share memory or a clock. Each processor has its own local memory. The processors in the system are connected through a communication network. Communication takes place using a protocol. A distributed system provides user access to various system resources. Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.6 Networking Access to a shared resource allows Computation speedup Increased functionality Increased data availability Enhanced reliability OSs usually generalize network access as a form of file access Details are contained in the network interface’s device driver (Chapters 15 through 17) Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.1.7 Protection System Protection a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must distinguish between authorized and unauthorized usage specify the controls to be imposed provide a means of enforcement (Chapter 18) Ku-Yaw Chang Chapter 3 Operating-System Structures

3.1.8 Command-Interpreter System Interface between the user and the OS Included in the kernel or as a special program Control statements Commands given to the OS Shell Also called control-card interpreter, or the command-line interpreter To get the next command statement and execute it Ku-Yaw Chang Chapter 3 Operating-System Structures

3.1.8 Command-Interpreter System Command statements process creation and management I/O handling secondary-storage management main-memory management file-system access protection networking Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

3.2 Operating-System Services Common services Program execution to load a program into memory and to run it. I/O operations user programs cannot execute I/O operations directly File-system manipulation capability to read, write, create, and delete files. Communications exchange of information between processes Implemented via shared memory or message passing. Error detection ensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs. Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Additional Functions Not for helping the user, but rather for ensuring efficient system operations. Resource allocation allocate resources to multiple users or multiple jobs running at the same time Accounting keep track of and record which users use how much and what kinds of computer resources for account billing or for accumulating usage statistics Protection ensure that all access to system resources is controlled Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.3 System Calls System calls The interface between a process and the OS Assembly-language Higher-level language C, C++ and Perl Modern Microsoft Windows platforms Win32 API (application programmer interface) Even simple programs may make heavy use of the operating system. To read data from one file and to copy them to another file Requiring a sequence of system calls Details are hidden from the programmer Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.3 System Calls Pass parameters to the OS In registers Parameters may be more than registers In a block or table in memory The address is passed as a parameter in a register Stack Push parameters onto the stack by the program Pop off the stack by operating system Ku-Yaw Chang Chapter 3 Operating-System Structures

Passing of parameters as a table Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.3 System Calls Five major categories Process control File management Device management Information maintenance Communications Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures MS-DOS At System Start-up Running a Program Ku-Yaw Chang Chapter 3 Operating-System Structures

UNIX running multiple programs Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.3.5 Communication Message Passing Shared Memory Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.4 System Programs System programs provide a convenient environment for program development and execution File management Status information File modification Programming language support Program loading and execution Communication System utilities or application programs To solve common problems, or perform common operations Web browsers and word processors Games Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.4 System Programs Command interpreter The most important system program Two approaches The command interpreter contains the code to execute the command. Implement most commands by system programs Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures To partition the task (OS) into small components (modules) Not one monolithic system Available approaches Simple structure Layered approach Microkernels Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.5.1 Simple Structure MS-DOS written to provide the most functionality in the least space not divided into modules Although having some structure, its interfaces and levels of functionality are not well separated Ku-Yaw Chang Chapter 3 Operating-System Structures

MS-DOS layer structure Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.5.1 Simple Structure UNIX Initially limited by hardware functionality consists of two separable parts The kernel Everything below the system-call interface and above the physical hardware Systems programs Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Unix System Structure Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.5.2 Layered Approach OS is broken into a number of layers (or levels) Each built on top of lower layers The bottom layer (layer 0) is the hardware The highest layer (layer N) is the user interface With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers. Simplify debugging and system verification Difficult to define each layer Less efficient – overhead Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures An OS layer Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures OS/2 layer structure Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Windows NT First release A highly layer-oriented organization Low performance (compared to Windows 95) NT 4.0 Move layers from user space to kernel space Closely integration Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.5.3 Microkernels Unix Kernel became large and difficult to manage Mach Developed at Carnegie Mellon University in the mid-1980s Use the microkernel approach Removing non-essential components from the kernel Implement them as system- and user-level programs A smaller kernel Main function To provide a communication facility Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.5.3 Microkernels Benefits easier to extend easier to port to new architectures more reliable (less code is running in kernel mode) more secure Examples Tru64 UNIX – UNIX + Mach kernel MacOS X – based on Mach kernel QNX – a real-time OS Windows NT ( a hybrid structure) Ku-Yaw Chang Chapter 3 Operating-System Structures

Windows NT client-server structure Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6 Virtual Machines A computer system is made up of layers Hardware is the lowest Virtual machines take the layered approach to its logical conclusion treat hardware and the operating system kernel as though they were all hardware provide an interface identical to the underlying bare hardware. The OS creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory. Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Models Non-virtual Machine Virtual Machine Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6.1 Implementation Difficult to implement To provide an exact duplicate of the underlying machine User mode Monitor mode Time – the major difference I/O Less time or more time CPU Multiprogrammed among many virtual machines Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6.2 Benefits Provide complete protection of system resources Each virtual machine is isolated from all other virtual machines. Permits no direct sharing of resources. A perfect vehicle for operating-systems research and development System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation. Solve system compatibility problems Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6.3 Java A very popular object-oriented language By Sun Microsystems in late 1995 Consists of A language specification A large API library A specification for a Java virtual machine(JVM) A class loader A class verifier A Java interpreter Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6.3 Java A Java program consists of one or more classes. For each class, the Java compiler produce an architecture-neutral bytecode output (.class) file Run on any implementation of the JVM Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Java virtual machine Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.6.3 Java Garbage collection Reclaim memory from objects no longer in use and return it to the system Just-in-time (JIT) compiler Turn the architecture-neutral bytecodes to native machine language for the host computer Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

3.7 System Design and Implementation A discussion about problems when designing and implementing an operating system Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.7.1 Design Goals User goals should be convenient to use, easy to learn, reliable, safe, and fast. System goals should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient. Ku-Yaw Chang Chapter 3 Operating-System Structures

3.7.2 Mechanisms and Policies General software engineering principles are applicable to operating systems. Separation of policy from mechanism For flexibility Mechanisms How to do something A general mechanism Policies What will be done Change across places or over time Ku-Yaw Chang Chapter 3 Operating-System Structures

3.7.2 Mechanisms and Policies Microkernel Take the separation of mechanism and policy to one extreme Apple Macintosh Both mechanism and policy are encoded in the system Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.7.3 Implementation Traditionally written in assembly language, operating systems can now be written in higher-level languages. Code written in a high-level language: can be written faster. is more compact. is easier to understand and debug. is easier to port (move to some other hardware) Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.8 System Generation Operating systems are designed to run on any of a class of machines. must be configured for each specific computer site. System generation (SYSGEN) obtain information concerning the specific configuration of the hardware system. From a given file Ask the operator Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures 3.8 System Generation Booting starting a computer by loading the kernel. Bootstrap program (bootstrap loader) code stored in ROM that is able to locate the kernel, load it into memory, and start its execution. Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Summary P.89 – P.90 Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures System Components Operating-System Services System Calls System Programs System Structures Virtual Machines System Design and Implementation System Generation Summary Exercises Ku-Yaw Chang Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Exercises 3.5 3.12 3.13 3.14 3.15 Ku-Yaw Chang Chapter 3 Operating-System Structures

The End