0% found this document useful (0 votes)
5 views27 pages

CMS Textbook Topic 6 HL

The document discusses various types of computer memory, including SRAM, ROM, and different forms of secondary storage, highlighting their roles in data processing and storage. It also covers the performance of processors, memory bandwidth, screen resolution, disk storage types, and the evolution of computing devices such as laptops, tablets, and smartphones. Additionally, it touches on the significance of mainframes and supercomputers in handling large-scale data processing tasks.

Uploaded by

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

CMS Textbook Topic 6 HL

The document discusses various types of computer memory, including SRAM, ROM, and different forms of secondary storage, highlighting their roles in data processing and storage. It also covers the performance of processors, memory bandwidth, screen resolution, disk storage types, and the evolution of computing devices such as laptops, tablets, and smartphones. Additionally, it touches on the significance of mainframes and supercomputers in handling large-scale data processing tasks.

Uploaded by

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

Top

primary memory while SRAM is used in small quantities to speed up the overall performance
by the caching technique, which balances the speed of DRAM with that of the much faster
processor. The much faster SRAM is placed between the processor and the DRAM and
directly feeds the processor. Data is moved from DRAM to SRAM and then to the processor
and vice versa. This process has maximum benefits and performance when frequently-used
instructions and data are stored in SRAM. The task of storing the correct data in SRAM is not
always an easy task. Level 1 cache memory is usually built onto the processor while level 2
cache memory is on a separate chip located between the processor and the larger DRAM.

ROM
Read Only Memory (ROM) is non-volatile and slower than RAM. ROM is used to hold critical
instructions used to start up a PC. A common use of ROM is to hold the Basic Input Output
System (BIOS) which makes it possible for a PC to boot and sometimes to hold the entire OS
for old small home computers (e.g.: Personal CP/M ROM-based version of CP/M 2.2 for
small home computers developed by Digital Research Inc. and MSX Small ROM-based
version of MS-DOS for Z80 home computers developed by Microsoft Corp.). ROM is also
used in embedded microprocessors, microcontrollers and control systems.

Secondar�e

Secondary storage, auxiliary storage and backing store are terms that refer to hardware
that provide data integrity, low cost, mass storage capacity and permanent storage. There
are two broad types of secondary storage devices: the first uses direct access while the
second uses sequential access.

Direct access storage techniques


The devices that fall into this category have the ability to access, retrieve and store any
particular data without having to read through all previous data. Floppy disks, CD-ROMs,
Hard disks, DVDs, USB sticks etc. belong to this category.

Sequential access storage techniques2


The devices that fall in this category have to read sequentially through all previous data
before locating the requested data. Magnetic tapes, which belong to this category, are not
only used in old science fiction movies, and are certainly not a dead technology. It is a major
storage medium and recently. IBM Research and Fuji Film have produced a magnetic tape
with a record density of 123 billion bits of uncompressed data per square inch. This
technology allows secure storage for 30 years, built-in data encryption, low cost and less
energy consumption. Magnetic tapes are ideal for backup purposes.

Processors:且eed

A processor repeats the fetch, decode, execute cycle continuously as long as the computer is
turned on. MIPS (Million Instructions Per Second) is used to measure the performance of a
processor. MIPS is only an approximation of a processor's performance since it does not take
into account the fact that sometimes a single instruction may operate on many operand

2 IBM sets new tape storage record. (13, April, 2015). In New Atlas. Retrieved 19:05, June 13, 2016,
from http://www.gizmag.com/ibm-tape-storage-record/36931/

产 69 |
fetches and stores, some instructions have a higher effectiveness than others, and some
processors have the ab仆ity to execute several instructions simultaneously.

--------------------------------------------------------



' ,,


MIPS
{

II
Processor Clock Frequency (Master Clock MCLK)
= Average numberofclockCycles Per complete Instruction (CPI) * 1000000
I
I

cycles/second million instructions


= cycles = second
( ) * 1000000
instruction
、 、,________________________________________________________,. / I
The clock rate refers to the frequency at which the processor is running and is commonly
used as a rough indicator of the processor's performance. The unit used is hertz and in the
case of multicore processors the clock rate is the same for all cores. The clock rate of
modern processors is measured in gigahertz {GHz). It is very important to mention that the
clock rate should not be used as a perfectly reliable measure of the performance of different
processor families.

Figure 6.1: Installation of a modern processor in a CPU socket on the motherboard

Bandwidth

Memory bandwidth is the rate at which data can travel from SRAM and DRAM to the
processor and vice versa and is essential to the performance of a CPU. It is expressed in
millions of bits per second or in Mb per second (Mb/s). The peak theoretical bandwidth,
which is typically one word per bus cycle, is not the same as the sustained memory
bandwidth, which is less and is affected by various design features.

-剿ll| \ -户 ”- -—| - I
Screen resolution

All digital television sets, computer monitors, tablet touch-screens and mobile phone
screens have a maximum number of distinct pixels that can be used to display video,
pictures, text etc. This is mentioned as Maximum resolution= Width x Height, where Width is
the number of distinct pixels in the horizontal dimension and Height is the number of
distinct pixels in the vertical dimension. Most devices can support a number of different
resolutions. A rule of thumb is that higher resolutions need more memory and more
processing power.

1920�s 3840 pixels

i
g I

卜-匾-一 --A臼
叩 “』
凰三向

一,z,:
-`-.-千' 沁
胃·,.•二
、• •• 、、

-,一

r --
l

Full HD

Ultra HD

(FHD} 亨 (UHD/4K)
7680 pixels
Sf
8X!
d OZ&寸

Full Ultra HD
(FUHD/8K)

Figure 6.2: TV display with resolution comparisons

Diskstoraqe

Disk storage is a general category of metal or plastic storage plates on which data can be
recorded. The rotating disk(s) are mounted on a central spindle. Common disk storage
devices are the hard disk drive (HDD), the floppy disk drive (FDD) and various optical disc
drives. Nowadays HDD, solid state drives (SSD) and solid state hybrid drives (SSHD) are the
main disk storage systems used in most computers. SSDs are very expensive, very fast, more

尸 71 |
durable and consume less energy.
HDDs are very cheap, present slower
boot times, can cover all storage
requirements and are cost-effective.
SSHD share the benefits but also the
disadvantages of HDDs and SSDs and
they probably provide the best
affordable combination of perform­
ance characteristics.

Smmd..n.mcessor

Sound cards facilitate the input, Figure 6.3: Hard disk


process and output of audio signals.
In most cases they are integrated
onto the motherboard, while some
advanced models are sold as separate
cards that use an expansion slot of
the motherboard. Professional sound
cards act like audio interfaces and are
hosted in external rack-mountable
units and connect through USB,
FireWire, or an optical cable. Sound
processors have the ability to convert
analog sound to digital files, digital
files to analog sound and process Figure 6.4: Sound card
multiple audio channels.

�ocessor

General-purpose processors are not efficient at running demanding computer-generated


imagery algorithms. This is the primary reason for the evolution of GPUs (Graphics
Processing Units). Modern GPUs are massively parallel processors, very efficient at
manipulating and processing graphics and
images. Their technical characteristics make
them ideal for running algorithms that require
processing of large blocks of graphics data and
computer generated imagery. Their rapid
evolution has been driven by the video game
entertainment industry, which is a fast growing
sector with great potential. Faster GPUs are sold
as separate cards that use an expansion slot of
the motherboard, while some low-end models
are embedded on the motherboard or are Figure 6.5: Graphics card
integrated with the main processor circuit.
遍·; ,, . `,
-' ., C' .
、'` ', ,~ 暑 ' ,.·、^?'亡, -,_·,、:.. . i'蠡 '. ..,:`,.'· ·,. : :, '

Networkconnectivity

Some computers have various network connectivity capab仆ities. A laptop which is equipped
with both a wired Network Interface Card (NIC) and a wireless NIC will outperform a tablet
which is only equipped with a wireless NIC. In this case, the laptop presents a better network
connectivity solution. On the other hand, a lot of modern tablets are 4G enabled meaning
that they have SIM (Subscriber Identification Module) card slots. This greatly enhances their
ability to work and stream various media on the move.

6.1.2 Availability of resources

勹1 上一 t...”“ 叫-盲�l•r-

Mamframes

Together with supercomputers, mainframes, or "big iron" are the flagships of computing.
They are used by large organizations for critical applications, to handle large-bandwidth
communication, bulk data processing such as census, industry, defense, consumer statistics,
enterprise resource planning and large-scale transaction processing. IBM is the leading
company in the sector of mainframe production and in 2015 announced the production of
3
Z13 . Mainframes are the largest computer systems available and are typically housed in
isolated, air-conditioned rooms. Mainframes are equipped with extremely great processing
power, vast amounts of RAM, arrays of disks and backup tapes, and serve hundreds of user
terminals. They are able to handle high volumes of input and output and run a lot of
different applications concurrently.

、一了一 二


I

|I

Figure 6.6: Mainframe

3The digital revolution demands a better server. In IBM. Retrieved 20:05, June 14, 2016, from
http://www-03.ibm.com/systems/z/hardware/zl3.html


1 73
|
SuJ2filQJJ1J2uters

They are very fast and expensive, and


focus on mathematical calculations,
weather forecasting, climate research,
molecular modelling, scientific and
engineering applications. The perfor­
mance of a supercomputer is meas­
ured in floating-point operations per
second (FLOPS). New supercomputers
exceed 10 PFLOPS drawing on the
power of more than 30000 processors.
The first supercomputers were comp­
act designs that used the local
parallelism approach, while the latest
Figure 6.7: A supercomputer
designs are considered as massively
parallel systems equipped with multiple arrays of computers and processors.

Servers

A server is software, hardware, or both and provides various services to clients. The client­
server model is fundamental in computer networking and modern servers serve database,
file, email, game, application etc. requests from various clients. Servers need multiple
network connections for advanced performance, a lot of RAM to support multiple requests,
fault tolerance and ease of repair without the need of shut down, advanced backup
facilities, superior security characteristics and various automation capabilities.


Microcomputers and home computers were the first terms used to describe what we now
call Personal Computers (PC). Years ago the computer hierarchy had three classes:
mainframes, minicomputers and microcomputers. The term PC is widely used to describe a
device capable of supporting the computational needs of one user at a time. Nowadays PCs
are inexpensive solutions that can run various software applications. Popular OSs for PCs
are MS Windows, MacOS and LINUX.

Laptops

The rapid change in working patterns and the increased need for mobility have favored the
popularity of mobile devices. Modern laptops are not a compromise in comparison to a PC.
Moreover, they have long-lasting batteries that can be used to support hours of computing.
Laptops, mobile workstations, desktop replacements, sublaptops, notebooks and
subnotebook are terms used to describe mobile PCs with different weights and dimensions,
as well as graphic-displays, processors, RAM, secondary storage and battery capabilities. It
is important to mention that most laptops include input devices like a camera and a
microphone and output devices like speakers. Touch-screens are now widely used as input
devices and facilitate tasks such as drawing and editing.
I 丸 ======______圈�
Tablets

A tablet is a mobile computer equipped with a touch-screen display which is used as both an
input and an output device. Tablet users can take advantage of the touchscreen to enter text
using the virtual keyboard or the built-in handwriting-recognition facility. The use of various
gestures completely replaces the need for a mouse, while finger and stylus pens are widely
used in all applications. iOS, Android and Windows are the major OS for tablets. Hybrid
tablets have a detachable keyboard and closely resemble laptops. Tablets are equipped with
sensors like fingerprint, three-axis gyro, GPS and accelerometers, front and rear cameras,
Bluetooth for connecting peripherals, Wi-Fi for networking and powerful batteries.
Specifications for high-end tablets include 2732x2048 pixels display, 12.9" screen, 128 GB
internal storage, 3 GB RAM, slot for 16 to 128 GB microSD (Secure Digital) memory card,
octa-core processor, 12.0 MP camera and 24-bit/192kHz sound. Various developers can
develop apps for tablets and distribute them online through application stores like Apple's
App Store and Google's Android Play/Store.

PDAs

Personal digital assistants (PDA), were used until 2010 as electronic agendas, calendars and
personal information systems. Nowadays smartphones offer all the capabilities once
provided by PDAs. Common OS for PDAS were Palm OS, BlackBerry OS and Windows CE.

Cellphones

A smartphone or smart phone is a mobile phone (portable


telephone) whose hardware components and software are
managed by a mobile operating system. Nowadays smartphones
combine features of PCs, PDAs, cameras, media players and GPS
navigation units. All smartphones can access the Internet, are
equipped with touchscreens that enable the user to interact
directly with what is displayed, can run third-party applications
and have photographic capabilities that approach those of mid­
level point-and-shoot cameras. They also support high-speed
mobile broadband through 4G LTE, Wi-Fi connection and
Bluetooth connection. They also feature RFID solutions, motion
sensors, a fingerprint sensor, accelerometer, gyro sensor,
proximity sensor, compass, barometer and heart rate monitor,
Figure 6.8: A smartphone
as well as mobile payment transactions and geotagging
mechanisms. Modern smartphones use iOS, Windows and Android OSs. Various developers
can develop apps for smartphones and distribute them online through application stores like
Apple's App Store and Google's Android Play/Store. Specifications for high-end smartphones
include 1440x2560 pixel display, 64 GB internal storage, 4 GB RAM, slot for 16 to 128 GB
microSD (Secure Digital) memory card, octa-core processor and 24-bit/192kHz audio.

』冒 ,· ~ 75 |
吨ital cameras

A digital camera encodes images and videos


digitally and stores them in the attached
memory card for later reproduction. High-end
products have a 30.4 Megapixels sensor and are
equipped with an LCD viewfinder, as well as a
GPS sensor. They support various image formats,
such as JPEG and RAW, as well as video formats,
such as MP4. They can record 4K video and
connect to a computer system through a USB
interface or Wi-Fi connection. They may also
Figure 6.9: A digital camera
include HDMI output, analog stereo audio
output and analog video output (NTSC/PAL). All the signal processing and control functions
of a digital camera are performed by a dedicated specialized processor.

6.1.3 Limitation of resources

Sometimes when a computer system is active the request for services exceeds the
availability of resources. Memory is a typical example of system resources. Every time one
opens an application the OS is reserving a particular amount of memory that the program
needs to operate. If a PC is equipped with 8 GB of RAM, the available memory to run various
applications is around 6 GB because the OS and various programs that load during the
startup process utilize a total of 2 GB. Although the OS will do its best to satisfy ones
requests, the launching of more and more applications will lead to an "Out of Memory"
message or a very slow computer.

In computer-generated imagery (CGI}, rendering is the process of generating a 2D or 3D


graphic and exporting it to an image file. It also refers to the process of adding effects during
the video editing process, in order to generate a final product. The rendering process
involves complex mathematics and the solution of the rendering equation. This integral
equation must be solved by rendering software to produce realistic graphics. Although the
advances in personal computer resources allow an image to take less time to render than
before, state-of-the-art image quality needs specialized solutions, such as render farms.
These high performance computer systems are used by professionals to render computer
generated imagery.

A single core single processor system may not be able to perform demanding tasks or run
complex mathematical models efficiently. A multicore or a multiprocessor system may be
more efficient. A single processor system may have an IC (Integrated Circuit) with multiple
cores. In a multiprocessor system two or more ICs are mounted on the motherboard. Each

|3
屯宁 污霆罩鄱黜面陌f!Fk',产-
~', 一一


:凳沪翌::「~`

I
IC could have more than one core. A multiprocessor system is more expensive, needs
complex configuration and usually runs multiple programs faster, whereas a multicore
system usually runs a single program faster and is considered as the best choice for
everyday users. This, oversimplified, statement assumes that the comparison takes place
between ICs with the same characteristics and clock speeds. It is important to keep in mind
that in a multicore system, the main cache memory is shared by all the cores.

A computer system may have one or more standalone GPUs. A single GPU is what most
users opt for. It is an economical and powerful option that can serve as many as 4 different
monitors, play HD video, and provide gaming capabilities. If someone wants to play an
action game in a 4K resolution then using a single GPU may not allow the game to run
smoothly. However, multiple GPUs can generate disturbing noise and high temperatures,
especially under load. In most cases, two or three GPUs of the same type do not result in a
double or triple increase in the performance respectively.

6.1.4 Problems with insufficient resources

Thirty years ago, few computers could process more than one program at a time. This single
program operation was the most common and the loading and running of each program
was supervised by a simple OS like MS-DOS. Computer system resources were scarce and it
took a long time to complete tasks that needed more than a single program to run in order
to be completed.

As computer systems evolved, a slightly more sophisticated and complex type of computer
operation appeared called batch processing. In batch processing some programs are
batched together and then executed as a group, without the need of any intervention from
the user. Only one program is actually running at a time, while the others are waiting for
their turn. When it completes, the next program in the queue runs, and so on, until all the
programs in the batch are run.

As computer systems evolved even more, and more than one programs could be loaded in
main memory at the same time, ready to execute, a new type of operation emerged, called
multiprogramming. In multiprogramming two or more programs may be loaded in the main
memory. However, only one program will actually be executed by the CPU at any one point
in time. All the other programs will be waiting for their turn. The idea behind
multiprogramming is to maximize the use of CPU time (i.e. CPU idle time should be
minimized). For example, if the currently running program is performing input/output tasks
(eg. waiting for input from the user or drawing an image on the screen) the CPU will be idle,
since it will not be needed. A multiprogramming OS will give control to one of the other
programs residing in the main memory and needs to execute, thus reducing CPU idle time.

雪”( 77 |
Even with multiprogramming, if there a number of programs loaded in the main memory
and all are CPU intensive, without any idle time for 1/0 operations, the last program will
have to wait for all the other programs to finish, before executing. Another problem that
needs to be dealt with when there are multiple programs residing in main memory is
memory fragmentation as programs are moved from and to the memory. Unix, developed
by Bell Laboratories of AT&T, was one of the first OSs that supported multiprogramming. In
a multiprogramming time-sharing environment, a lot of different users share a computer
system simultaneously. This situation can cause numerous security problems, such as
stealing/copying another's user programs/data or using system resources without proper
accounting. In any case, the degree of security in a multiprogramming system is less
compared to the security in a single-user dedicated system.

Further system development and evolutions introduced a new type of operation called
multitasking. Multitasking is similar to multiprogramming with the subtle difference that
tasks or processes (instead of whole programs) are performed simultaneously and share a
common resource, for example one CPU. Each task finishes, before another takes up the
CPU, as was the case in multiprogramming. However, tasks are a lot "smaller" than
programs and as such are completed very quickly. Both multiprogramming and multitasking
operating systems are Central Processing Unit time sharing systems. In older systems
multiprogramming allowed one program as a whole to run until it was completed, while in
newer systems multitasking best manages the utilization of CPU resources with the use of
program fragments called processes. Since tasks are completed in a timely fashion, the
illusion of parallelism is achieved. That is, all programs running on a computer appear to be
operating at the same time to the user. What is happening however, is that small tasks, from
each program, are completed very quickly by the CPU, making the programs appear as if
they are all operating at the same time.

Multiprocessing refers to the hardware and means that a computer system has more than
one CPU cores. This might mean multiple CPU dies or even multiple cores in one or more
CPU dies. Since multiprocessing refers to hardware, whereas multiprogramming and
multitasking refer to software, a system can be both multiprocessing, as well as
multiprogramming or multitasking.

Multithreading is the ability of a program or an operating system to execute different parts


of a program, called threads, simultaneously. The program has to be designed by the
programmer in such a way that all the threads can be executed at the same time without
interfering with each other. It is important to mention that several threads of a single
process can share the CPU, in a single CPU system, or run in parallel in a multiprocessing or
multicore system. Multithreading is widely used in applications that encompass a GUI. For
example, in such an application, if a task requested by the user needed a long time to
complete (because it was a complex mathematical computation or a network call, etc.), the
GUI would be unresponsive ("freeze") until the task was completed. Multithreading, on the
other hand, would allow the GUI of the application to be responsive and the user to have a
better experience.
Another advanced mode of operation is multi-access, where a lot of users can interact with
a one computer system through their terminals. The computer system may execute a
number of programs and the connected users can interact with these programs. This mode
of operation, of a computer system, allows the simultaneous connection of a number of
terminals. Such a system must embrace the following functional characteristics: (a) multiline
communication capabilities that will support simultaneous dialogues with the remote
terminals; (b) concurrent execution of various programs with the ability to instantly switch
from executing the program of one client to executing that of another; (c) ability to quickly
find and make data stored on the hard disks available; (d) ability to protect all data from
unauthorized access. Unix OS supports multi-access and provides the above mentioned
characteristics.

Role of the operating system

6.1.5 Role of the Operating System (OS}

Operating Systems (OSs) can be classified as single


user, multi-user, multiprocessing, multitasking and
multi-threading. Most OS are now written in C or
C++ while older OS were written in low level
languages. A few critical operations that are very
important for the performance of an OS are still
written in assembly. All OSs are collections of APPLICATION
software and belong to the system software. An OS
is a system, meaning that the collection of software
that form an OS collaborate towards a common goal.
Any computer system is a collection of hardware and
software resources which provide input, process and
output services. The OS is the core software that
coordinates all these resources, on top of which all
other software applications reside. The OS controls
the execution of all other software. For example, it
will locate where an application is saved on the HD,
calculate the amount of RAM needed for the Figure 6.10: Different levels of a computer
application to run, allocate the correct amount of
RAM for the application, copy the application to the allocated RAM, etc.


甘 79 1
ManaqinLq memorvandprocesses

Usually, a computer's RAM is small compared to its secondary storage. Memory


management is the act of managing computer memory and every instruction that is
executed in the arithmetic and logic unit {ALU) was previously loaded from the RAM and not
the hard drive directly. Thus, the RAM is a scarce resource that should be precisely,
efficiently and carefully managed by the OS in order to achieve the best performance
possible. Only vital data should be kept in the RAM; the rest should be kept in secondary
memory.

Programs that quit should return the memory that they had been allocated while running.
The OS should guarantee that this will happen, because otherwise those resources won't be
available to any other programs. This situation is rare and is called a memory leak, or
resource leak. The OS should dynamically allocate portions of memory to applications at
their request and also free them for reuse when no longer needed by the application. This is
crucial since, in modern computer systems, a lot of processes are running at any one point in
time.

During the operation of any computer system, the OS should track the location of the
programs within its RAM and convert the logical into actual physical addresses, whenever
those addresses are needed by a process. A logical address is a reference to a stored value
and is used by the program that generated this reference, while a physical address is the
actual address of one memory cell. Address binding is the process of mapping a logical
address to a physical address. A program may be loaded in different physical addresses,
while running, and the use of address binding helps to keep track of where the program is
located in RAM. Since the logical address is known, the physical address of a process can also
be located. Using these techniques the OS keeps track of programs in memory.

Swapping is the general term of a mechanism in which a process or blocks of program code
can be swapped temporarily out of RAM and into a hard disk, and then, later, brought back
into RAM to continue their execution.

Paging is the underlying mechanism of virtual memory implementation, which allows all
modern OS to utilize the, much greater in size, secondary storage as if it was RAM. The OS
copies as much data as possible into RAM, and leaves the rest on the disk. When the OS
requests data from the disk, it exchanges a quota of data (called a page) in RAM with a
quota of data on the disk. This is extremely helpful when data to be loaded in RAM is greater
in size than the available RAM. The secondary storage used in this case is usually a hard disk
drive capable of providing direct access to these memory pages. Excessive page swapping
causes thrashing that results to poor system performance.

Multitasking systems use slicing to effectively manage all running programs. A slice or a
time-slice is the time allocated to each user in a multi-access system or to a program in a
multitasking system. The OS uses an interrupt mechanism which suspends a process that is
executed by the ALU and invokes a mechanism to identify the next process to be executed.
The interrupt handler is scheduled to allow the OS to switch between processes when their
time-slices expire. The mechanism used to select the next process is called a scheduler and
is run once, during every time-slice, to choose the next process to run. The collaboration
between the interrupt and the scheduler allows for the processor's time to be shared
between a number of different processes and is a vital component of multitasking systems.
In a modern multitasking OS, the operating system can store and restore the state of a
process or thread, so that execution can be resumed from the same point at a later time.
The scheduler performs selections that satisfy the scheduling policy's priority constraint.
When a high priority takes over from the lower priority task currently running, it is known as
preemptive scheduling. When the scheduler selects a ceased lower priority task to resume,
the task continues from the stored state.

At any specific time, processes can be separated into two groups: those that are waiting for
input or output and those that need to use the CPU. The processes that are waiting for input
or output do not need to use the CPU, allowing other processes to do so. When the
requested data becomes available, and thus the input or output has completed, an interrupt
is generated and the paused processes return to their executing phases and may use the
CPU.

Managinqperipherals

Input and output devices vary in their characteristics, come from different vendors and
present different technical challenges. Their speed of communication also varies, even when
they belong to the same industry standard. For example, USB 1.0, released in 1996,
supported data rates of 1.5 Mbit/s to 12 Mbit/s and USB 1.1, released in 1998, fixed
problems identified in 1.0. USB 2.0, released in 2000, supported data rates of 280 Mbit/s,
while USB 3.0, released in 2008, supported data rates of 4 Gbit/s. Finally, USB 3.1, released
in 2013, supports data rates up to 10 Gbit/s. The OS uses a special program called a device
driver to handle all internal and external hardware, input and output peripherals and
storage devices. Each device connected to a computer system utilizes a device driver in
order to communicate with the OS. This piece of software acts like a bridge that facilitates
the communication between the particular piece of hardware and the operating system. A
device driver is coded by the product manufacturer and guides the OS as to how to use the
particular device. Manufacturers usually provide free up-to-date device drivers and most
device drivers are operating-system-specific. The use of device drivers is another example of
abstraction since the OS does not need to know the technical details about every piece of
hardware that needs to exchange data.

Man�c_e_s

The operating system hides the complexity of hardware resources from users while it also
manages the interaction of processors, memory, data storage and 1/0 devices. It acts like an
interface that handles "interrupts" generated by the 1/0 controllers and shares 1/0 between
programs using the CPU. This is also is another example of abstraction. The OS efficiently
manages low level hardware in a way that application· software can take advantage of
installed hardware. For example, when typing a document, the word processor application
does not bother with the drivers of the keyboard or the video adapter used. That is an
example of abstraction. The OS multiplexes the hardware components for all application
software and hides all unnecessary details from the user and the application software.
A

令畛I irn I 巴1回r!'lll覂


D~ceMana扣

Fde Acbon V祀啊 Hep


- · -- - · `.-` ```` ` `一`, .一....一一· ` `-

,
`
> ia


义m;un9sso33叮-:10恕BPrope巾6


v今4心心心!
O,r.ttfol• Oet刮s
Audio叩心血!叩

>
0mm` 氏仗她' `虹哑S O D 6
>�眨t<ri<s
0 81归ootl, &mm飞550850的如8

亨 ACPI志ba如PC
IIJ!I Computer
为SSD的0的印

D叩 nu.归
v 呵

™-D心:
u D 11os·

吕=·::::==三
巴心
覂!ntd(R)坛诅IOOMAC叩如归 �c \饷女哪一
V-殴driws 21...1芯

一勋坛hTr.吹社1呱BUSBD砅e D叩归知 10.0.10586.0


_s.m叩g SSO BSO EVO 500GB

=]
MU`、山啊· C.\W,吐甲em32\0R”氏社扣毗压
坎3
>嘈I忱西心ptm

)闷 HumanIm“aceD~..
) I Fi吓叩re
D归D如血 Tovi叩士止忐abo..t廿谴占哼知
<二_ _ -
)..IDEATA/AT却I controlltrS

v“如
让心血0归 To`志e如占叩*惰infor妇``
几山山
)卞ima91“9七吹~ 峰山JO斗口4口1

>
>已Key沁心

O
I Mic,.心oth<r poin如9如尔已
户;己、一- ,空
llhede>ia,心心山“1he志
均d< to the previcully In釭忐d 由“'
氏 10010586.O砬尸知毗151位1顽

一·
嘎I Monitors .峰不平成。四必,凡叩比....呾`OO

>
.. Networtr:呻沁 在 ,中-

I 凸扫文"口汕田Wh压j

u.“
Po心bleO忒6

>六Printq归U..
>口
Tounn,t..the-

J
Proct550"
, Softwared”“5
4 Sound, video and g•m• control妇
OK OK

Figure 6.11: The device manager of Windows 10

…``- -

1-:
馨E O X
氏釭如m vm H

,II氐…V一 心0
..畛!矗它目江

m~ 邓'"""' -屯
儿.....
产C心如V-

·1I �
0


..... °”....Tm` &1 丫过C式勺叩 .
矗 `,"m沁叩心Em七 I l 女·

汒•-
寸氏士.M.心.....如 ",九八16及7:.2`PM 父·C石如'”“',口 叩5 No`

m
- m.人., 16动丑PM 父'c-,..,�千
了氏心.心
l i Ho 了0”e 叩如V心-
Y屯w·rH心七 叩 片,研心叩 01女...1”迈丑沁, 如叩 蚴\ m叩 C
沁 l 代C心”“V mpo
只心呻屯如 叩,

邓' ....
. - 07•.Ml·16以及2PM 比叩

口如
o -
hWr七 , 儿 爪
n
�1坛叩 I ff1-Jl.wi-161:01:51PM 父“心C0中0lM“心6 汹I N�• C
b“
m .
坛 OT•b.-161:011%叩 父”keC ...olM.心,. 亢谒5 N i 了f谑GC-l.....
” ' 冷...
,IJ rJ. ,
'
07-丸pt-161书1;55叩 一 函,m泗
I . " 己,一
".mom•""
f1 F心心叫6m I 07可儿m·161心1:55PM `"叩 皿1"""'
, i 衿Fm'-
v色初 坛六o lo ,


07J中·16 ,01心8PM 父“”“叩mII心.书汀 记
v昌C叱0 1 H丘战Em心人


, 07•.k.旰161日津”“ k”ndG心, 16 NO T

; -..…
,ll切 Ii ,_'I n
M�“`' 伈J四 . or一九.,,161之l于24印 k“心·G心心`` 16 No c 怂暴 吐To吐l吁·
口归 - . 工`山心沁仄飞.、 也沁
心O4 Vl<w
门山心叩“b0钉
n

一玩虹了 1 o邸石h

,立一
日比yM叩严皿比仅G

^ 日心p .

:I,_,'叩毗妇
口一"...心心 .
·一 一…
“'噜"mm ·」
口W吓妇心P.a甘士, C
1


气如切口叩叩 , 1, 让凡- ...
fkb2
.,. 均“r叩....
'加;叶 1C, ”AU压中4!HORJ
忑午一凹 A T-
N ” T-`
“心 ”- 一“
主中氏迈
“灯 m心尸
1如
切9 1; 0.宁
Y
I 万
..
小山)
l;6O S一- l~如"沁C七"止,
1份“加mm心d
... 人 戎,心如归吧户O叩匀叩"欢
m吭6知
...)如,心心心心m
.叩.C 坛,..:
归 , 八心l 0l"C...,..“ 1.5,'
七 m叩户1 一切
0 l n .
T . 3妞T泣lol店E灼止


、,
C叩


, bN 匀 以中心心中d氏心.

一飞”Ill1
女C 仄如h4rn b O?·Jun..I6歇$配12PM 9”,已
1 t-K>. 1"'" T”KO"守巧E No~
目心 ,
吐 知 氏,.立志 也仅.
切如

I
I; I

区-勹> ,

“'「应 C-
,l q 问o
M I-E`口loaO心合H心

·
4

|

,;J

Figure 6.12: Event viewer of Windows 10.

6.1.6 - 6.1.7 OS resource management techniques

The techniques of multitasking, virtual memory and paging have been discussed in the
previous section.

r___-圈 lI|I.Il
J, ?' 1 t“' (. ~ |
Scheduhnq

Most OSs have a special application called "Task Scheduler" that is used to create and

』 仁
manage common tasks that the computer should carry out at specific times. These tasks
include virus scans, backups, defragmentation etc.

OT...”-心

旦I
- c, X

百_


,..比勺m V心吵...
1


_
.
·········· ··-···.

三 二
令畛!乙正 目立
-
谥`9

:
0
I'

女宁

g}
勿i

:红
i

ii ii l-ii
v

: 二

TI }

mi
g

王二
_了` 一 -
Z t

二 一-

i叩

}}{_ -
~

二三 二飞二
{


宁 -- -
}

8}
如2i � - -
}

`i
4-

- --,

1[ I - -
'i ”

} -


“i
~三


, '

}
c}

--
i

}
. .“

i~
J\ ,

_.
-
-
_5 3

_ } g
J
- i
}

_

l
., ·

H
I1


h
i

g
i

t
t

16

|
-
,


L 三了

言呥

_
-

-i
-g
-农
--
-




1
,

f
t


gt
',

5

6

C


{

」 V

玉I|l l'!'I 3 , . .o乙^3 P3眨 e · - - '


,'
片, I
Figure 6.13. The Task Scheduler of Windows 10

The process scheduler is part of the operating system and decides on the next tasks to be
admitted into the CPU and thus the next process to run. Operating systems may feature up
to three separate scheduler types (short-term, medium-term and lo�g-term). The scheduling
criteria that affect the selection of the best scheduling algorithm for a particular situation
include CPU utilization, throughput, turnaround time, waiting time and response time. The
most common CPU scheduling algorithms are:

1. First-Come First-Serve Scheduling, FCFS


2. Shortest-Job-First Scheduling, SJF
3. Priority Scheduling
4. Round Robin Scheduling
5. Multilevel Queue Scheduling
6. Multilevel Feedback-Queue Scheduling

Policies anda�驾ement

In many cases more than one user has access to a personal computer. Moreover, in a
corporate computer network, there could be thousands of people who have access to the
network's data. In all cases, an operating system is responsible for setting up accounts for
each user who will utilize the computer or network resources. A user account defines the
privileges and access rights of a particular user. A user name and a password is used to gain
legitimate access to a computer or a network and to prevent unauthorized access by people
who do not have the permission to use the services and the facilities.

Lf 83
|
、-
- 父m叩 - 0 X

@ ACCOUNTS

Require sign-in
Your如ai1and忒counts

| 1. Please reenter your password

`
Wori<ac妞
We心to如fy虹但艾邓邓伍you,M虹osolt account

Fomily&o如ru如 1 ·l OO'J b,'"'


Password
扣, our父戊叩 比im@心r.gr
°`ngeyour釭0廿ntp,

Fo,got myp心心d

PIN

_
Create a P1N to四in
PlNwhen沪U叩nint,

-—
A

Picture passwo
Sign ;,, to Windows us;,

|
IIIIIlIIII , .. 。乙 分 刀 区 e o • -

Figure 6.14: User accounts settings of Windows 10

Interrupts

An interrupt is a signal from a device or from a program within the computer that causes the
OS to stop the current task and decide what to do next. Various interrupts are generated
and have different priorities. When a printer runs out of paper a "printer unavailable"
hardware interrupt will be triggered to inform users that the printer is not available for
printing. The multitasking principle, described in this chapter, is based on software
interrupts. In general a hardware interrupt occurs when an 1/0 operation has finished
performing a function, while a software interrupt occurs when a program requests various
services from the OS.

� Task Manager
File Options View
Proces炟 P erformance App history Startup Us� Details如吹es

、/
6% 62% 1% 0%
Name CPU Memory Disk Network

Microsoft account 3.1% 巧.8MB OMB/s OMbps

[El Desktop Window Manager 1.1% 67.9MB OMB/s OMbps

s
ml 芦em andc ompr已sedm em ory 0.9% 0.1MB 0.1MB/s OMbps

>,� Task Manager 0.5% 19.5MB OMB/s OM如

� Store OA% 的.4MB OMB/s OMbps

已System interru� 0.1% 0MB OMB/s OM如

或WMI Provider Host 0% 24.4MB OMB/s OMbps

__1-F'!"吨"产ll!
Figure 6.15: Various system interupts presented in the Task Manager (Wi ndows 10)



1. 云T...,户
Il__“
I 嘉- -, ;.~ -.:.;;一-身
4 心, 立.兄 ,、 , ' ,, I

Polling is the periodic checking of devices, by a central device to sample their status (i.e. see
what state they are in and identify whether they are still connected or want to exchange
data). The CPU periodically checks certain registers, actuators or sensors to see if some
request has been made. If, for example, a device is ready to transmit data, then polling will
identify this situation.

I Polling and interrupts: Polling is when one checks his/her smartphone periodically, to i
: see if any notification has come up, while interrupt is when a notification arrives to :
ones smartphone and the smartphone vibrates to inform him/her.
、____ ___ __ ___ __ __ _____ _______ ____ __ ____ ___ __ ___ __ __ __ ___ __ _夕

6.1.8 Dedicated OS for a device


1
Exit skills. Students should be able to :

“-l··,r 佑双丕比匋a疵飞呻严 `丁?仁1r.r

There are two general approaches when developing a dedicated OS for a device:

• The first approach is to take an existing OS and adapt it for the particular device. The
advantage of this approach is that the end user deals with a familiar interface. The
disadvantage is that the final product will not be optimized for this particular
purpose. For example, if one plans to develop an OS for a mobile device, using an
existing OS that was developed for desktop computers, as its base, this may lead to
various obstacles since the mobile device may not have all the resources and
capabilities of a desktop computer.
• The second is to design an OS that will fit the particular needs of the device exactly.
This approach would lead to an OS optimized for this particular device and purpose.
For example, when developing an OS for an embedded system, characteristics such
as small size (in bytes), quick responsiveness to external interrupts, real-time
scheduling policy and fast, lightweight, processes are very important and should be
taken into consideration. When developing an OS for a cell phone, considerations
about the efficient use of the battery and RAM, as well as the small touchscreen size
and the overall small device size should be made.

Examples of dedicated OSs:

Android is a the name of the mobile Operating System currently developed and owned by
Google. It is based on the Linux kernel, and designed mainly for touchscreen mobile devices,
such as tablets and smartphones. Android is one of the best-selling OSs for handheld
devices, and has the largest installed base. It is written in C, C++ and」ava, and offers users
access to Google's own services like Google Search, Maps, Translate, YouTube and Gmail.

| 85
|
Figure 6.16: Android Nougat replica in front of Google office on June 30, 2016.

Symbian is a mobile OS designed for smartphones. It was written in C++ and originally
developed as a closed-source OS for PDAs in 1998 by Symbian Ltd. Symbian was used by
many mobile phone brands, like Samsung, Sony Ericsson, and Nokia, but is defunct as of May
2014.

TinyOS is a free and open-source, embedded, component-based, OS and platform for low­
power wireless devices, such as those used in wireless sensor networks and home
automation. It is written in the nesC programming language.

Tizen is an OS based on the Linux kernel and the GNU C Library implementing the Linux API.
It is written in C, C++ and HTML, and is a project within the Linux Foundation. The Technical
Steering Group that governs this project include Samsung and Intel. It works on
smartphones, PCs, cameras, tablets, in-vehicle infotainment devices, smart TVs,
smartwatches, Blu-ray players, printers, refrigerators, air conditioners, etc. Its purpose is to
offer a consistent user experience across devices and promote smart home solutions.

Embedded Configurable Operating System (eCos) is a free and open-source, real-time, OS


that was engineered to serve embedded systems and applications which need only one
process with multiple threads. It is easily customizable to specific application specifications
of run-time performance and hardware requirements. It is written in C and C++.

|`:` - 86. E ` . _ , `:, “'飞?勹沪尸 _ ',j. S - V 、


,I
6.1.9 OS and complexity hiding

As we have already seen earlier in this chapter the OS hides the complexity of the hardware
from the users. This is a typical example of abstraction. The use of device drivers and the
management of hardware resources are not the only examples of abstraction related to OS
function.

Drive letters

In the following picture, drive C is a SSHD and D is a USB device. So letters C and D
correspond to real devices. Desktop, documents, downloads, 101—05, BOOK etc. on the
other hand refer to folders (locations). The user uses the icons to select the desired folder
without bothering with the complexity that lies beneath this simple selection {Figure 6.17).

空Jg .IThisPC
- Computer View


七 ?个匣',This PC

俞Quick ace己S v Folders {6)


■ D己ktop
回Docum叩
-1, Downloads


I
.,
,

Desktop
r I

Documents Downloads
1; I ,俨

,,
分 Music Pictur已 Videos
� Pictures v Devices and drives (2)
101_05
BOOK 玉
序ho心7
to print I Wind叩
(C:)
DIMITRIOU
(0:)

垒 OneOt泗

Figure 6.17: File explorer of Windows 10.

Virtual mem�应

A user of Microsoft's Windows 10 has the capability to alter the settings of virtual memory.
After that, the OS will handle the page file, when required, in the best possible manner, in
order to maximize the performance of the system. Once again the OS hides this complexity.

「 -_ 87
1
口 X

I > Control Pa心,平如叩如rity'泗ffll v 0 父arch Co... P

千一吵压
i - - ---

x

`M X

_哪1-
h

/
li-

.
gf
-i

for ,

i
g
1
比一
酝巳沁'”一
僵识一
Okto心血尸己已 9,"....
红r« m*
@片 O 缸均m叫勾奴己
一山如 C严d
W如屾m田心y
沁” “”“UC 芯妇沁MB

@Q吐"n中
“宁于和$
.....,R退
.......on 如归d妇归临如…立“`

1nili111 血… 尸 l 1叩扣沪9酝虹缸·帕 劂MIi


_亟 (M11}:1 皿 —-
l 」
0平mm丐出血
_」
0心户妇珈 I-竺
lal诫户宁丐保血缸卓金沁丈

r-....
`.._.., 16MB
耘”“'m吐.d. 1蜘MB
`由寸, 心凶

I OI(11 (…rl |

Figure 6.18: Use of virtual memory in Windows 10

Inputdevices

Various input devices are controlled by the OS using their device drivers. The user simply
uses these devices and can change their settings without knowing any details about how

K-
they operate at a hardware level.

V � Imaging 如沁义
卞旧叩血W心叩
v三
三父andard PS/2. Keyboard
V I M.emd 呻…吐如gd妞巴
邕归Touc片叫
I -如泣亚e(Mow,eand阳心血C.ff1lff)
I Mi<叩吐匹R 汰巫贮

Figure 6.19: Screenshot showing various input devices in the device manager

The Lava virtual mac;h-ine

The」ava architecture allows code to run on any machine on which the Java Virtual Machine
interpreter has been installed. In Java architecture, all details of making the code function on
a specific hardware platform are handled by the 」 ava Virtual Machine (JVM). This is another
example of abstraction.

-llIIllIIIlll}IlI
l圈_____一已严ll一沪严了『
End of chapter example questions with answers

Example 25

Question

What are the two main categories of software?

Answer

Application and system software.

Example 26

Question

State some main tasks of the operating system.

Answer

1. recognizing input from the keyboard ,


2. sending output to the display,
3. managing files and directories on the secondary memory,
4. controlling peripheral devices such as disk drives and printers,
5. warranting that different applications running at the same time do not interfere
with each other and
6. providing a platform on top of which application software can function.

Example 27

Question

State two types of operating system strategies?

Answer

Batch and timesharing.

Example 28

Question

What is a resource in a computer system?

Answer

A resource is anything that can be allocated and managed by a computer system.


|, __芦 k,叶 -` 89
1
Answer

When a process executes, it passes through start, ready state, waiting state, running state
and terminated.

Example 34

Question

Explain what is a running process, a ready process and a waiting process.

Answer

The running state means that a process has all the resources it needs for execution and the
operating system has given it permission to use the processor and execute its instructions.

The ready state means a process has all the resources it needs, but is waiting to be assigned
to a processor.

The waiting state means a process is waiting for a resource, such as input from the user or a
file to become available.

Example 35

Question

What is deadlock?

Answer

Deadlock is a situation that can arise when two processes hold resources and request other
resources, from each other, at the same time. Process A holds a resource that process B
wants, while process A requests a resource that process B holds. The result is that neither
can continue.

Example 36

Question

What is fragmentation?

Answer

Fragmentation is a phenomenon or state in which memory is used inefficiently and is broken


up in small pieces. This leads to files and programs being divided up and stored in various
areas throughout the memory, which results to slower computer systems, when these files
and programs need to be accessed. This happens because processes, which occupy different
amounts of memory, are constantly allocated and deallocated to and from the memory.
Example 40

Question

Describe the difference between physical primary memory, virtual memory, and logical
memory.

Answer

Physical primary memory is the memory available by a computer to execute processes.


Virtual memory is a technique through which applications that require space larger than the
available RAM can be executed by using disk memory as if it was primary memory. Logical
memory is an abstraction of the computer's different types of memory that facilitates
programming.

Example 41

Question

Why is RAM not suitable for permanent program storage or backup purposes?

Answer

RAM is a volatile memory, while disk drives can store data permanently.

Example 42

Question

State one advantage of multi-core processing over multi-processor systems.

Answer

Communication between processors on the same chip is faster than processors on separate
chips.

Example 43

Question

Why is a high level language suitable to implement an operating system?

Answer

The code can be written faster and is easier to understand and maintain.

l: 93
|

You might also like