Processor
brain of the system -fetches instructions from memory and executes them
main memory
volatile storage for programs and data
I/O modules
allow data to be moved to and from the computer and I/O devices
System bus
the pathway for data and instructions to move between the processor, memory, and I/O modules
•The invention of the ____ enabled desktop and handheld computing.
microprocessor
microprocessor
a processor contained on a single chip.
What was originally slower but now faster than multichip processors?
microprocessor
Modern microprocessors may have multiple processors on a single chip, called processor ______
cores
each core might be able to support ___ logical processors by sharing an execution unit
2
A modern microprocessor chip might contain 2 or 4 _, enabling a view of 4 to 8 logical _____.
cores; processors
GPU
Graphical Processing Unit -provides efficient computation on arrays of data using SIMD (Single-Instruction Multiple Data) techniques.
-Originally for graphics, now used in general numeric processing, including physics simulations, games, and large spreadsheets.
DSP
Digital Signal Processor -can process a stream of data such as audio or video
SoC
System on a Chip -For handheld devices where many of the components (CPU, DSP, GPU, Memory, etc.) are on a single chip.
Other supporting chips co-exist with the ____ to provide such things as encoding/decoding video (codecs), or for encryption and security.
CPU
Program
set of instructions to be executed in memory
A simplified view of the processor consists of two phases, ____ and _____.
Fetch; execute
fetch step
retrieves an instruction from memory
execute step
carries out the instruction
After each fetch, the _______ ________ is normally incremented so that it is ready to fetch the next instruction
program counter
fetched instruction
loads into the IR
•The instruction in the ___ is then decoded to determine what the processor should do.
IR
Instruction Actions
Processor-memory Processor-I/O Data processing Control
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 (branch instruction)
•Notice that a machine will have a size for instructions like 16-bit or 32-bit based on its _______.
architecture
•This limits the ____ of an instruction.
size
•If part of the instruction is an opcode and part an address, then the portion set aside for the opcode determines how many ____ there can be, and the portion set aside for the address determines how much _____ is directly addressable.
opcodes; memory
AC
"Accumulator" register. It is a register commonly used for loading and storing values to memory and doing arithmetic
interrupts
•mechanism for interrupting the processor's execution in order to do something else.
Common types of interrupts
-Program - instruction exceptions -Timer - system timer -I/O - completion of I/O or I/O error -Hardware failure - power failure or memory parity error
Program interrupts example
-Arithmetic overflow -division by zero -execute illegal instruction -reference outside user's memory space
•Interrupts improve processor utilization by notifying the processor of an ____ versus making the processor wait.
event
•Without interrupts, the processor would have to keep checking to see if an event has occurred.
checking
•After instruction execution, the processor checks to see if an _____ has occurred.
interrupt
•If so, it executes an "____ ______", which is code that processes the interrupt.
interrupt handler
•The processor must save system state (the registers) on the ____ before executing the interrupt handler, or the interrupt handler may be written to preserve _____ ________
stack; system state
•The _____ may have to determine which interrupt handler to run for this interrupt.
processor
•Most ______ ______ are much slower than the processor.
I/O devices
When an interrupt occurs, the CPU switches from executing the program to executing the _____ _____
interrupt handler
Solutions for interrupt occurring while another interrupt is being processed:
-Disable interrupts while processing an interrupt. high-priority interrupt may wait too long and lose data while waiting for a low-priority interrupt to finish. -Interrupt Priorities: lets high-priority interrupt execute when processing low-priority interrupt. Interrupts low-priority interrupt just like interrupting a program.
-Faster access time, _____ cost per bit -Greater capacity, ____ cost per bit Greater capacity, _____ access time
greater; smaller; slower
Locality of reference
program execution of instructions and data occurs in clusters.
•Therefore, as long as a cluster is loaded high up in the _____ ______, execution is fast until that cluster is finished and the next cluster is loaded.
memory hierarchy
•Today most processors can execute instructions faster than they can be retrieved from ____ _____
main memory
_____ ____ sits between the processor and main memory and exploits the principle of "locality of reference" by keeping a "working set" of instructions and data in its small but high-speed memory.
cache memory
•A cache consists of slots (or lines) of K words. •Main memory is divided into blocks of K words. •If main memory is size 2N words, then there are M=_____ blocks of memory.
2^N/K
•Cache lines are addressed by a _____, which is some number of high-order bits of the address.
tag
•When the processor fetches an instruction, a _____ is read into the cache.
block
hit ratio
•the fraction of memory accesses that are found in the cache.
cache size
•how big is the entire cache (a small cache still offers a lot of improvement).
block size
hoe big is a block? needs to be around the size of a cluster
mapping function
where to put a new block
replacement algorithm
how to replace a block
write policy
when to write a block back to main memory
Programmed I/O
-Processor moves data between I/O module and memory. -Processor must wait for I/O to complete.
Interrupt-driven I/O
-Processor issues I/O command and then goes on to other processing. -An interrupt lets the processor know when the I/O is complete, at which time the processor moves the data.
Direct Memory Access (DMA)
-Processor delegates the I/O transfer to the DMA module. -When processor is notified of completion (by interrupt), the data has already been moved.
Symmetric Multiprocessors(SMP)
Single computer system having characteristics: -2+ processors of comparable capability -processors share same memory and I/O facilities and are interconnected by a bus such that memory access is about the same for each -processors share the I/O devices -system is controlled by an OS that manages the interaction between programs and processors
SMP Performance advantage
-Performance: if work can be done in parallel across the various processors, then there can be a performance gain.
SMP availability advantage
-Availability: since all processors have equal capability, a failing processor does not halt the system, but only reduces its performance.
SMP incremental growth advantage
-Incremental growth: performance can be enhanced by adding additional processors.
SMP scaling advantage
-Scaling: vendors can offer a range of products with different price and performance characteristics based on the number of processors in the system.
multicore computers
-Combines two or more processors on a single chip (a piece of silicon called a die). -Each core typically has all of the components of an independent processor, such as registers, ALU, pipeline hardware, control unit, and caches.
•Controls the execution of application programs and acts as an interface between the user and the system hardware.?
operating system
3 main objectives of OS
-Convenience: provide a user/computer interface. -Efficiency: act as a resource manager for the system. -Ability to evolve: adaptable to new features, updates and changes.
•The OS acts to ___ the user or programmer from hardware details, making it easier to access and use the system.
insulate
•The OS provides services like _____ _____ and control of _____ _____ that an end user or an application programmer needs but would not want to write each time a new program is written.
file management; I/O devices
OS services
-Program development -Program execution -Access I/O devices -Controlled access to files -System access -Error detection and response -Accounting
Instruction Set Architecture (ISA)
Defines the set of machine language instructions that a computer can follow. This is the interface between the hardware and the software.
Application Binary Interface (ABI)
Defines a standard for binary portability across programs. The ABI defines the system call interface to the OS and the hardware resources and services available in a system through the user ISA
Application Programming Interface (API)
Gives a program access to the hardware resources and services available in a system through the user ISA supplemented with high-level language library calls. Any system calls are usually performed through libraries.
Reason's OS's evolve
-Hardware upgrades plus new kinds of hardware -New services. This can be in the form of new capabilities the OS needs to provide (for a new application, for example). -Fixes. OS's have bugs, too.
serial processing
users had access to the system one at a time
JCL (job control language)
specifies setup steps for the monitor to reduce setup time
Desirable hardware features to support a batch OS
Memory protection timer privileged instructions interrupts
processor modes of operation
-user mode: for user programs, has limitations -kernel mode: for the OS, has no limitations
uniprogramming
•running one program at a time.
multiprogramming(multitasking)
running more than one program at a time.
______ is also important to determine which of the jobs to run next.
scheduling
_____ _____ is also more important for multiprogramming since several different jobs may be in memory.
memory management
Batch Operating System
•A "monitor" program accepts a batch of jobs from the operator and runs each one in turn. •The monitor (or most of it) remains in memory, called the "resident monitor".
Time sharing systems
•multiple users interact with the computer system through computer terminals. -Processor time is split among the set of users -works well since users are slower than CPU
Major advances in the development of OS's:
•Processes •Memory management •Information protection and security •Scheduling and resource management
3 major lines of development created timing and synchronization problems that led to the development of a process:
Multiprogrammed batch systems
Time-sharing systems
Real-time transaction systems
Real-time transaction systems
Supports applications written to perform a query or update against a database by a user, such as an airline reservation system.
Time-sharing systems
Processor time is shared among a number of active users by giving each user a slice of time
Multiprogrammed batch systems
Processor is kept busy by switching between programs in response to events such as I/O activity
•Running multiple programs at the same time presents a variety of problems, such as:
•Improper synchronization •Failed mutual exclusion •Nondeterminate program operation •Deadlocks
•Improper synchronization
Need a reliable way for one program to wait on another
•Failed mutual exclusion
-Need to prevent multiple programs from accessing a resource such as a file at the same time.
•Nondeterminate program operation
-Need program results to be independent of other programs running at the same time.
•Deadlocks
Need to avoid situations in which programs are waiting on each other
process list
•keep track of processes. contains an entry for each process •Each entry contains a pointer to the process in memory and perhaps process context information as well. •Other context information may be stored with the process in memory.
•Requirements for multiple processes in memory:
•Isolation •Automatic allocation and management •Support of modular programming •Protection and access control •Long-term storage
•Isolation
-Keep process from accessing or overwriting the memory of another.
•Automatic allocation and management
-Programmer should not worry about memory mgmt.
•Support of modular programming
-Create, destroy, alter size of modules dynamically
•Protection and access control
-Restrict or grant access as needed