© 2009, D. J. Foreman 1 Computer Organization. © 2009, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.

Slides:



Advertisements
Similar presentations
1 (Review of Prerequisite Material). Processes are an abstraction of the operation of computers. So, to understand operating systems, one must have a.
Advertisements

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.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Computer System Overview
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Chapter 4 Computer Organization Vishal Shah Vishal Pinto.
Computer System Organization S H Srinivasan
1 Device Management The von Neumann Architecture System Architecture Device Management Polling Interrupts DMA operating systems.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
5.1 Chaper 4 Central Processing Unit Foundations of Computer Science  Cengage Learning.
Inside The CPU. Buses There are 3 Types of Buses There are 3 Types of Buses Address bus Address bus –between CPU and Main Memory –Carries address of where.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
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.
System Calls 1.
Computers Central Processor Unit. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
2: Computer-System Structures
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.
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.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS552 Overview © 2009, D. J. Foreman1. Generalized O/S structure Basic interrupt handler – Determines cause – Uses branch table to specific handler I/O.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
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  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
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.
Lecture on Central Process Unit (CPU)
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
بسم الله الرحمن الرحيم MEMORY AND I/O.
CSC 360- Instructor: K. Wu Review of Computer Organization.
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Introduction to Operating Systems Concepts
CPU Lesson 2.
Interrupts and signals
Processor/Memory Chapter 3
Introduction to Computer Architecture
Computer-System Architecture
Module 2: Computer-System Structures
Outline Computer Organization Devices Interrupts Computer architecture
Operating Systems Chapter 5: Input/Output Management
Introduction to Computer Architecture
Today’s agenda Hardware architecture and runtime system
Computer Organization
Module 2: Computer-System Structures
Chapter 5 Computer Organization
Device Mgmt © 2004, D. J. Foreman.
O/S Organization © 2004, D. J. Foreman.
Device Mgmt © 2004, D. J. Foreman.
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
O/S Organization © 2004, D. J. Foreman.
Chapter 1: Introduction CSS503 Systems Programming
Presentation transcript:

© 2009, D. J. Foreman 1 Computer Organization

© 2009, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control ■ Fixed circuitry  Non-von Neumann ■ Various changes Multiple ALUs Merged ALU and Control Alternatives to ALU

© 2009, D. J. Foreman 3 Timing  Cycle – timing in a computer comes from a master clock controlled by a crystal oscillator  Clock ticks (million cycles / sec)  Frequency = 1/period and Period = 1/frequency  Let’s use 10 MHz to make the arithmetic easier ■ 10 MHz = 10 x 10 6 Hz = 10 7 Hz ■ Period is 1/10*1 / 10 6 =.1 µsec = seconds  Terms ■ Giga = 10 9 and nano = ■ Mega = 10 6 and micro = 10 -6

© 2009, D. J. Foreman 4 Storage Speed Hierarchy  On the Motherboard ■ CPU Registers – extremely fast ■ Cache (CPU Internal) – very fast ■ Cache (External) – fast ■ Main Memory - slow  External ■ Flash disk – 0 latency ■ Magnetic Disks – high latency ■ Optical Disk – very high latency ■ Magnetic Tapes – seq'l, extremely high latency

© 2009, D. J. Foreman 5 Instruction Processing 1. Fetch – get instruction from RAM 2. Decode - h/w determines operation from bit pattern of first (or more) byte(s) 3. Obtain operand data ■ From Registers or RAM ■ Into ALU 4. Execute (perform the operation) 5. Store results back to RAM 6. Update Instruction Counter ■ (sometimes called Program Counter)

© 2009, D. J. Foreman 6 Device-Controller/Software Relationship Application API O/S Device driver Device controller Device S/W H/W

© 2009, D. J. Foreman 7 Device Controller Interface  Data width  Commands ■ Read ■ Write ■ Seek  Status codes ■ Busy ■ Error ■ Done ■ Ready

© 2009, D. J. Foreman 8 I/O Operations  Controller manages device  Devices are MUCH slower than CPU  CPU can process while device runs  Need to know when done ■ Polling (continual testing for "done") ■ Special h/w for notification – interrupt flag One bit in CPU (explore: 1 per device) Turned on by device controller Turned off by O/S No "race" conditions

© 2009, D. J. Foreman 9 Interrupt Handling Sequence  Controller (atomic action) ■ turns on flag ■ Sets code indicating which device  H/W (atomic action) ■ Switches to privileged mode ■ interrupts off ■ Memory protection off ■ Sets IC to general interrupt handler in O/S  O/S ■ Saves registers (NOT part of atomic actions)

© 2009, D. J. Foreman 10 Kernel S/W Interrupt Handling  Save (uses multiple machine cycles) ■ Registers ■ Stack  Determine interrupt cause ■ I/O, error, service request, external signal  Jump to proper interrupt-handler

© 2009, D. J. Foreman 11 Kernel Returns to the User  Restores user's state & values ■ User mode (kernel/user) ■ Registers ■ Stack  Load IC with interrupts enabled Allows new interrupt before switching (return to processing on previous slide)

© 2009, D. J. Foreman 12 Trap or System Call Instruction  Atomic operation ■ Causes an interrupt (type=service request) ■ It is NOT a “call” as if to a function  Common service request handler ■ Uses code to select address in trap table ■ Trap table contains addresses of specific programs for specific request

© 2009, D. J. Foreman 13 Traps or Kernel “Calls”  Examples ■ cout << x; ■ seek (device, position); ■ X=ftime();  User functions expand into assembly code for a "trap" or "svc" instruction  "trap" causes a H/W switch to the kernel  Kernel performs op and returns to user

© 2009, D. J. Foreman 14 System call example fork (My_fork_loc); {● ● trap (K_FORK, *My_fork_loc); } My_fork_loc:…; *Do_fork Do_fork(loc) { ● ● start_process (loc); mode=0; return; } Trap table *Do_fork User spaceKernel space K_fork is entry # for "FORK" Kernel space

© 2009, D. J. Foreman 15 Instruction Processing with Interrupts fetchexecute Interrupts allowed? No yes previous inst Interrupt pending? No process interrupt yes

© 2009, D. J. Foreman 16 Direct Memory Addressing (DMA)  Allows device controller to access RAM w/o going through the CPU  Increases throughput  Reduces interrupt handling

© 2009, D. J. Foreman 17 Device addressing  Two methods shown in text: ■ Conventional External to RAM Limited only by size of device address ■ Memory-mapped devices Uses reserved part of RAM Limited by reserved space  Third method – used in some mainframes ■ Channels – addresses 00-0f (1 byte) ■ Sub-channels – addresses 00-ff (2 nd byte) ■ Total of 4096 independent devices (0000-0fff)

© 2009, D. J. Foreman 18 Loader Processing  Find the executable file  Resolve relative addresses within program to actual locations  Connect DLL's to procedure call structure ■ Shared collection of programs & entry points

© 2009, D. J. Foreman 19 Pipelined Instructions FetchDecodeExecute Store Fetch Decode Execute Store FetchDecodeExecuteStore Done t1, etct0

© 2009, D. J. Foreman 20 Software, Firmware, Hardware  Software ■ Programs you can install/remove/transport to another computer which are stored on disk, CD, etc and run from within RAM  Firmware ■ Programs usually installed only by chip maker and which run from within ROM ■ May be upgraded by user (depends on chip)  Hardware ■ The physical components of the system

Hex addressIBM z/390 memory content 0IPL PSW or Restart PSW 8IPL CCW1 or Restart old PSW 10IPL CCW2 18External Old PSW 20Supervisor Call Old PSW 28Program Check Old PSW 30Machine Check Old PSW 38I/O Old PSW 58External New PSW 60Supervisor Call New PSW 68Program Check New PSW 70Machine Check New PSW 78I/O New PSW 80External interrupt data 88 (4 bytes)SVC interruption data: 13-14= ILC, 16-31= interruption code (SVC #) paired © 2009, D. J. Foreman 21

© 2009, D. J. Foreman 22 PC-bootable disk layout 0x00-0x02 jump inst to 0x1e 0x03-0x0aPC manufacturer name 0x0b-0x0csectors/cluster 0x0d-0x0freserved for boot record 0x10-0x10# of FAT's 0x11-0x12# root directory entries 0x13-0x14# logical sectors 0x15-0x15media descriptor 0x16-0x17sectors/FAT 0x18-0x19sectors/track 0x1a-0x10b # surfaces (heads) 0x1c-0x1d# hidden sectors 0x1e-…boot program