Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 21 Today’s class Finish computer system overview Review of.

Slides:



Advertisements
Similar presentations
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
Advertisements

Chapter 1 Computer System Overview
Computer System Overview
CSCI 4717/5717 Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Informationsteknologi Tuesday, September 18, 2007 Computer Systems/Operating Systems - Class 61 Today’s class Finish review of C Process description and.
1 CSSE 332 Structures, Command Line Arguments. 2 Multi-dimensional arrays Multi-dimensional arrays int points[3][4]; points [1][3] = 12; /* NOT points[3,4]
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer System Overview
1 Computer System Overview OS-1 Course AA
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Computer System Overview
University College Cork IRELAND Hardware Concepts An understanding of computer hardware is a vital prerequisite for the study of operating systems.
Chapter 1 and 2 Computer System and Operating System Overview
Adapted from slides ©2005 Silberschatz, Galvin, and Gagne and Stallings Lecture 2: Computer Systems Overview.
Chapter 1 and 2 Computer System and Operating System Overview
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Memory Hierarchy M ADHAN - ADHAN KR. C-O.IN.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
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 System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Chapter 1 Computer System Overview
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
1 Course Information Operating System Fall Instructor Information Office: 1N-214 Tel:(718) Webpage:
Operating Systems and Networks AE4B33OSS Introduction.
Operating Systems Lecture 02: Computer System Overview Anda Iamnitchi
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
COMPUTER SYSTEM OVERVIEW. Operating Systems: Internals and Design Principles “No artifact designed by man is so convenient for this kind of functional.
Operating systems, lecture 4 Team Viewer Tom Mikael Larsen, Thursdays in D A look at assignment 1 Brief rehearsal from lecture 3 More about.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
COMPUTER SYSTEM OVERVIEW
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
Operating System Isfahan University of Technology Note: most of the slides used in this course are derived from those of the textbook (see slide 4)
Operating System 1 COMPUTER SYSTEM OVERVIEW Achmad Arwan, S.Kom.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Lecture 1: Review of Computer Organization
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
Structure and Role of a Processor
1 Computer Architecture. 2 Basic Elements Processor Main Memory –volatile –referred to as real memory or primary memory I/O modules –secondary memory.
CISC 3595 Operating Systems Introduction Tuesday / Friday 10:00-11:15am X. Zhang.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
Operating systems, Lecture 1 Microsoft Windows –Windows 7 –Windows 8 –Windows RT UNIX –Linux –IOS –Android.
1 Computer System Overview Chapter 1. 2 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system.
Computer System Overview
Chapter 1 Computer System Overview
Day 02 Introduction to C.
Interrupts.
Computer System Overview
Computer System Overview
11 An operating system (OS) exploits the hardware resources of one or more processors to provide a set of services to system users. The OS also manages.
BIC 10503: COMPUTER ARCHITECTURE
Chapter 1 Computer System Overview
Computer System Overview
Presentation transcript:

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 21 Today’s class Finish computer system overview Review of more C

Finish computer system overview

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 23 Instruction Execution Two steps  Processor reads (fetches) instructions from memory  Processor executes each instruction

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 24 Instruction Cycle

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 25 Instruction Fetch and Execute Program counter (PC) holds address of the instruction to be fetched next The processor fetches the instruction from that memory location Program counter is incremented after each fetch

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 26 Instruction Register Fetched instruction is placed in the instruction register Categories  Processor-memory  Transfer data between processor and memory  Processor-I/O  Data transferred to or from a peripheral device  Data processing  Arithmetic or logic operation on data  Control  Alter sequence of execution

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 27 Characteristics of a Hypothetical Machine

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 28 Example of Program Execution

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 29 Direct Memory Access (DMA) I/O exchanges occur directly with memory Processor grants I/O module authority to read from or write to memory Relieves the processor of the responsibility for the exchange

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 210 Interrupts Interrupt the normal sequencing of the processor Most I/O devices are slower than the processor  Processor must pause to wait for device

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 211 Classes of Interrupts

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 212 Program Flow of Control Without Interrupts

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 213 Program Flow of Control With Interrupts, Short I/O Wait

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 214 Program Flow of Control With Interrupts; Long I/O Wait

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 215 Interrupt Handler Program to service a particular I/O device Generally part of the operating system

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 216 Interrupts Suspends the normal sequence of execution

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 217 Interrupt Cycle

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 218 Interrupt Cycle Processor checks for interrupts If no interrupts fetch the next instruction for the current program If an interrupt is pending, suspend execution of the current program, and execute the interrupt-handler routine

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 219 Timing Diagram Based on Short I/O Wait

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 220 Timing Diagram Based on Long I/O Wait

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 221 Simple Interrupt Processing

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 222 Multiple Interrupts Disable interrupts while an interrupt is being processed

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 223 Multiple Interrupts Define priorities for interrupts

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 224 Multiple Interrupts

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 225 Multiprogramming Processor has more than one program to execute The sequence the programs are executed depend on their relative priority and whether they are waiting for I/O After an interrupt handler completes, control may not return to the program that was executing at the time of the interrupt

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 226 Memory Faster access time, greater cost per byte Greater capacity, smaller cost per byte Greater capacity, slower access speed

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 227 Memory Hierarchy

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 228 Going Down the Hierarchy Decreasing cost per byte Increasing capacity Increasing access time Decreasing frequency of access of the memory by the processor  Locality of reference

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 229 Secondary Memory Nonvolatile Auxiliary memory Used to store program and data files

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 230 Disk Cache A portion of main memory used as a buffer to temporarily to hold data for the disk Disk writes are clustered Some data written out may be referenced again. The data are retrieved rapidly from the software cache instead of slowly from disk

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 231 Cache Memory Invisible to operating system Increase the speed of memory Processor speed is faster than memory speed Exploit the principle of locality

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 232 Cache Memory

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 233 Cache Memory Contains a copy of a portion of main memory Processor first checks cache If not found in cache, the block of memory containing the needed information is moved to the cache and delivered to the processor

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 234 Cache Read Operation

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 235 Cache Data Modified Write policy dictates when the memory write operation takes place  Can occur every time cache block is updated  Can occur only when cache block is replaced  Minimizes memory write operations  Leaves main memory in an obsolete state

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 236 I/O Communication Techniques Programmed I/O Interrupt-driven I/O Direct memory access (DMA)

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 237 Programmed I/O I/O module performs the action, not the processor Sets appropriate bits in the I/O status register No interrupts occur Processor checks status until operation is complete

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 238 Interrupt-Driven I/O Processor is interrupted when I/O module ready to exchange data Processor saves context of program executing and begins executing interrupt-handler No needless waiting Consumes a lot of processor time because every word read or written passes through the processor

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 239 Direct Memory Access Transfers a block of data directly to or from memory An interrupt is sent when the transfer is complete Processor continues with other work

Review of more C

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 241 Structures Equivalent of Java’s classes with only data (no methods) Example 6: #include struct birthday{ int month; int day; int year; }; //Note the semi-colon int main() { struct birthday mybday;/* - no ‘new’ needed ! */ /* then, it’s just like Java ! */ mybday.day=1; mybday.month=1; mybday.year=1977; printf(“I was born on %d/%d/%d”, mybday.day, mybday.month, mybday.year); }

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 242 More on structures struct person{ char name[41]; int age; float height; struct { /* embedded structure */ int month; int day; int year; } birth; }; struct person me; me.birth.year=1977;……… struct person class[60]; /* array of info about everyone in class */ class[0].name=“Gun”; class[0].birth.year=1971;……

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 243 typedef typedef struct person myPerson  Defines a new type name myPerson as a synonym for type struct person int main(){ myPerson me; me.age = 6; … }

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 244 User-defined header files Structures and other data structures may be defined in a header file, for better organization of the code These are user-defined header files e.g. person.h To include it: #include “person.h” at the start of the program file

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 245 Command line arguments Accept inputs through the command line. main(int argc, char* argv[])  argc – argument count  argv[] – value of each argument

Informationsteknologi Thursday, September 6, 2007Computer Systems/Operating Systems - Class 246 Example 7 #include int main(int argc, char *argv[]) { int count = 0; if(argc < 2){ printf("Must enter at least one argument\n"); printf("Example:./a.out this is program 7\n"); exit(1); } printf(" The number of arguments is %d\n", argc); printf("And they are :\n"); while(count < argc){ printf("argv[%d]: %s\n",count,argv[count] ); count++; } printf("\n"); return 0; }