Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.

Slides:



Advertisements
Similar presentations
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
Advertisements

1 (Review of Prerequisite Material). Processes are an abstraction of the operation of computers. So, to understand operating systems, one must have a.
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4 Computer Organization.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Processor System Architecture
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Interrupts (contd..) Multiple I/O devices may be connected to the processor and the memory via a bus. Some or all of these devices may be capable of generating.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Computer System Overview
Chapter 7 Interupts DMA Channels Context Switching.
Basic Input/Output Operations
Computer System Organization S H Srinivasan
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
Computer Architecture
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
hardware and operating systems basics.
System Calls 1.
COMP201 Computer Systems Exceptions and Interrupts.
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.
Input and Output Computer Organization and Assembly Language: Module 9.
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Computers Internal Communication. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Computer Organization 1 Instruction Fetch and Execute.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Unix System Calls and Posix Threads.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Lecture 1: Review of Computer Organization
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.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Structure and Role of a Processor
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
1 3 Computing System Fundamentals 3.2 Computer Architecture.
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.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
Operating Systems CMPSC 473
Computer Architecture
Computer System Overview
Computer System Overview
Presentation transcript:

Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware

Overview  Hardware o Processor o Memory o I/O devices o Interrupts 2

Processor (CPU)  CPU executes a set of instructions o Different for different CPU architectures o Various memory and register-based instructions  Anatomy of a CPU o Program Counter (PC): holds address of next instruction o Instruction Register (IR): holds instruction being executed o General Registers (Reg. 0..n): holds variables o Stack Pointer (SP): holds address for accessing stack o Status Register (SR): holds control bits that affect program execution, also called processor status word 3

CPU Execution  All a CPU does is Fetch/Decode/Execute 4 PC = while (halt flag not set) { IR = memory[PC]; // read from mem PC = PC + 1; execute(IR); // decode & execute instruction // uses registers, stack pointer, // status register, etc. }

Memory  Memory (DRAM) provides storage o Think of it as an array of bytes  Each byte has unique address  Nr. of bits that represent address is called the address width o Example: 64-bit vs 32-bit CPUs  Simple abstraction o Write(address, value) o value = Read(address), returns last value written byte address value

I/O Devices  Devices are connected to device-specific controllers  One or more buses connect the CPU to memory and to device controllers 6 Monitor Bus

How does CPU Communicate With Devices?  Each controller owns a range of "bus" addresses  CPU communicates with controller by sending message to address using o Special I/O instructions, or o Memory-mapped I/O  Certain memory locations are mapped to device registers  CPU reads/writes these memory locations 7

Communicating with Devices  Communication model o Send(address, value)  CPU writes value to an address o value = Receive(address)  CPU will poll (continuously read) address for a value to determine whether data is available  Then read the data using another address  Is this model similar to the memory abstraction?  How often should we poll the device? o Keyboard device, high-speed n/w device 8

Interrupts  Polling is not efficient  CPU and devices can run concurrently more efficiently if the device can send an interrupt signal to the CPU when it is done  CPU has an “interrupt request” flag that can be set by devices 9 send

Processor Execution with Interrupts  Step 1: When interrupt flag is set o H/W saves PC o Sets PC to a predetermined address, containing code called interrupt handler  Step 2: When h/w executes next instruction, interrupt handler code runs o Saves CPU registers of interrupted program, why? o Runs code to handle device event o Restores CPU registers of interrupted program 10  Step 3: Handler runs “return from interrupt” instruction o Sets PC to the original next instruction of interrupted program  Result: interrupt handling looks like a function call, can occur at any time, but program is unaware it occurred

Processor Execution with Interrupts 11 Interrupt_handler() { save_processor_state(); handle_interrupt(); restore_processor_state(); return from interrupt; // restores prev PC, SP, SR } PC = while (halt flag not set) { IR = memory[PC]; // read from mem PC = PC + 1; execute(IR); if (InterruptRequest) { hardware saves previous PC, SP, SR; PC = memory[0]; // address 0 contains code of // intr. handler }

Summary  OS manages h/w on behalf of application  CPU: executes instructions  Memory: array of bytes, used to store code and data  I/O devices: run concurrently with CPU o CPU requests service from device o CPU can poll to check when device has finished serving request  Interrupts o Allow CPU to do useful work until device is done with request o Interrupt handling requires support from h/w and software 12