Input/Output Interface

Slides:



Advertisements
Similar presentations
Datorteknik OperatingSystem bild 1 the Operating System (OS)
Advertisements

Datorteknik OperatingSystem bild 1 the Operating System (OS)
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Datorteknik IOControl bild 1 Input/Output Interface Address bus Data bus Control bus fffffffc Addr DE...Mem 1 Keyboard address decoder Mem n address decoder.
Day 11 Processes. Operating Systems Control Tables.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Chapter 2 The OS, the Computer, and User Programs Copyright © 2008.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Embedded Systems 7763B Mt Druitt College of TAFE
System Calls 1.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Thread Scheduling.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
CPS110: Implementing threads Landon Cox. Recap and looking ahead Hardware OS Applications Where we’ve been Where we’re going.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
MicroComputer Engineering OperatingSystem slide 1 the Operating System (OS)
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
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.
CPS110: Implementing threads on a uni-processor Landon Cox January 29, 2008.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
WORKING OF SCHEDULER IN OS
Input/Output (I/O) Important OS function – control I/O
Computer Organization
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Interrupts and exceptions
Processes and threads.
Process concept.
Operating Systems CMPSC 473
the Operating System (OS)
Protection of System Resources
Day 08 Processes.
Day 09 Processes.
CS 3305 System Calls Lecture 7.
Process Realization In OS
Intro to Processes CSSE 332 Operating Systems
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
MIPS I/O and Interrupt.
Computer System Overview
More examples How many processes does this piece of code create?
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Today’s agenda Hardware architecture and runtime system
PROCESS MANAGEMENT Information maintained by OS for process management
Thread Implementation Issues
Lecture Topics: 11/1 General Operating System Concepts Processes
Processes Hank Levy 1.
Computer System Overview
MIPS I/O and Interrupt.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Processes David Ferry CSCI 3500 – Operating Systems
Processes Hank Levy 1.
CPU Structure and Function
Chapter 11 Processor Structure and function
Introduction Lab1 A crash course in assembler programming
CS Introduction to Operating Systems
Presentation transcript:

Input/Output Interface Address bus Data bus Control bus address decoder address decoder fffffffc Addr DE I/O Interface Mem 1 ... Mem n Keyboard

How to do I/O By “Polling” + Very simple and fast li $t1 0xfffffffc ;Interface address waitkey: lb $t0 0($t1) ;Poll Keybard nop beq $t0 $r0 waitkey ;no key strike + Very simple and fast - Can’t do any useful work while waiting - Only OK in a single process system, might miss data if other process takes over

External Interrupt Let the Interface generate an External Interrupt when data is available + Access I/O Interface only when needed + I/O handling is done by OS (Operating System) I/O addresses can be “privileged” for SAFETY + Data is never lost (if processor fast enough) - Slower than “Polling” We will address that problem later

Input/Output Interface Address bus Data bus Control bus CTRL[INT2]=keyboard strike fffffffc Addr DE I/O Interface Moore about: Buffered I/O “Intelligent Devices” etc. later. Keyboard

An External Interrupt Occurs The “context” of the User program must be restored User Program Kernel Program . .. bne $t0 $r0 upp mfc0 $k0 $14 jr $k0 rfe add $t0 $t1 $t2 .. .

Multiple Processes User 1 User 2 User 3 Kernel .text .text .text .ktext Instructions .data .data .data .kdata Data

Time Slicing, Context Switch On Each Timer Interrupt Store the User program “Context” Choose next User program (process) Round robin process scheduling Restore its “Context” Pass control to User program

Process Control Block (PCB) Resume Address (next PC for this process) Global Data pointer ($gp) Stack pointer ($sp) All registers but $k0, $k1, $gp, $sp $k0, $k1 might be trashed by the Kernel code $gp, $sp stored in the PCB

Process Control Block PCB for Process p1 next_pc $gp $sp .text resume addr base for global data area for p1 .data top of user p1 stack .p1 stack $pc,$sp,$gp are initiated by the OS at “run” time

Where are the 28 registers? PCB p1 PCB p1 next_pc $gp $sp Let’s put them on the user program’s stack! next_pc $gp $sp And adjust the $sp $t0 $t1 … .. $t0 $t1 … .. .p1 stack .p1 stack