Operating Systems Lecture 3. 11 November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Computer-System Structures Er.Harsimran Singh
Chap 2 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.
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
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.
ICS Principles of Operating Systems
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
OS Spring’03 Introduction Operating Systems Spring 2003.
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
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.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Chapter 2: Computer-System Structures
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.
Operating System Concepts Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
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.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
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
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2 Computer-System Structures n Computer System Operation n I/O Structure.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
2: Computer-System Structures
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
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.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Processes Introduction to Operating Systems: Module 3.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
BIT213,CISY Operating Systems 1
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
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.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
Computer System Structures
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Protection of System Resources
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
Operating Systems Lecture 2.
Basic Concepts Protection: Security:
Operating Systems Lecture 3.
Introduction to Operating Systems
Module 2: Computer-System Structures
System calls….. C-program->POSIX call
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Presentation transcript:

Operating Systems Lecture 3

11 November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory, and CPU) protection Operating system components and services System calls Operating system structures Operating system design and implementation Recap of the lecture

11 November 2015© Copyright Virtual University of Pakistan 3 Hardware Protection  Dual-Mode Operation  I/O Protection  Memory Protection  CPU Protection

11 November 2015© Copyright Virtual University of Pakistan 4 I/O Protection  All I/O instructions are privileged instructions.  Must ensure that a user program could never gain control of the computer in monitor mode (i.e., a user program that, as part of its execution, stores a new address in the interrupt vector).

11 November 2015© Copyright Virtual University of Pakistan 5 Use of A System Call to Perform I/O

11 November 2015© Copyright Virtual University of Pakistan 6 Memory Protection  Must provide memory protection outside the address space of a process.  In order to have memory protection, add two registers that determine the range of legal addresses a program may access:  Base register – holds the smallest legal physical memory address.  Limit register – contains the size of the range  Memory outside the defined range is protected.

11 November 2015© Copyright Virtual University of Pakistan 7 Use of Base and Limit Register

11 November 2015© Copyright Virtual University of Pakistan 8 Hardware Support

11 November 2015© Copyright Virtual University of Pakistan 9 CPU Protection  Timer – interrupts computer after specified period to ensure operating system maintains control.  Timer is decremented every clock tick.  When timer reaches the value 0, an interrupt occurs.  Timer commonly used to implement time sharing.  Time also used to compute the current time.  Load-timer is a privileged instruction.

11 November 2015© Copyright Virtual University of Pakistan 10 OS Components Process management Main memory management Secondary storage management I/O system management File management Protection system Networking Command-line interpreter (shells)

Operating System Services Services for user and users of programs:  Program execution  I/O Operations  File System Manipulation  Communications between processes/users  Error detection and handling

Operating System Services … Services for efficient system operation:  Resource management  Accounting  Protection

OS Kernel Real work is done in the kernel Users Applications Operating System API, AUI Operating System Kernel Computer Hardware

Entry Points into Kernel System CallSignal InterruptTrap

System Calls  User processes must not be given open access to the kernel code  The system call interface layer contains entry point in the kernel code  Any user or application request that involves access to any system resource must be handled by the kernel code

Types Of System Calls  Process Control  File Management  Device Management  Information maintenance  Communications

System Call Execution  The user program makes a call to a library function.  Library routine puts appropriate parameters at a well-known place (registers, stack, or a table in memory).  The trap instruction is executed to change mode from user to kernel.  Control goes to operating system.  Operating system determines which system call is to be carried out.

Semantics of System Call Execution …  Kernel indexes the dispatch table, which contains pointers to service routines for system calls.  Service routine is executed and return parameter or error code placed at well- known places (usually a CPU register).  Control given back to user program.  Library function executes the instruction following trap.

System Call … Library Call System Call trap Dispatch Table Process Service Code Kernel Code

Operating System Structures  Simple Structure  Layered Approach  Microkernels  Virtual Machines

Simple Structures MS-DOS : written to provide the most functionality in the least space, so it was not divided into modules carefully

Simple Structures …  UNIX consists of two separable parts, the kernel and the system programs.  Every thing below the system call interface and above the physical hardware is the kernel.  An enormous amount of functionality combined in one level, UNIX is difficult to enhance as changes in one section could adversely affect other areas.

UNIX System Structure

11 November 2015© Copyright Virtual University of Pakistan 24 Recap of lecture Review of previous lecture Operating system components Operating system services System calls Operating system structures Recap of the lecture

11 November 2015© Copyright Virtual University of Pakistan 25 Operating Systems Lecture 3