CMS Textbook Topic 6 HL
CMS Textbook Topic 6 HL
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.
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
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.
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)
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
�ocessor
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.
勹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
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
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
』冒 ,· ~ 75 |
吨ital cameras
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.
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.
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.
户
甘 79 1
ManaqinLq memorvandprocesses
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
,
`
> 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芯
=]
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
…``- -
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
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
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:
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
`
Wori<ac妞
We心to如fy虹但艾邓邓伍you,M虹osolt account
Fo,got myp心心d
PIN
_
Create a P1N to四in
PlNwhen沪U叩nint,
-—
A
Picture passwo
Sign ;,, to Windows us;,
|
IIIIIlIIII , .. 。乙 分 刀 区 e o • -
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
s
ml 芦em andc ompr已sedm em ory 0.9% 0.1MB 0.1MB/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.
、____ ___ __ ___ __ __ _____ _______ ____ __ ____ ___ __ ___ __ __ __ ___ __ _夕
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.
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.
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
妒
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泗
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 - - ---
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妇归临如…立“`
r-....
`.._.., 16MB
耘”“'m吐.d. 1蜘MB
`由寸, 心凶
I OI(11 (…rl |
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」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
Answer
Example 26
Question
Answer
Example 27
Question
Answer
Example 28
Question
Answer
.
|, __芦 k,叶 -` 89
1
Answer
When a process executes, it passes through start, ready state, waiting state, running state
and terminated.
Example 34
Question
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
Question
Describe the difference between physical primary memory, virtual memory, and logical
memory.
Answer
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
Answer
Communication between processors on the same chip is faster than processors on separate
chips.
Example 43
Question
Answer
The code can be written faster and is easier to understand and maintain.
l: 93
|