Computer Science Chapter 6 Notes

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

RESOURCE MANAGEMENT

System resources
6.1.1,3,4
● primary memory
- RAM (Random-Access Memory) - memory in which each cell (byte) can be directly
accessed. Volatile.
- ROM (Read-Only Memory) - cannot be changed, placing information is called burning
(when e.g. manufactured). Stores instructions to start itself and frequently used software.

● secondary (auxiliary) storage - storing data no longer processed -


input/output device, mass storage devices.
- Magnetic tape - physical movement
- Magnetic disks - read/write head (arm), data can be accessed
directly:
- cylinder number → tracks (concentric circles) divided
into sectors → holds a block of information
- seek time - time for the read/write head to get positioned
- latency - time of the sector to be in position under r/w head
- access time - time it takes for a block to start being read, sum of ↑
- transfer rate - rate at which data moves from disk to memory
- CDs (Compact Disk) - laser, optically stored information, one track
- DVDs (Digital Versatile Disk)
- Flash Drives - thumb drive - USB (Universal Serial Bus)
- is used to build SSD (Solid State Disks) - no moving parts, might wear out

● processor speed - processor does all calculations in a computer system. Speed is a measurement of
how many calculations can be done per second (1Ghz=1 billion calculations per second)
○ Processor will take longer to perform tasks
○ Each processor has at least 1 ALU or core. If you have 2 ALUs you can do two operations
at once, etc.
○ If you have only one core, you can only perform one set of operations/calculations at a
time. If you have two or more you can do more calculation in the same time frame. It
affects how many tasks a system can cope with simultaneously.

● bandwidth - Measurement of how much data can be sent at same time in a certain time frame (also
called bitrate) (bps bits per second)

● screen resolution - number of pixels in height x width of display


● disk storage,
● sound processor,
● graphics processor - complex graphic processing (like 3D rendering)
● network connectivity - NIC (LAN), WNIC (WiFi), Bluetooth, 3G/5G radio - cellular signal, USB -
universal serial bus, HDMI (High-Definition Multimedia Interface), VGA (Video Graphics Array)

6.1.2
● mainframes - in large companies, many cores and huge memory
● servers - data centers for “cloud storage”, in PC’s
● PCs - Desktops
● sub-laptops - netbooks (before tablets)
● cell phones, PDAs (Personal Digital Assistants - listonosz podpis), digital cameras

Multi-programming system = system that can have different programs (apps) installed
Single programming system = can only run one program/set of programs

Von Neumann Architecture

Abstraction:​ what does the number represent?


Instruction/value/integer/part of image?
Without knowing the context there is no way of saying.

Arithmetic/Logic Unit (ALU)​: performs arithmetic


operations (addition, subtraction, multiplication, division)
and logical operations (comparison - and, or, not)
Register​: small storage area in the CPU - intermediate values
or special data - in ALU
Input Unit​: device that accepts data to be stored in memory
Output Unit​: device that prints or returns data stored in memory
Control Unit​: controls actions of other components
Instruction Register​: contains instruction currently being executed
Program Counter​: contains address of the next instruction
bus​: wires through which data travels.
- information
- address - memory location
- data
- control
- bus width: the number of bits that can be transferred in parallel over the bus
cache memory​: small, high-speed memory used to hold frequently used data
pipelining​: breaking an instruction into smaller steps that can be overlapped
motherboard​: main circuit board of personal computer
CPU ​contains ALU and CU (IR & PC)

Fetch-Execute Cycle​: storing, retrieving, processing data


- Fetch the next instruction: IR, updated PC
- Decode the instruction: CU has to recognize the type → control
signals
- Get the data in needed: ALU sends address to the memory bus
- Execute the instruction: ALU

Touch Screens
- resistive - two layers - vertical and horizontal lines of electrically conductive material, small
amount of space → touch lead to contact and current flow;
- capacitive - laminate over a glass screen - strength of the electricity flow from each corner
- infrared - crisscrossing horizontal and vertical beams of infrared light over the surface of the screen
→ sensors
- surface acoustic wave (SAW) - high frequency sound waves
Embedded systems​ - ROM, one task only
Parallel Architectures​ - more processors
- Parallel Computing, SIMD (single instructions, multiple data),
synchronous processing,
- Pipeline
- Shared-memory parallel processor
Classes of Parallel Hardware
- Symmetric multiprocessors (SMPs) - multiple identical cores

Role of operating system


Application software​ - programs that help us solve real-world problems
System software​ - manage computer system and interact with hardware
Operating system​ - system software that manages computer resources and
provides an interface
Multiprogramming​ - keeping multiple programs in main memory at the same
time, competing for CPU
Memory management​ - how and where programs are loaded in main memory
Process​ - dynamic representation of a program during execution
Process management​ - information for active processes
CPU scheduling​ - determining which process in memory is given
access to the CPU

Batch processing​ - program and system resources are coordinated and


executed without interaction between user and program

Timesharing​ - CPU time is shared among multiple interactive users


Virtual machine​ - illusion created by timesharing system that each
user has a dedicated machine
Mainframe​ - multi-user computer often associated with early timesharing systems
Dumb terminal​ - monitor and keyboard that allowed the use ro access the mainframe computer
Real-time system​ - response time is crucial given the nature of the application domain (reactor, missile)
Response time​ - time delay between receiving a stimulus and producing a response

Memory Management
Logical address​ (virtual/relative)- a reference to a stored value relative to the program making the reference
Physical address​ - actual address in the main memory of the device
Address binding​ - mapping from logical to physical address

Single Contiguous Memory Management​ - a program is loaded into one continuous area of
memory:
- logical address + starting address (after operating system)
- simple to implement and manage
- wastes memory space and CPU time
- application program takes the rest of memory which it might not need
Partition Memory Management:​ program must fit into one partition
- fixed - memory is divided into specific number of partitions into which programs
are loaded
- dynamic - memory is divided into partitions as needed to accommodate programs
base register - a register that holds the beginning address of the current partition
bounds register - a register that holds the length of the current partition
partition selection:
- First fit - first one big enough to hold it (fixed)
- Best fit - smallest partition big enough to hold it (fixed)
- Worst fit - largest partition big enough to hold it (dynamic)

Paged Memory Management​ - processed are divided into fixed-size pages and stored in
memory frames when loaded
- frame - a fixed-size portion of main memory that holds a process page
- page - a fixed-size portion of a process that is stored into memory frame
- page-map table (PMT) - table used by the operating system to keep track of
page/frame relationships
- logical address <page, offset> (<2, 518>)
- physical address = frame number * frame size + offset
- demand paging - extension to paged memory management in which pages are
brought into memory only when referenced (on demand)
- page swap - bringing in one page from secondary memory, possibly causing
another to be removed
- virtual memory - illusion that there is no restriction on program size because an
entire process need not be in memory at the same time
- thrashing - inefficient processing caused by constant page swapping

Process Management
Process States​ - conceptual stages through which a process moves as it is managed by operating system
- new state - process is being created
- ready state - no barriers to its execution, waiting for CPU
- running state - is being executed
- waiting state - waiting for resources
- terminated state - completed

Process Control Block​ (PCB) - data structure used by the operating


system to manage information about process
- context switch - exchange of register information that occurs when one process is removed from
the CPU and another takes its place
CPU Scheduling​ - determining which process in the ready state should be moved to the running state.
- nonpreemptive scheduling - CPU scheduling that occurs when the currently executing process
gives up the CPU voluntarily
- preemptive scheduling - CPU scheduling that occurs when the operating system decides to favor
another process, preempting the currently executing process
- turnaround time - metric that measures the elapsed time between a process’s arrival in the ready
state and its ultimate completion
First Come, First Served (FCFS) - scheduling approach
- in order in which they arrive in the running state
- non preemptive
- lack of attention to important factors such as service time requirements
Shortest Job Next (SJN)
- non preemptive
- guesses
Round Robin
- time slice (time quantum) - amount of time given to each process
- preemptive (expiration of time slice)
- considered the most fair

You might also like