W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System.

Slides:



Advertisements
Similar presentations
Operating-System Structures
Advertisements

Interactive lesson about operating system
Operating System Structures
Chap 2 System Structures.
Operating System Structure
Operating-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
Computer-System Structures
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
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.
2.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 2: Computer-System Structures Computer System Operation I/O Structure.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: Computer-System Structures
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
2: Computer-System Structures
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do (previous.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
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.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
OPERATING SYSTEMS Lecture 3: we will explore the role of the operating system in a computer Networks and Communication Department 1.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
Chapter 2: Computer-System Structures(Hardware) or Architecture or Organization Computer System Operation I/O Structure Storage Structure Storage Hierarchy.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
Module 3: Operating-System Structures
Chapter 2: Computer-System Structures(Hardware)
Applied Operating System Concepts
Chapter 2: Computer-System Structures
2. OPERATING SYSTEM 2.1 Operating System Function
Chapter 2: Operating-System Structures
Chapter 1: Introduction
Chapter 2: System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: System Structures
Computer-System Architecture
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Module 2: Computer-System Structures
Presentation transcript:

W EEK T HREE O PERATING S YSTEM S TRUCTURE

T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System Calls Types of System Calls System Programs Operating System Design and Implementation Operating System Structure System Calls Virtual Machines Operating System Debugging Operating System Generation System Boot

O BJECTIVES To understand different components of an operating system To describe services an operating system provides to users, processes and other systems To discuss various ways of structuring an operating system To explain how operating systems are installed, customized and how they boot

D IFFERENT C OMPONENTS OF AN O PERATING S YSTEM Process Management Main-Memory Management File Management I/O System Management Secondary-Storage Management Networking Protection System Command-Interpreter System

O PERATING S YSTEM C OMPONENTS Processes Management Process can be thought as program in execution A program by itself is not a process, it is a passive entry e.g. contents of a file stored on a disk A process is an active entity, with a program counter that specifies which instruction to execute next CPU executes one instruction at a given time, even two processes may be associated with one program but at no time they should be considered as two separate executable sequences Execution is a sequential A process requires certain resources such as CPU time, memory, files, I/O Resources can be given at the time of creation or allocated when it is running A process is a unit of work in a system. Thus a system is a collection of processes, some of which are operating-system processes ( those which execute system code) and the rest are user processes (those that execute user code)

P ROCESS M ANAGEMENT Operating system is responsible for the following activities with respect to process management Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronizations Mechanisms for process communication Mechanisms for deadlock handling

M AIN - MEMORY M ANAGEMENT Main memory is a storage area of quickly accessible data by the CPU and I/O devices The CPU reads instructions form main memory in instruction-fetch style, and it both reads and writes data from main memory during the data-fetch style For a program to execute, it must be mapped to absolute addresses and loaded into memory. As the program executes, it accesses program instructions and addresses from memory by these addresses. When a program terminates, its memory space is declared available and the next program can be loaded and executed. In order to increase CPU utilization and better user response,, we must keep several programs in memory. There are different techniques for better memory-management such as hardware design of the system o The operating system is responsible for the following activities with regards to main-memory management o Keeping track of which parts of memory are being used and by whom o Deciding which processes are to be loaded into memory when it becomes available o Allocating and deallocating memory space as needed

F ILE M ANAGEMENT The most visible part of an operating system As we discussed, several types of media available for storing files depending upon: access speed, data- transfer-rate, capacity, access methods (sequential or random) Operating system creates an abstract logical view of the data stored on physical media With regards to file management, the operating system is responsible for following activities: Creating and deleting files Creating and deleting directories (folders) Provides support for manipulating files and directories Mapping files onto to physical media Backing up files on stable (non volatile) media

I/O S YSTEM M ANAGEMENT One of the purpose of an operating system is to hide the peculiarities of I/O from user The I/O subsystems help us to achieve that. Common subsystems are A memory-management component that includes buffering, caching and spooling A General device driver interface Drivers for specific hardware devices Only the device driver knows all peculiarities about a particular hardware

S ECONDARY S TORAGE M ANAGEMENT Proper management of the disk storage is of central important to working of a computer system. Operating system is responsible for the following activities: Free space management Storage allocation Disk scheduling Disk storage must be handled efficiently

N ETWORKING A distributed system is a collection of processors that don’t share memory, peripheral devices or clock. Many processors are connected together with communication networks. The communication network design must consider: message routing, connection strategies and other problems relating to connectivity and security Networks provide access to shared resources. Access to a shared resource allows computation speedup, increased functionality, increased data availability, enhanced reliability and low costs Operating system usually generalize network access as a form of file access, with the details of networking being connected in the network interface’s device driver

P ROTECTION S YSTEM In an environment where multi-user and concurrent execution of processes is permitted, it is quite obvious that various processes must be protected from one another’s activities Mechanisms need to ensure that files, memory segments, CPU and other sources cane only be operated by only those processes which are authorized by an operating system Protection is a mechanism to control that access of programs, processes or users to the resources by a defined computer system An un-protected resource cannot defend against use or misuse by an unauthorized or incompetent user

C OMMAND -I NTERPRETER S YSTEMS An interface between a user and the operating system Many commands to the operating system are given by control statements A program that reads and interprets these commands is called command-line interpreter and is often known as shell

U SER I NTERFACE Operating system provides as environment for execution of programs and services to programs and users One set of operating-system provides functions which are helpful to users: User Interface – Almost all operating systems have user interface (UI) Varies between command line (CLI), Graphics User Interface (GUI), Batch Program Execution – The system must be able to load program into memory and to run that program, end execution i.e. either normally or abnormally (indicating error) I/O Operations – A running program may require an I/O which may involve a file or I/O device File –system Manipulation – The file system is of particular interest. Programs needs to read and write files and directories, create and delete them, search them, list file information, protect them

U SER O PERATING S YSTEM I NTERFACE - GUI User-friendly desktop metaphor interface Usually, mouse, keyboard and monitor Icons represents files, programs and actions Various mouse buttons over objects in the interface cause different actions (provide information, options, executes function, open directory also known as folder) Invented at Xerox PARC Many systems now both include CLI and GUI Microsoft Windows is GUI with CLI “command” shell Apple Mac OS X as “Aqua” GUI interface with Unix kernel underneath and shells available Solaris is CLI with optional GUI (Java Desktop, KDE)

U SER O PERATING S YSTEM I NTERFACE - CLI Command Line Interface (CLI) of Command Interpreter allows direct command entry Sometimes implemented in kernel, sometimes by system program Sometimes multiple flavors implemented – shells Primarily fetches a command from user and executes it Sometimes commands built-in, sometimes just names of programs If the later, adding new features does not require shell modification

O PERATING S YSTEM What is an operating system? And what are its goals?

OPERATING SYSTEM Controller for the execution of programs with efficient utilization of resources for timely services to the users A concept of kernel and application programs An intermediary program between a user of a computer and the computer hardware Uses the computer hardware efficiently

OPERATING SYSTEM GOALS Execute user programs and solve user problems easily through proper coordination and synchronization Make the computer system convenient to use Efficient operation of the computer system components Optimal use of computer resources Ability to evolve through hardware upgrades, new services and fixing of problems

T WO V IEWS OF O PERATING S YSTEM User View – Varies from system being used System View Resource Allocator CPU Time Memory Space File storage space I/O Devices Controls Programs Executes user programs Prevents errors and improper use Responsible for operations and control of I/O devices

T HE E VOLUTION OF O PERATING S YSTEM Serial Processing Simple batch systems Multi-programmed batch systems Time-sharing systems Personal computer systems Parallel systems Distributed systems Real-time systems

C OMPUTER -S YSTEM O PERATIONS A modern computer consists of a CPU, memory, system bus and a number of device controllers I/O Devices and the system can execute concurrently Each device controller is in charge of a particular device type A device controller for each device which contains local buffer storage and a special purpose registers A bootstrap program is required to initialize the computer system CPU moves data from/to main memory to/from local buffers I/O is from the device to local buffer of controller Device controller informs CPU that it has finished its operation by causing an interrupt

C OMPUTER -S YSTEM A RCHITECTURE

I NTERRUPTS What are interrupts?

C OMMON F UNCTIONS OF I NTERRUPTS The occurrence of an event is usually signaled by an interrupt either the hardware or software System call or monitor call is executed to trigger an interrupt Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines Interrupt architecture must save the address of the interrupted instruction Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt A trap is a software-generated interrupt caused either by an error or a user request An operating system is interrupt driven and priority interrupts have been introduced in modern systems

I NTERRUPT H ANDLING When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fix location to execute the interrupt the routine through a table of pointers which is stored in LMA (Low Memory Address) On completion of execution of service routine, the CPU resumes the interrupted computation LMA locations hold the addresses of the interrupt service routines (Interrupt Vector i.e. Memory Address of an Interrupt handler) for the various devices Separate segments of code determine what action should be taken for each type of interrupt The operating system preserves the state of the CPU by storing registers and the program counter Determines which type of interrupt has occurred: Polling Vectored interrupt systems Interrupts are important part of a modern computer system and should be handled immediately System call is a method used by a process to request action by the operating system

S TORAGE S TRUCTURE Registers Cache Main Memory Electronic Disk Magnetic Disk Optical Disk Hard Disk Magnetic Tape

H ARDWARE P ROTECTION Dual-Mode Operation I/O Protection Memory Protection CPU Protection

C OMPUTER N ETWORKS LAN WAN