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.

Slides:



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

Datorteknik MainMemory bild 1 Memory The programmer’s model.text,.data –user program (instruction memory) and data area.ktext,.kdata –kernel program and.
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.
1 (Review of Prerequisite Material). Processes are an abstraction of the operation of computers. So, to understand operating systems, one must have a.
1 Procedure Calls, Linking & Launching Applications Lecture 15 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
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.
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 7 Interupts DMA Channels Context Switching.
Basic Input/Output Operations
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 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
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.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
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.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
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.
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.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
MicroComputer Engineering OperatingSystem slide 1 the Operating System (OS)
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 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
MIPS I/O and Interrupt.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Lecture on Central Process Unit (CPU)
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
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.
Processes and threads.
Process concept.
Operating Systems CMPSC 473
the Operating System (OS)
Day 08 Processes.
Day 09 Processes.
Input/Output Interface
CS 3305 System Calls Lecture 7.
Intro to Processes CSSE 332 Operating Systems
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.
PROCESS MANAGEMENT Information maintained by OS for process management
Lecture Topics: 11/1 General Operating System Concepts Processes
Computer System Overview
MIPS I/O and Interrupt.
Lecture 6: Multiprogramming and Context Switching
Processes David Ferry CSCI 3500 – Operating Systems
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Presentation transcript:

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 I/O Interface

Datorteknik IOControl bild 2 How to do I/O By “Polling” li $t1 0xfffffffc ;Interface address waitkey:lb $t0 0($t1) ;Poll Keybard nop beq $t0 $r0 waitkey ;no key strike nop + 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

Datorteknik IOControl bild 3 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

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

Datorteknik IOControl bild 5 An External Interrupt Occurs The “context” of the User program must be restored User ProgramKernel Program mfc0 $k0 $14 jr $k0 rfe... sub $t1 $t3 $t4 add $t0 $t1 $t2...

Datorteknik IOControl bild 6 Multiple Processes User 1KernelUser 2User 3 Instructions Data.text.data.text.data.text.data.ktext.kdata

Datorteknik IOControl bild 7 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

Datorteknik IOControl bild 8 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

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

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