CSCE451/851 Introduction to Operating Systems https://piazza.com/unl/fall2016/csce451/home.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
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.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
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
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.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
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.
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.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
OPERATING SYSTEM CONCEPT AND PRACTISE
Operating Systems Lecture 2.
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Chapter 1: Introduction
Operating Systems (CS 340 D)
Input/Output.
Introduction to Operating System (OS)
Intro to Processes CSSE 332 Operating Systems
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 1: Introduction
Computer-System Architecture
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
Operating Systems Lecture 2.
Architectural Support for OS
Threads Chapter 4.
Operating Systems Lecture 3.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
Module 2: Computer-System Structures
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
Chapter 2 Operating System Overview
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
Operating Systems Structure
Chapter 13: I/O Systems.
Presentation transcript:

CSCE451/851 Introduction to Operating Systems

Chapter 1 -Introduction What is an operating system? Interface between application programs and hardware Basic purpose of an operating system? Provide services to application programs Control functioning of hardware From a user’s point of view Ease of use maximize work (or play) that user performs From a system’s point of view Resource allocator

Components of a Computer System user1user2user n applications editoriecalcapp x Operating System hardware

1.2 Computer System Organization Most (if not all) modern CPU design is based on interrupts The CPU has various lines thru which a signal can be sent (interrupt) Interrupts can originate from hardware, cpu(trap), software(system call) Interrupts are provided as a way to improve processor performance Hardware interrupts can happen very frequently and must be handled promptly and efficiently

Handling an Interrupt Interrupt vector – an array of pointers to interrupt service routines indexed by the interrupt number When the CPU is interrupted: CPU saves address of interrupted instruction Invokes interrupt service routine whose address is stored in the Interrupt vector After the interrupt is serviced, the saved instruction address (and state) is restored and CPU resumes

Program Flow of Control

I/O Structures (1.2.3) A large part of operating system code is dedicated to managing I/O Reliability Performance Various types of devices available I/O is achieved through synchronization between Operating system code called device drivers Device controllers which transfer data between hardware and internal buffers Interrupts which invoke the correct device drivers

Device Controller Interface Status Instruction Data Data Data n-1 Logic.. PrimaryMemory Cpu Dev. Ctrlr. Device busydone Error codes..

I/O Structures (Character I/O) Example of slow input device-keyboard DC loads data register and interrupts CPU CPU invokes DD - Interrupt Vector DD fetches data from DC data register and transfers data to memory location Example of serial output device-printer OS Invokes DD DD loads data/instruction register on DC DC interrupts CPU when its done DD checks status registers, raises error or loads next data/instruction on DC

I/O Structure – Block Devices Character I/O is not effective enough for bulk data movement, Disks etc. An alternative to character I/O is block I/O (DMA) O/S sets up registers (instruction, buffer address, size etc.) in the DC DC transfers data directly to memory, interrupts CPU only to signal completion/error

Interrupt I/O vs. Direct Memory Access PrimaryMemory Cpu Dev. Ctrlr. Device PrimaryMemory Cpu Device Input LOAD COMMAND* INTERRUPT CPU GET STATUS XFER DATA Output LOAD COMMAND INTERRUPT CPU GET STATUS XFER DATA Input/Output LOAD COM., ADD. & SIZE Interrupt CPU on Completion GET STATUS XFER DATA

1.3 Computer System Architecture Self Read Must know the difference between Symmetric and Asymmetric systems.

The evolution of OS

1.4 Operating System Structure Multiprogramming - keep multiple jobs in memory, switching between them when the CPU is idle. Improve utilization of computer system Time sharing – switching between jobs based on timer Switches between jobs very frequently Each user/process is given the impression that they have sole access to the system Job 1 Job 2 Job 3 Job n OS

Multitasking and Timesharing First multitasking operating systems such as DOS were introduced to improve CPU efficiency Then Time shared systems such as Unix and Windows to allow multiple “simultaneous” program execution The O/S need to save the state of each program during interrupts, it needs to schedule the programs etc. To support the above and other issues, the concept of a process was created (Chapter 3)

1.5 Modes of Operation How do we prevent user processes from writing to Device Controller registers? Most systems support at least two modes of operation: the user mode and the kernel mode

Dual-Mode Operation All Operating System code is available when CPU is in Kernel mode Only User code is allowed to execute when CPU is in user mode What if a user process needs some OS service? System calls (S/C) provide the means for a user program to ask the OS to perform tasks reserved for the OS on the user program’s behalf USB Device Driver PCI Device Driver Create File S/C Read File S/C Write File S/C Create Process S/C Kill Process S/C Signal Process S/C Process Scheduler Virtual memory Mgr Inter Process Communication Locks & Synch.

Dual Mode Operation To support a stable and secure system, a dual-mode CPU was introduced Various instructions and memory addresses could only be accessed in Kernel mode To access service routines only available in the kernel (open a file, write a character to terminal, etc), a user process makes system calls Interrupt handlers are invoked to handle these system calls

Dual Mode Operation A system call allows a user process to request a protected service form the operating system The system call number along with arguments are stored in well defined registers and a special instruction is executed The cpu is placed in kernel mode and the system call service routine is executed The operating system determines the service the user process is requesting and verifies the arguments When complete, results are placed in the users process space and the cpu is placed back in user mode Execution continues with the next instruction

Dual Mode Operation The CPU is placed in kernel mode when an interrupt/trap/system call is received User process Execute Sys Call resume user process call sys call mode bit = 0 return mode bit = 1 user mode mode bit=1 kernel mode mode bit=0

The Timer The CPU timer interrupts the CPU during predetermined intervals Most timers are variables and can be set to interrupt the CPU after the user process has executed for a predetermined amount of time Instructions that update the timer must be privileged instructions Ensures that the OS maintains control of the CPU OS always sets time before turning over control to user

Other O/S Responsibilities Discuss tasks the operating system would be responsible for each of the subsystems listed below Memory management (Chap 1.7) Process management (Chap 1.6) Storage management (Chap 1.8) Protection and Security (Chap 1.9)

Reading Assignment. By this Friday Read Chapter 2