os and data storage
DESCRIPTION
OS and Data Storage. CSCI130 Instructor: Dr. Imad Rahal. Layered Architecture. Introduction. Software is the set of all programs that run on a computer VS Hardware : “Hard” Has a physical presence Comes in two forms System Software : controls the computer - PowerPoint PPT PresentationTRANSCRIPT
OS AND DATA STO
RAGE
C S C I 1 3 0
I NS T R U C T O
R : DR . I M
A D R A H
A L
LAYERED ARCHITECTURE
LAYER OrderApplication SW: Excel & Access
2
High-order P.L.: Visual Basic 1Low-order P.L.: Assembly 3System SW: O.S. 3Machine Language 4Data Representation 5HW: Circuit Design 6
INTRODUCTION
Software is the set of all programs that run on a computer
VS Hardware : “Hard”Has a physical presence
Comes in two formsSystem Software: controls the computerApplications Software: accomplishes user-defined tasks
SYSTEM SOFTWARE
Hide complex detailsRegisters, empty memory locations, starting location of program in memory operations in ALU, etc …Assembly translation programs (Assembler/Loader)
Computer users, and even programmers, do not have to be aware of such details
System software provides this great flexibilityInterface between user and hardware
SYSTEM SOFTWARE
Makes a virtual computer which hides almost all technical details from the user resulting in user-friendly experiences
No need to worry about details such as register size of memory location of a given program
The system takes care of it AUTOMATICALLY
Applications Software
System Software
Hardware
USEREvery data or instruction works its way through: Even a simple mouse click !
SYSTEM SOFTWARE
System software comes in three formsTranslation programs
E.g. assembler Assembly to machine language
More on this issue when we study other programming languages (next chapter)
Operating systemsUtility program
Communication programs
OPERATING SYSTEMS (OS)
A collection of programs that Manages your computerDefines HOW a computer will interact with the outsidePrepares programs and their data to interact with hardware
Booted up, The OS is loaded into main memory for initializationBIOS
BIOSs held in ROM (cannot be altered)Hides all details Giving us the illusion of being the only user whose entire program is loaded into memory
OS - SECURITY
Usernames and passwords are ubiquitous in OSs to control access to computers
Care must be taken in choosing usernames and passwords Programs can be written to try all words in a dictionary in order to guess your
password Long Meaningless to others NEVER SHARE
SYSTEM LEVELYou want to control the access to some resource or
file even for authorized users (i.e. having access to the computer) (OSs provide permissions
Read, Write, Execute or NONE Per file
OS maintains a list of authorized users per file along with their permissions
OS - I/O & AUXILIARY STORAGE
Passing of information between main memory and peripheral devices
I/O & Auxiliary StorageE.g. Printers, mice, keyboards, disks, tapes, etc …
For I/O: Translation of input data to binary and output data from binary (to whatever the I/O device is using)
For secondary storage: Supervision and organization of data stored on tapes and disks (Auxiliary storage)
OS - I/O & AUXILIARY STORAGE
Writing to DisksFind empty spaceTransfer data (No translation)Update disk directory (location of new file)Update list of empty spaceAttempts to optimize the use of available space How to find the best fit for a particular file?
First available position that could accommodate the file One with close size to that of the file Split into more that one position
OS - I/O & AUXILIARY STORAGE
Deleting from diskUpdate directory onlyRemove the files entryAdd space occupied by file to available spaceA fragmented disk usually has empty space but this
space is scattered all over the disk with not much contiguity
Defragmenters
CPU ALLOCATION
Single-user systems allocate all CPU time to one user/program
Multi-user systems? Sharing main memory and CPU timeCPU is very efficient Process between millions to billions of instructions per second Other devices on the computer aren’t as fast
Printers: 100 characters per second Disks:
several milliseconds to look up address in directory several milliseconds to locate track and sector (spin disk) and position the R/W
head Physical motion will always be slower than transferring electric pulses I/O bound
A machine whose performance is limited due to I/O CPU is idle most of the time
CPU ALLOCATION
Solutions Overlapped processing
Running other programs while current is waiting for I/O Good for I/O What about short programs waiting for long ones?
Starvation Multi-tasking (multiprogramming, timesharing)
All programs requesting CPU time will have access to it in timeslices All are in memory together and are listed in a a ready queue
MULTI-TASKING
1 CPU, 1 main memory with many usersWhen the CPU has time, it picks the first in ready
queue and runs it for a timeslice Saves a snapshot of the state of the current program (CU registers) Moves on to the next one and places the old back in the ready
queueAll processes run togetherUser won’t notice because the timeslice is very
short We CAN’T perceive time spans of less than 40-50 milliseconds Shorter timelices
+ Give the illusion of continuous process - Not very good if most of time is spent on saving the snapshots (wasted
time) We need to strike a balance
PARALLEL PROCESSING
As opposed to multi-tasking1 main memory, many CPUs with many
usersJobs can be distributed among CPUsEven one job can span many CPUs each
working on some subtaskVery complex processBeyond the scope of this course
OS - MEMORY MANAGEMENT
RAM VS Hard diskAssume multitasking1 CPU, many programsCan’t all fit in memoryOS keeps list of empty space Adds to it when programs are done
Fragmentation could happen
OS - MEMORY MANAGEMENT
Compaction
OS - MEMORY MANAGEMENT
Paging Allow one program to occupy many noncontiguous memory segments
(pages)
OS - MEMORY MANAGEMENT
Swapping What if there are no pages to fit all program? Start program by loading only needed pages Swap between needed and unneeded ones
NETWORKS
We are not in isolation anymore Help computers communicate Transfer data without physical intervention (i.e. not via disk or tape) Sharing resources
5 users and all want to access a printer?LANs Limited to a single building or campusWANs Span cities, countries and even continents
NETWORK TOPOLOGIES
Ring vs. Star topologies
CLIENT/SERVER MODEL – STAR TOPOLOGY
THE INTERNET & WEB
TYPES OF CONNECTIONS
Physical connectionsTwisted-pair wire
Two insulated copper wires wrapped around each other. Transmit electrical signals US phone system
Used to form WANs
NETWORKS
Coaxial cable Insulated copper wireUsed for cable TVsFaster and less prone to interference than twisted-pair but more expensive
NETWORKS
Fiber OpticsFastestTransfer light instead of electricity No weight
Less prone to interference
Expensive to install
WIRELESS NETWORKS
Wireless (non-physical) connections Radio waves (In LANs)
Where physical wiring isn’t very convenient Prone to a lot of interference from radio transmitters
Microwaves (In WANs) Use high frequency radio signals which travel easily but only in straight lines
Relay towers must be set up at intervals or satellites must be used for larger distances
Carries more data (high frequency)
WIRELESS NETWORKS
Types of electromagnetic waves
They only differ from each other in wavelength/frequency
Wavelength is the distance between one wave crest to the next
WIRELESS NETWORKS
The potential drawbacks to a wireless solution include
Intervening hills and tall buildings or trees can block the radio frequency (RF) signals "line-of-sight“: antennas must be able to "see" each other
Severe weather, can adversely affect signal transmission
Might be susceptible to other radio frequency interference
Dense fog could possibly be a problem for microwave links
NETWORKS
BandwidthDepends on the link between two computers
Measured in bpsTwisted-pair: 10-100 MbpsFiber optic: > 2400Mbps=2.4Gbps
NETWORKS OVER THE PHONE SYSTEM
Phone systems transfer data as continual electrical signals that forms a wave
Varied frequency and amplitudeAnalog signalComputer phoneDigital to analogComputer phoneDigital to analogModemCapable of transmitting a certain number of bits per second
>14,400 up to 56K
PROTOCOLS
Is a rules that governs the transmission of data within a network
How machines are addressedHow messages are addressedWho can view or transmit a sent messageHow will the message be packed/unpacked by sender/receiver
How to deal with transmission errorsSender, receiver and intermediaries must
agree on a communication protocol before communicating
PROTOCOLS
Sender steps Layer 1: (Application) A message is usually generated by some application on the
sender Layer 2: (Packaging) The message is packaged for transmission Layer 3: (Network) routing the message to receipt Layer 4: (Physical Link) does the actual sending
PROTOCOLS
Intermediary stepsLayer 3: (Network) consulted only here
Check message and forwardLayer 4: (Physical Link) consulted only here
Does actual forwardingReceiver stepsLayer 4: (Physical Link) comes thru to next layerLayer 3: (Network) Received hereLayer 2: (Packaging) checks for any transmission errors and unpacks
Layer 1: (Application) presents to user/program