Slide 2 - Hardware Concepts
Slide 2 - Hardware Concepts
System Structure
Hardware Concepts
Hardware
The term hardware refers to mechanical devices that makes up computer.
Hardware refers to the physical components of a computer system.
• Operating system, on the other hand, is a type of software that manages and
controls the hardware components of the computer.
Hardware Components
Computer hardware is a collection of several components working together. Some
parts are essential and others are added advantages. Computer hardware is made
up of CPU and peripherals as shown in image below.
External devices
An external device connected to an I/O module is often referred
to as a peripheral device .
External devices provide a means of exchanging data between the
external environment and the computer.
We can broadly classify external devices into three categories.
Classification of External devices
Human readable devices
A human-readable format is a representation of data or information that can be
naturally read by humans. These devices are suitable for communicating
with the computer users
Screen/monitor, printer, keyboard
Machine readable devices
Machine readable data includes files stored on disk or tape. Suitable for
communicating with equipment, capable of being read by a mechanical
device without additional processing
Magnetic disk, Barcode, Tape backups
Communication devices
Suitable for communicating with remote devices.
Modem
Network Interface Card (NIC)
Software
A set of instructions (programs) that drive a computer to do
stipulated/specific tasks. Software instructions are programmed in a
computer language, which is translated into machine language, and
executed by computer.
Interrupt Handling
The operating system preserves the state of the CPU by storing the registers and the program
counter
Determines which type of interrupt has occurred:
Separate segments of code determine what action should be taken for each type of interrupt
Interrupt-drive I/O Cycle
I/O Structure
A large portion of operating system code is dedicated to managing I/O module.
There are two methods for handling I/O
i. After I/O operation starts, control returns to user program only after an I/O completion
i. The form of interrupt-driven I/O described in the previous section is fine for moving small
amounts of data but can produce high overhead when used for bulk data movement.
ii. After I/O operation starts, control returns to user program without waiting for I/O
completion
Here direct memory access (DMA) is used. After setting up buffers, pointers, and counters
for the I/O device, the device controller transfers an entire block of data directly to or from
the device and main memory, with no intervention by the CPU.
Only one interrupt is generated per block, to tell the device driver that the operation has
completed.
While the device controller is performing these operations, the CPU is available to
accomplish other work/tasks.
Computer Startup
A Bootstrap program is loaded at power-up or reboot
• Typically stored in ROM or EPROM, generally known as firmware
• Initializes all aspects of system
• Loads operating system kernel and starts execution
A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage. For example,
most computers don’t have an instruction to move a bit but do have one to move a byte.
A less common term is word, which is a given computer architecture’s native unit of data. A word is
made up of one or more bytes. For example, a computer that has 64-bit registers and 64-bit memory
addressing typically has 64-bit (8-byte) words. A computer executes many operations in its native
word size rather than a byte at a time.
Bits, bytes, nibble and word
The terms bits, bytes, nibble and word are used widely in reference to computer
memory and data size.
• Bits: can be defined as either a binary, which can be 0, or 1.It is the basic unit of
data or information in digital computers.
• Byte: a group of bits (8 bits) used to represent a character. A byte is considered
as the basic unit of measuring memory size in computer.
• A nibble: is half a byte, which is usually a grouping of 4 bits.
• Word: -Two or more bits make a word. The term word length is used as the
measure of the number of bits in each word. For example, a word can have a
length of 16 bits, 32 bits, 64 bits etc.
Computer storage, along with most computer throughput (volume of data), is
generally measured and manipulated in bytes and collections of bytes.
A kilobyte, or KB , is 1,024 bytes; = 210
a megabyte, or MB, is 1,0242 bytes;
a gigabyte, or GB, is 1,0243 bytes;
a terabyte, or TB, is 1,0244 bytes; and
a petabyte, or PB, is 1,0245 bytes.
• Computer manufacturers often round off these numbers and say that a megabyte
is 1 million bytes and a gigabyte is 1 billion bytes.
• Networking measurements are an exception to this general rule; they are given in
bits (because networks move data, one bit at a time).
Storage Hierarchy
Storage systems organized in hierarchy
• Speed
• Cost
• Volatility
Caching – copying information into faster storage system; main memory
can be viewed as a cache for secondary storage
Device Driver for each device controller to manage I/O
• Provides uniform interface between controller and kernel
Why is memory organized in a hierarchy?
How do we guarantee that user does not explicitly set the mode bit to “kernel”?
• System call changes mode to “kernel”, return from call resets it to “user”
Some instructions designated as privileged, are only executable in kernel
mode.
System call – is the programmatic way, in which a computer program requests
for a service from the OS on which it is executed.
Timers in Operating systems
The timer is used to prevent a user program from running too long (infinite loop). A simple
technique is to initialize a counter with the amount of time that a program is allowed to run. A
program with a 7-minute time limit, for example, would have its counter initialized to 420.
Operating system sets the counter (privileged instruction), uses a system clock
Every second, the timer interrupts, and the counter is decremented by 1. As long as the counter is
positive, control is returned to the user program.
When counter zero, generate an interrupt
When the counter becomes negative, the operating system terminates the program for exceeding
the assigned time limit.“
Set up before scheduling process to regain control or terminate program that exceeds allocated
time
I/O Subsystem
One purpose of OS is to hide peculiarities of hardware devices from the user
I/O subsystem responsible for
• Memory management of I/O including buffering (storing data temporarily
while it is being transferred), caching (storing parts of data in faster storage
for performance), spooling (the overlapping of output of one job with input
of other jobs)
• General device-driver interface
• Drivers for specific hardware devices
Distributed Systems
Collection of separate, possibly different kinds of systems networked together
• Network is a communication path between connected nodes/devices. TCP/IP most common
protocol for networked systems.
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
Personal Area Network (PAN)
Network Operating System provides features between systems across network
• Communication scheme allows systems to exchange messages
• Create the illusion of a single system (not a bunch of disparate parts/nodes)
Computer-System Architecture
A computer system can be organized in a number of different ways, which we
can categorize roughly according to the number of general-purpose processors
used.
Single Processor Systems-Most systems use a single general-purpose processor
with a single core (a component that executes instructions and registers for
storing data locally.)
• Most systems have special-purpose processors as well
Multiprocessors systems growing in use and importance. Computer has 2 or
more processors each with a single core. These systems have evolved over time
and now includes multicore systems, in which multiple computing cores reside
on a single chip.
• Also known as parallel systems, tightly-coupled systems
• Advantages of multi-processors include:
1. Increased throughput - volumes of data processed in a given time
2. Economy of scale – efficient processor function
3. Increased reliability – graceful degradation or fault tolerance
• Two types:
1. Asymmetric Multiprocessing – each processor is assigned a specific
task.
2. Symmetric Multiprocessing – each processor performs all tasks
Symmetric Multiprocessing Architecture
Dual-Core Design
A Dual-core processor is a CPU that has two processing units in one integrated circuit. The cores work
simultaneously to achieve a much faster operating speed than a single-core processor.
The cores can handle the tasks simultaneously because each core has its own cache memory and
controller.
Multi-chip and multicore
Systems containing all chips - Chassis containing multiple separate systems
- Dual CPU systems require dedicated motherboards that enable installation of two CPUs. –But the CPUs
must be identical, otherwise your system will not boot
Clustered Systems
Clustered systems differ from the multiprocessor systems in that they are composed of two or
more individual systems—or nodes—joined together; each node is typically a multicore system.
• Usually sharing storage via a storage-area network Provides a high-availability -that is,
service that will continue even if one or more systems in the cluster fail.
Asymmetric clustering has one machine in hot-standby mode
Symmetric clustering has multiple nodes running applications, monitoring each other
• Some clusters are for high-performance computing
Applications must be written to use parallelization - (the technique of dividing a large
computational task into smaller-sub tasks that can be executed concurrently on multiple
processors/cores –hence reducing computation time)
• Some have distributed lock manager (DLM) to avoid conflicting operations
Computer System Environments
Traditional systems
Mobile
Client Server
Peer-to-Peer
Cloud computing
Real-time Embedded
Traditional systems
Stand-alone general-purpose machines
Most traditional systems interconnect with others (i.e., the Internet)
Portals provide web access to internal systems
Network computers (thin clients) are like Web terminals
Mobile computers interconnect via wireless networks
Networking is existing everywhere – even home systems use firewalls to
protect home computers from Internet attacks
Mobile systems
Handheld smartphones, tablets, etc.
What is the functional difference between them and a “traditional” laptop?
Extra features – more OS features (GPS, gyroscope)
Allows new types of apps like augmented reality
Use IEEE 802.11 wireless standard, or cellular data networks for connectivity
Leaders are Apple iOS and Google Android Operating systems.
Client Server systems
Client-Server Computing
• This computing model is based on the distribution of functions between two
types of independent and autonomous processors: servers and clients.
• A client is any process that requests specific services from server processes.
• Dumb terminals replaced by smart PCs
• Many systems now servers, responding to requests generated by clients
Computer-server system provides an interface to client to request services
(i.e., database)
File-server systems provide interface for clients to store and retrieve files
Peer-to-Peer
Another model of distributed system. P2P technology can be used
for instant messaging applications.
P2P does not distinguish clients and servers
• Instead all nodes are considered peers
• May each act as client, server or both
• Node must join P2P network
Registersits service with central lookup service on
network, or
Broadcast request for service and respond to requests for
service via discovery protocol
Examples include;
• Applications such as Skype - Voice over IP (VoIP) and WhatsApp use
P2P communication to enable users to chat and make voice and video
calls directly with each other.
Messages and media files are exchanged between users without needing a
central server.
Cloud Computing
Delivers computing, storage, even apps as a service across a network
Logical extension of virtualization because it uses virtualization as the base for it functionality.
• E.g Amazon has thousands of servers, millions of virtual machines, petabytes of storage available
across the Internet, pay based on usage
Many types
• Public cloud – available via Internet to anyone willing to pay
• Private cloud – run by a company for the company’s own use
• Hybrid cloud – includes both public and private cloud components
• Software as a Service (SaaS) – one or more applications available via the Internet (i.e., word processor)
• Platform as a Service (PaaS) – software stack ready for application use via the Internet (i.e., a database
server)
• Infrastructure as a Service (IaaS) – servers or storage available over Internet (i.e., storage available for
backup use)
Cloud computing environments can be composed of traditional OSs, plus Virtual Networks,
plus cloud management tools
• Internet connectivity requires security like firewalls
• Load balancers spread traffic across multiple applications
Real-Time Embedded Systems
Real-time embedded systems is the most prevalent form of computers
• They vary considerably, special purpose - limited purpose OS, real-time
OS
• They use a microcontroller (hardware) and unique application (software) to
solve a business problem.
Many other special computing environments as well
• Some have OSs, some perform tasks without an OS
Real-time OS has well-defined fixed time constraints
• Processing must be done within constraint e.g a fixed time boundary
• Correct operation only if constraints met
Free and Open-Source Operating Systems
Operating systems made available in source-code format rather than just binary closed-source
and proprietary
Counter to the copy protection and Digital Rights Management (DRM) movement
Started by Free Software Foundation (FSF), which has “copyleft” GNU Public License
(GPL)
• Free software and open-source software are two different ideas championed by different
groups of people
https://www.gnu.org/philosophy/open-source-misses-the-point.en.html
Examples include GNU/Linux and BSD UNIX (including core of Mac OS X), and many more
Can use VMM like VMware Player (Free on Windows), Virtualbox (open source and free on
many platforms - http://www.virtualbox.com)
• Use to run guest operating systems for exploration