Computer System Organization S H Srinivasan

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
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 &
Computer Organization and Architecture
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Computer System Overview
Computer Organization and Architecture
Computer Organization and Architecture
CSCI 4717/5717 Computer Architecture
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
1 Computer System Overview OS-1 Course AA
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
Chapter 10 The Stack Stack: An Abstract Data Type An important abstraction that you will encounter in many applications. We will describe two uses:
Computer Architecture
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
Computers Internal Communication. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
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.
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.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4 4 Computer Organization.
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.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
Stored Program A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write,
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
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.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Computer Organization (Review of Prerequisite Material)
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4 4 Computer Organization.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Structure and Role of a Processor
CSC 360- Instructor: K. Wu Review of Computer Organization.
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4.
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.
Of Privilege, Traps, Interrupts & Exceptions Prof. Sirer CS 316 Cornell University.
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
Chapter 10 And, Finally... The Stack
Chapter 10 The Stack.
Computer Organization
Computer System Overview
Outline Computer Organization Devices Interrupts Computer architecture
Chapter 10 And, Finally... The Stack
Presentation transcript:

Computer System Organization S H Srinivasan

von Neumann Architecture CPU –arithmetic logical unit –control unit Memory I/O Bus

von Neumann Architecture ALU Control Unit Memory Device controller CPU Address bus Data bus

Control Unit Operation –fetch –decode –execute Registers –PC (program counter) –IR (instruction register) –PS (processor status) –SP (stack pointer)

Control unit operation PC = ; IR = memory[PC]; haltFlag = FALSE; while (!haltFlag) { execute(IR); PC = PC + sizeof(INSTRUCTION); IR = memory[PC]; }

Memory MAR MDR command: Read/Write

ALU General purpose registers Functional units: addition, multiplication, etc. Status flags: carry, overflow, etc.

Devices Control register –accepts commands Status register: ready, busy –polling Data registers I/O: character, block

I/O operation while (device.busy || device.done); device.data[0] = device.command = WRITE; while(device.busy); device.done = TRUE; The above illustrates “busy-wait” operation This can be speed up using interrupts DMA

Interrupts Asynchronous input to CPU Processor state (PC) needs to be saved –where? Stack –one more register: SP Priorities: each interrupt has a priority Masking –IPL: interrupt priority level –if (input IPL < current IPL) ignore the interrupt

Interrupt processing /* assuming the interrupt is not masked */ (1) push PC and PS on the stack (2) set current IPL = input IPL (3) handle interrupt /* jump to service routine */ (4) restore the IPL (5) restore the PC and PS (from the stack)

DMA Device Memory data transfer is usually through the CPU –read device, write memory or read memory, write device Huge data transfer between memory and device: lot of overhead DMA: Direct device memory data transfer without CPU intervention

Bootstrapping Power-up: CPU starts executing from a fixed location This program reads a fixed number of bytes from a fixed location in disk (boot sector) The program in the boot sector is called the bootstrap loader The bootstrap loader loads the OS

Hardware support Processor modes Special instructions –traps Atomic operations –test and set Exceptions

Processor Modes Two modes: supervisor and user Supervisor –all instructions can be executed, e.g., halt –all memory can be accessed User –subset of instructions and memory

Traps “trap” is a software instruction with a single parameter –example, “trap 40” can be executed in the user mode when executed, changes the mode to supervisor and calls a subroutine associated with the number (“40”)

Traps (cont’d) These subroutines are written by the OS developer and not the user system calls are basically C language wrappers for traps

Exceptions Exceptions signal error conditions –illegal memory access –divide by zero Exceptions are equivalent to traps except that they are invoked by the hardware

traps, exceptions: synchronous –caused by the current instruction interrupts: asynchronous –caused by external events like user typing traps: invoked by user exceptions: invoked by hardware because of error

System parameters Data, Address size Clock speed Bandwidth: memory, device

What does the OS provide? Multiple processors Unlimited memory Easy I/O How?

What does a program really want? Current instruction (locality) Register values: PC, SP, SR, other registers Nothing else! We can execute the program one instruction at a time, keeping only one instruction in memory.

What does the kernel do? (Highly simplified) Take one program –restore the register values –execute one instruction –save the register values Take another program –repeat the same operation In practice, kernel executes the program for one time slice and keeps several pages in memory. Kernel needs some machinery to do this

Timer Timer is absolutely essential for time slice allocation, error detection (timeout), etc. Most systems also have a realtime clock timer vs. cpu clock vs. wall clock

Programming abstraction for processes if ((pid = fork()) == 0) { /* child code */ /* begins independent execution */ } else { /* error */ } /* rest of parent code */ /* if there is no error, there are two processes here */