25
Chapter 1 Computer System Overview Seventh Edition By William Stallings Operating Systems: Internals and Design Principles

Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Embed Size (px)

Citation preview

Page 1: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Chapter 1Computer System

OverviewSeventh Edition

By William Stallings

Operating Systems:Internals

and Design

Principles

Page 2: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

HardwareBefore mid

ProcessBefore mid

SchedulingBefore and after mid

DeadlockBefore and after mid

MemoryAfter mid

Course Outline & Marks Distribution

Linux Scripting

C/C# programming

Page 3: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

• Quizzes = 4 (each of 2.5 marks)• Assignments

– Programming =3 (each of 2 marks)– Reading/ writing=3 (each of 2 marks)– Term Report=1 (of 8 marks)

• Midterm • Final Term

Course Outline & Marks Distribution

Text Book: Operating Systems by William StallingReference: 1. Tanenbaum's "Modern Operating Systems", 2nd or 3rd Edition

2. Operating System Principles (7th edition) by Silberschatz

Page 4: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

The students will be able to:• Learn the role of system software’s • Learn the theory of how operating systems are constructed.• Develop practical skills that can help to understand and to

modify the coding of operating systems(Minix, Unix)• Learn the use of middleware in the combination with

Operating systems.• Acquire the knowledge of various kinds of operating systems• Learn the concept of THREADS that will be helpful for the

students interested in CLIENT-SERVER applications.

Objectives

Page 5: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

What we learn this week.üWhat is an Operating System?üBasic Elements.üInstruction Execution.üInterruptüI/OüMemory

Internals and Design Principles

Page 6: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Operating System

• An operating system (OS) is the interface between the user and the hardware

• An OS provides standard services (System calls ) which are implemented on the hardware, including:

• Processes , I/O devices , CPU scheduling, memory management, file system, networking

• A Manager — allocates resources efficiently and fairly, protects users from each other, provides safe and secure communication

Page 8: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Goals of Operating System

• Exploits the hardware resources of one or more processors (cores)

Goals– Execute user programs and make

solving user problems easier.– Make the computer system convenient to use.– To use the computer hardware in an efficient

manner.

Convenience

Efficiency

Page 10: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Logical UnitsGraphical Processing Unit: Provide efficient computation on arrays of data using Single-Instruction Multiple Data (SIMD) techniques . Used for general numerical processing .Physics simulations for games . Computations on large spreadsheets

Digital Signal Processor: Deal with streaming signals such as audio or video. Used to be embedded in devices like modems. Encoding/decoding speech and video .Support for encryption and security

System on a Chip: Components such as DSPs, GPUs, codecs and main memory, in addition to the CPUs and caches, are on the same chip

Page 11: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Instruction Execution

A program consists of a set of instructions stored in memoryProcessorReads the instructionFrom main memory

ProcessorExecutes each instruction

A CPU Cycle refers to a single pulse of the computer clock. For example, a 4 Mhz CPU will have 4 million CPU cycles per second.

Page 12: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Characteristics of a Hypothetical Machine

Page 13: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Program Execution

load 940

add 941

Store 940

Page 14: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Interrupts

•Deviation from the normal sequencing of theprocessing•Provided to improve processor utilization

ü most I/O devices are slower than the processor

ü processor must pause to wait for deviceü wasteful use of the processor

Page 17: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Example Time Sequence of Multiple Interrupts

Page 18: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Memory Hierarchy

Major constraints in memoryÆamountÆspeedÆExpense (cost)

Less capacity, Fast access speedGreater capacity, Slower access speed

Page 19: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Memory Types

1. Registers 1 KB 2. Cache (SRAM) 1 MB 3. Main Memory 512 MB 4. Disk 40 GB5. Magnetic tape 1TB6. Removable media 4GB

Secondary Memory:Also referred to as auxiliary memoryüExternalüNonvolatileüUsed to store program and data files

Cache is the smallest memory placed between main memory and processorü Invisible to OSüContains a copy of a portion of

main memoryüProcessor first checks cache

Primary memory is computer memory that is accessed directly by the CPU

Page 20: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Cache and Main Memory

Disk Cache:A portion of main memory used as buffer to (temporarily) hold data (for disk)

Page 21: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Main categories

are:

cache size

block size

mapping function

replacement algorithm

write policy

number of cache levels

Page 22: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

DMADirect Memory access

CPU

Memory

Device

Cache

1- Transfers a block of memory w/o going through CPU

2- Interrupt is sent when task is done.

3- CPU involves in the beginning &ending4- Free to perform other operations

More efficient than interrupt-driven or programmed I/O

Page 23: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Multicore ComputerMulticore ComputernAlso known as a chip multiprocessor

nCombines two or more processors (cores) on a single piece of silicon (die)n each core consists of all of the components of

an independent processor

n In addition, multicore chips also include L2 cache and in some cases L3 cache

Page 24: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Intel Intel Core i7Core i7

Figure 1.20 Intel Corei7 Block Diagram

Page 25: Chapter 1 Computer System Overview - · PDF fileChapter 1 Computer System Overview ... • Acquire the knowledge of various kinds of operating ... A CPU Cycle refers to a single pulse

Summary

qBasic Elements•processor, main memory, I/O modules, system bus

qGPUs, SIMD, DSPs, SoC

qInstruction execution•processor-memory, processor-I/O, data processing, control

qInterrupt/Interrupt ProcessingqMemory HierarchyqCache/cache principles and designsqMultiprocessor/multicore