Computing Systems W8 part 1 Flashcards
What is Operating System?
A program that acts as an intermediary between a user of a computer and the computer hardware
OS goals (3)
- Execute user programs and make solving user problems easier
- Make the computer system convenient to use
- Use the computer hardware in an efficient manner
What are the components of a computer system (4) ?
Hardware
OS
Application programs
Users
hardware
provides basic computing resources
ex. CPU, Memory, I/O devices
Operating System
controls and coordinates use of hardware
Application programs
define the ways in which the system resources are used to solve the computing problems of the users
ex. word processors, compilers, web browsers, database systems, video games
users
ex. people, machines, other computers
OS main jobs
- Resource allocations: manages all resources and decides between conflicting requests for efficient and fair resource use
- Control program to prevent errors and improper use of the computer
bootstrap
the first program to run on computer power-on. loads OS into RAM to start up computer.
Stored in ROM/EPROM ( within firmware) and initializes all aspects of the system. Loads
the operating system
ROM/EEPROM
read only memory (non-volatile)
electronically erasable programmable read-only memory
device controller (4)
The device controller manages the hardware-specific details of the I/O device
-managing device registers,
-generate & send interrupts to CPU
-maintains local buffer storage
-can connect to multiple I/O devices
device driver
acts as an interface between the device controller and the operating system
provides a standardized interface for the OS to communicate with different types of devices, abstracting the hardware details.
ex. translates high-level commands and requests from the OS into low-level commands that the device controller understands
single processor systems (single processing core)
computer system with one CPU with a single processing core
-general purpose core
-special purpose core
core
component of CPU that executes instructions and registers for storing data locally
- ALU
- Control Unit
- Registers
- Cache
multiprocessor system
system with multiple CPUs
-CPU can have one or multiple cores
processors share computer bus and sometimes clock, memory, and peripheral devices
multiprocessor system advantages
increased throughput*
(more work, less time)
Economy of scale (lower cost with higher processing power)
Increased reliability (graceful degradation/fault tolerance)
multiprocessor system disadvantages
overhead incurred keeping all parts working correctly
symmetric multiprocessing architecture (SMP)
Multiple processors with its own CPU, set of registers, and local cache that share main memory over the system bus
each peer CPU performs all tasks including OS functions and user processes
SMP advantages
- N processes can run if there are N CPUs without performance deterioration
SMP disadvantages
- Separate CPUs may lead to one to sit idle while the other is overloaded leading to inefficiencies
multicore systems
multiple computing cores on a single ship
- more efficient than multichip systems with single cores (on-chip communication is faster than between-chip communication) & uses less power
Computer-system organization
One or more CPUs, device controllers connect through common bus providing access to shared memory. Concurrent execution of CPUs and devices compete from memory cycles
local buffer
Local storage within each device controller
I/O transfer
CPU moves data from / to main memory to / from local buffers
I/O moves data from the device to local buffer within the device controller.
Interrupt pathway
User or software-generated interrupt is triggered
interrupt transfers control to ISR (Interrupt service routine) via interrupt vector
Address of interrupt instruction is then saved
CPU is then stopped to process interrupt (transfers execution to address of interrupt instructions)
Interrupt vector
Contains all the address of all the service routines
Interrupt: I/O to/from CPU transfer
device controller raises an interrupt by asserting a signal on the
interrupt request line
CPU catches the interrupt and dispatches it to the
interrupt handler
the handler clears the interrupt by servicing the device.
Direct memory access (DMA) structure
used for high-speed I/O devices
Device controller transfers blocks of data from device local storage directly to main memory via system bus (without CPU)
Only one interrupt is created for every block (instead of one interrupt per byte)
Wait instruction
CPU needs to pause and wait for the next interrupt. This instruction essentially puts the CPU in an idle state until an interrupt occurs.
wait loop
CPU repeatedly checks for the occurrence of a particular condition, often using a “polling” mechanism. This can create contention for memory access, as the CPU is frequently accessing memory to check for the condition.
system call
mechanism by which a program requests a service from the operating system
ex. request the OS to allow the user program to wait for the completion of an I/O operation
device status table
Allows the OS to keep track of the status of various devices and manage their operations effectively
It contains entries for each I/O device connected to the system, providing information such as the type of the device, its address, and its current state.
OS device status table management
OS indexes device table for specific entry to determine current state and make any modifications to device state change
OS can insert interrupt into table entry to notify CPU to asynchronously interrupt the normal execution of the CPU and transfer control to a specific interrupt handler routine.
RAM
random access memory
main memory that is volatile (will not save once power is off
secondary storage
hard disks: inexpensive, trustworthy (time), and longevity in its use. But is slow, susceptible to creating heat/noise and can be damaged
solid-state disks: slightly faster than HDD, consume less power, and are smaller. But is more expensive, higher risk for poor data recovery, and limited capacity
Storage system hierarchy comparator
speed
cost
volatility
caching
copying information into faster storage system for more efficient read/write operations
ex. main memory is a cache for secondary storage
Storage system hierachy
registers
cache
main memory
solid-state-disk
hard disk
optical disk
magnetic tape
memory hierarchy
L0: Registers
L1: L1 cache (SRAM)
L2: L2 cache (SRAM)
L3: Main Memory (DRAM)
L4: Local secondary storage (local disks)
L5: Remote secondary storage (tapes, distributed files systems, web servers)
cache example
search engines (google): search results are cached for frequently searched terms. Cache results can be quickly retrieved and improve the overall search experience
graceful degradation
In the event of a failure or malfunction in one processor, the remaining processors can continue to execute tasks.
System still operates at reduced capacity rather than shutting down
fault tolerance
Redundant components and error-checking mechanisms help in identifying and recovering from faults, ensuring continuous operation even in the presence of hardware or software failures.
(Redundancy means having duplicate or backup components that can take over in case of a failure.)
Hot standby
In a multiprocessor system, if one processor fails, another standby processor can take over, ensuring continuous operation.
Types of Multiprocessors
Asymmetric
Symmetric
Asymmetric Multiprocessor (AMP) pros (3) & cons (2)
Pros
-Task-oriented
-efficient for specialized processing
-scalable
Cons
-can lead to resource underutilization
-complex task management.
Symmetric Multiprocessor (SMP) pros (3) & cons (3)
Pros
-Task flexibility
-resource sharing
-ease of programming
Cons
-can have complexities in synchronization
-limited scalability
-potentially higher costs.
Asymmetric Multiprocessor (AMP)
Processors have specific, dedicated tasks. Specialized for certain workloads. Tasks are not necessarily interchangeable between processors.
Symmetric Multiprocessor (SMP)
All processors are identical and can perform any task. Workload is dynamically distributed among processors. Tasks are interchangeable between processors.
Dual-core design
One physical chip (system) that contains two separate processing cores (CPUs)
Each core is capable of executing its own set of instructions independently. This allows the processor to handle multiple tasks simultaneously, improving overall performance and responsiveness.
Storage-area network (SAN)
shared storage used by clustered system
Clustered System
multiple independent computers (nodes or systems) are connected together to work as a single system.
These nodes communicate with each other over a network and may have their own processors, memory, and storage.
Each node in the cluster is a separate system, and they collaborate to solve a common problem or perform a task.
Clustered System pros
Achieve high availability
(ability of a system to remain operational and accessible for a high percentage of time)
Asymmetric clustering
one machine is on hot standby
simpler in design & focus is on having a backup system available
Symmetric clustering
multiple nodes run application while monitoring each other
If a failure is detected in one node, the workload is redistributed among the remaining healthy nodes
better scalability and fault tolerance
multiprogramming (batch system)
maximize CPU utilization and enhance overall system efficiency by allowing the CPU to switch between different programs.
timeshare (multitasking)
CPU switches jobs so
frequently that users can interact with each job while it is running
response time < 1 second
Dual-mode operation
CPU can operate on two different modes (user & kernel)
provides a level of protection and control over system resources.
Kernel mode bit
0
A task will be executed on behalf of the OS
provides unrestricted access to hardware and system resources. Allows execution of privileged instructions and critical system tasks
User mode bit
1
A task will be executed on behalf of the user
restricted access to system resources and functionalities. It can execute a set of instructions and application programs
Kernel mode names
supervisor mode
system mode
privileged mode
life cycle of instruction execution
(0): Kernel mode: bootstrap program
(1): User mode: user application
Interrupt/trap/system call switches to (0) kernel mode
(0): Kernel mode: execution of privileged instruction completes then switches back to user mode (1)
(1): User mode: user application is resumed
trap
mechanism used to switch the CPU from user mode to kernel mode in response to a specific event
ex. user program executes and needs to perform privileged instruction. It makes a system call that generates a trap causing CPU to switch to kernel mode (0)
Timer (dual-mode)
Prevents user application from infinite loops and hogging resources
Once user process begins a timer starts counting down to generate an interrupt when time runs out which transfers control back to OS
Multi-mode operations (virtual machine manager VMM)
extension of dual-mode operation that have additional modes beyond user and kernel
ex. VMM mode supports a mode for virtualization. When virtual machine runs on a host system the CPU can operate on a mode that allows CMM to manage execution of multiple VMs