0% found this document useful (0 votes)
69 views58 pages

Slide 2 - Hardware Concepts

This document provides an overview of computer system structure, including hardware concepts, hardware components, software types, and I/O device operation. It discusses how computer hardware consists of interconnected electronic devices like the CPU, memory, and peripherals. It also explains that system software operates directly on hardware and provides functionality, while application software performs tasks for users. The document outlines how I/O devices communicate with the CPU through device controllers and interrupts, and how storage media like RAM, ROM, and hard disks are organized in the computer system.

Uploaded by

cnajjemba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views58 pages

Slide 2 - Hardware Concepts

This document provides an overview of computer system structure, including hardware concepts, hardware components, software types, and I/O device operation. It discusses how computer hardware consists of interconnected electronic devices like the CPU, memory, and peripherals. It also explains that system software operates directly on hardware and provides functionality, while application software performs tasks for users. The document outlines how I/O devices communicate with the CPU through device controllers and interrupts, and how storage media like RAM, ROM, and hard disks are organized in the computer system.

Uploaded by

cnajjemba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 58

Overview of Computer

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.

Computer hardware consists of interconnected electronic devices that we can use


to control computer’s operation, input and output. Examples of hardware are
central processing unit (CPU), memory, hard disk, keyboard, mouse, monitor,
etc.

• 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.

Software can be categorized into two types −


• System software
• Application software
System Software
System software operates directly on hardware devices of
computer.
• It provides a platform to run an application.
• It provides and supports user functionality.

Examples of system software include;


• Operating systems such as Windows, Linux, MacOS, Unix,
etc.
• Utility software like device drivers, anti-viruses
Application Software
An application software is designed for the benefit of users to perform
one or more tasks. Examples of application software include Microsoft
Word, Excel, PowerPoint, Oracle, web browsers, etc.
Differences between Software and Hardware are sorted out below
Computer System Organization
Device Controllers in Operating Systems
In computer systems, I/O devices do not usually communicate with the
operating system. The operating system manages their task with the
help of one intermediate electronic device called a device controller.

• A device controller is a system that handles the incoming and


outgoing signals of the CPU by acting as a bridge between CPU and
the I/O devices. A device is connected to the computer via a plug and
socket, and the socket is connected to a device controller.
• Device controllers use binary and digital codes. An IO device
contains mechanical and electrical parts. A device controller is the
electrical part of the IO device.
 A device controller is in charge of a specific type of device
 A device controller maintains some local buffer storage and a set of
special-purpose registers.
 The device controller is responsible for moving the data between
the peripheral devices that it controls and its local buffer storage.
 OS’s have a device driver for each device controller.
 The device driver understands the device controller and provides
the rest of the Operating system with a uniform interface to the
device.
Computer-System Operation

 I/O devices and the CPU can execute concurrently


 Each device controller is in charge of a particular device type
 Each device controller has a local buffer
 Each device controller type has an operating system device driver to manage it
 CPU moves data from/to main memory, to/from local buffers
 I/O is from the device to local buffer of controller
 Device controller informs CPU that it has finished its operation by causing an
interrupt- alert the CPU to events that require attention
Common Functions of Interrupts
 Interrupt transfers control to the interrupt service routine generally, through the interrupt vector,
which contains the addresses of all the service routines
 Interrupt architecture must save the address of the interrupted instruction
 A trap or exception is a software-generated interrupt caused either by an error or a user request
 An operating system is interrupt driven.

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

• Firmware is a form of microcode or program embedded into hardware devices


to help them operate effectively. Hardware like cameras, mobile phones,
network cards, optical drives, printers, routers, scanners, and television remotes
rely on firmware built into their memory to function smoothly.
Storage Structure
 The CPU can load instructions only from memory, so any programs must first be loaded into
memory to run.
 Main memory – only large storage media that the CPU can access directly.
• Also called Random access Memory(RAM)
• Typically volatile and cannot hold bootstrap program (the first program to run on
computer power-on or reboot which then loads the operating system.)
• Typically random-access memory in the form of Dynamic Random-access Memory
(DRAM)
 Erasable programmable read-only memory (EEPROM)—storage that is infrequently written
to and is nonvolatile. EEPROM can be changed but cannot be changed frequently. It is low
speed, and contains mostly static programs and data that aren’t frequently used. For example, the
iPhone uses EEPROM to store serial numbers and hardware information about the device.
 Secondary storage – extension of main memory that provides large nonvolatile storage
capacity
 Hard Disk Drives (HDD) – rigid metal or glass platters covered with magnetic
recording material
• Disk surface is logically divided into tracks, which are subdivided into
sectors
• The disk controller determines the logical interaction between the device
and the computer
 Non-volatile memory (NVM) devices– these are faster than hard disks, non-
volatile
• They exist in Various technologies
• Becoming more popular as capacity and performance increases, price drops
Storage Definitions and Notation Review
The basic unit of computer storage is the bit. A bit can contain one of two values, 0 and 1. All other
storage in a computer is based on collections of bits. Given enough bits, it is amazing how many
things a computer can represent: numbers, letters, images, movies, sounds, documents, and programs,
to name a few.

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?

The major design objective of any memory system is;


 To provide adequate storage capacity at
-An acceptable level of performance
-At a reasonable cost

 Memory hierarchy is essentially employed to organize memory in such a


way that data access time can be minimized and achieve efficient
operations, hence improving system performance.
• Since CPU registers are the fastest to read and write, they are placed at the top of
the hierarchy.
Storage-Device Hierarchy
Operating-System Operations
1. Bootstrap program – simple code to initialize the system, load the kernel.
Typically, it is stored within the computer hardware in firmware. It initializes
all aspects of the system, from CPU registers to device controllers to memory
contents. The bootstrap program must know how to load the operating system
and how to start executing that system. To accomplish this goal, the bootstrap
program must locate the operating-system kernel and load it into memory.
2. Kernel loads.
3. Starts system daemons (services provided outside of the kernel). They run
the entire time the kernel is running. Once this phase is complete, the system
is fully booted, and the system waits for some event to occur.
 In windows OS –they are called windows services e.g synchronization, httpd
 In macOS – they are agents
A system daemon is a specific action or event within the system initiates a daemon
program when needed. For example, a daemon background process starts running
when:
 The user installs a piece of software on their system
 A specific service is installed on the server.
 A daemon computer process usually runs continuously in the background, but if
it’s lying dormant, it can occasionally wake up when faced with periodic
requests. These commands often come from remote processes.
 In essence, the OS alerts the daemon to the request. A daemon can then either
respond to it on its own or forward the request to another program or process.
Example: a synchronization daemon computing process is running in the
background of a system. Once the user saves a file in a folder, the daemon will
detect the action and automatically sync the updated file to a remote server. It will
do that automatically for every subsequent instance, ensuring the files are always up
to date without user intervention.
4. Kernel is interrupt driven (hardware and software)
• Hardware interrupt by one of the devices
• Software interrupt (exception or trap):
Software error (e.g., division by zero)
Request for operating system service – system call
Other process problems e.g infinite loop, processes modifying each
other or the operating system
Multi-programming (Batch system)
 Single user cannot always keep CPU and I/O devices busy
 Multi-programming organizes jobs (code and data) so that CPU
always has one to execute
 A subset of total jobs in system is kept in memory
 One job is selected and run via job scheduling
 When job has to wait (for I/O for example), OS switches to another
job
 A logical extension of Batch systems – the CPU switches jobs so frequently that
users can interact with each job while it is running, creating interactive
computing
• Response time should be < 1 second
• Each user has at least one program executing in memory  process
• If several jobs ready to run at the same time  CPU scheduling
• The CPU scheduler selects from among the processes in ready queue, and
allocates the a CPU core to one of them. Queue may be ordered in various
ways.
• If processes does not fit in memory, swapping moves them in and out to run.
Swap in removes the process from hard drive(secondary memory) and swap
out removes the process from RAM(main memory).
• Virtual memory allows execution of processes not completely in memory
Memory Layout for Multi-programmed System
Dual-mode Operation
Dual-mode operation is designed to provide a layer of protection and stability
to computer systems by separating user programs and the operating system,
into two modes: user mode and kernel mode.
User mode restricts access to privileged resources, while kernel mode has full
access to these resources.
 Dual-mode operation allows OS to protect itself and other system components
• User mode and kernel mode
• If the computer system is executing on behalf of a user application, the
system is in user mode
 Mode bit is provided by hardware
• Provides ability to distinguish when system is running user code or kernel
code.
• When a user is running a program  mode bit is “user”
• When kernel code is executing  mode bit is “kernel”

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

You might also like