0 ratings 0% found this document useful (0 votes) 19 views 15 pages Introduction To Operating Engineering Management
An operating system (OS) is essential software that manages computer hardware and provides an environment for application programs, with examples including Windows and MacOS. The OS facilitates user interaction, resource management, and program execution while ensuring efficient use of hardware. It has evolved through various generations, supporting different types of systems such as batch, time-sharing, and real-time operating systems.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save Introduction to operating engineering management For Later Introduction to operating
An operating system (OS) is a set of programs that control the
e ‘
xecution of application programs and act as an intermediary between
a user of @ computer and the computer hardware. OS is software that
manages the computer hardware as well as providing an environment
for application programs to run,
Examples of OS are: Windows, Windows/NT, OS/2 and MacOS
The objectives of OS are:
(1)To make the computer system convenient and casy 10 Use for the user:
(2)To use the computer hardware in an efficient way:
(3)To execute user programs and make solving user problems easier.
[Geass]
"A computer system can be divided into four components: the
hardware, the operating system, the application programs and the
users, The abstract view of system components is shown in figure |.
1. Hardware: such as CPU, memory and VO devices
2. Operating system: provides the means of proper use of the hardware inthe
operations ofthe computer system, itis similar to goverment
44 Application programs: solve the computing problems ofthe user, such as
compilers,
peoples, machine, or other compater
ion
database systems and web browsers,
4. Users:
[Br Qasim Mohammed Hussei] aT1. Computer-System Operation
‘A modem general-purpose computer system consists of one or more CPUs and &
‘number of device controllers connected through a common bus that provides
‘access to shared memory (Figure 1.2). Each device controller is in charge of
specific type of device (for example, disk drives, audio devices, and video
displays), The CPU and the device controllers can execute concurrently,
competing for memory eycles. To ensure orderly access to the shared memory, @
memory controller is synchronizing access to the memory.
is powered up or rebooted-
For a computer to start running-for instance, when
1o have an initial program to run, This initial program, or bootstrap
program, tends tobe simple. Typically it stored in read-only memory (ROM)
rically erasable programmable read-only memory (EEPROM),known by
it needs
or elect
ine general term firmware, within the computer hardware, 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
—_—_—
Page 3
[Dr. Qasim Mohammed Hussein]and to start executing that system, To accomplish this goal, the bootstrap
program must locate and load into memory the operating system Kemel, The
operating system then stats executing the first proces, Such #8 “init.” and waits
for some event to occur,
mouse keyboard printer
SS ¢ aaa E>
: 5
oe] (Gea) [essen]
ae
jen gr
Figure 2
2, Storage Structure
Computer programs must be in main memory (also called RAM) to
1 only large storage area that the processor can ac
Bach word has its own address,
be executed.
Main memory is th cess
directly, It forms an array of memory words.
Interaction is achieved through a sequence of load or store instructions to
specifie memory addresses. The load instruction moves a word from main
memory to an intemal register within the CPU, whereas the store instruction
moves the content ofa register to main memory.
‘The instruction-execution eyele includes:
1) Fetches an instruction from memory and stores that instrction in the
instruction register. And increment the PC register.
2) Decode the instration and may cause operand to be fetched from memory
and stored in some intemal register.
3) Execute the instruction and store the result in memory.
T Qasim Mohammed Hussein)
[Dr. Qasim Mohamm =rThe programs and data are not resided in main memory permanently for the
following two reasons:
1) Main memory is usually too small to store all needed programs and. Data
permanently.
2) Main memory is a volatile storage device that loses its contents when power
is tumed off or otherwise lost.
Thus, most computer systems provide secondary storage as an extension of main
‘memory to hold large quantities of data permanently.
‘The wide varity of storage systems in a computer system can be organized in @
hierarchy (figure 2). The main differences among the various storage systems
lie in speed, cost, size, and volatility. The higher levels are expensive, but they
ae fast.
+ Low capacity.
© Highcost.
© High speed
Figure 3: Storage device hierarchy
"A eomputer system consists of CPUs and multiple device controllers that are
connected through a common bus. The device controller is responsible for
moving the data between the peripheral devices that it controls and its local
{Dr Qasim Mohammed Hussein] aybuffer storage. Typically, operating systems have a device driver for each device
controller.
To start an VO operation, the device driver loads the appropriate registers within
the device controller. The device controller examines the contents of these
ler starts the transfer of
data from the device to its local buffer. Once the transfer of data is complete he
srrupt that it has finished
registers to determine what action to take, The control
device controller informs the device driver via an inte!
its operation, The device driver then zetums contol tthe operating system. For
mation.
) is used. After setting up
device controller transfers
other operations, the device driver returns status infor
For moving bulk data, direct memory access (DMA)
buffers, pointers, and counters for the /0 device, the
an entre block of data directly to or from its own buffer storage to memory, with
zo intervention by the CPU. Only one interrupt is generated per block, to tell the
device driver that the operation has completed, rather than the one interrupt Per
byte generated for low-speed de
es.
designing a computer system according to the
There are different categories for
number processors used.
1. Single-processor system: there is one CPU for executing instructions.
2. Multiprocessor system: It contains two or more processors that share bus,
clock, physical memory and peripheral devices. The advantages of
multiprocessors are:
a) Increase throughput.
+b) Economy scale (less cost)
©) Increase reliability
Clustered system: it consists of multiple computer systems connected by a
local area network,
[Dr Qasim Mohammed Husseln]
[Dr. 3m =Operating systems have been evolving through the years. Following table shows
the history of OS.
Generation Year Flectronic devices | Types ofOSand |
eed devices
Fist 1945-35 | Vacuum bes Plug boards
Second 19551965 _| Transistors Batch system
Third 1965 — 1980 | Integrated Circuit (IC) | Multiprogramming
Fourth ‘Since 1980 [Large scale integration | PC
ae)
OS performs many functions such as:
1. Implementing user interface.
2. Sharing HW among users.
3. Allowing users to share data among themselves.
4, Preventing users from interfering with one another.
5, Scheduling resource among users.
6. Facilitating VO operations.
7. Recovering from errors.
8. Accounting for resource storage.
9, Facilitating parallel operations.
10.Organizing data for secure and rapid access,
1 .Handling network communications,
Qasim Mohammed Husseln}
[Dr. as =Cea
‘The main categories of modem OS may be clasified into three groups which
are distinguished by the nature of interaction that takes place between the
‘computer and the user:
1, Batch system
In this type of OS, users submit jobs on regular schedule (e8. daily, weekly,
monthly) to a central place where the user of such system did not interact
directly with computer system. To speed up the processing, jobs with similar
needs were batched together and were run through the computer as @ SrOUP.
with the operator. The output
‘Thus, the programmer would leave the programs
rammer, The major task of this
from each job would send to the appropriate progt
lly from one job to the next.
{ype was to transfer control automat
Disadvantages of Batch System
|. Turnaround time can be large from user standpoint.
2, Difficult to debug program.
2. Time-Sharing System
‘This type of OS provides on-line communication between the user and the
system, the user gives his instructions directly and receives intermediate
response, and therefore it called interactive system.
‘The time sharing system allows many user simultaneously share the
computer system. The CPU is multiplexed rapidly among several programs,
which are kept in memory and on disk. A program swapped in and out of
memory to the disk,
‘Time sharing system reduces the CPU ideal time. The disadvantage is more
complex.
med Hussein] Tne
[Dr. Qasim Mol3. Real time operating system
Real Time System is characterized by supplying immediate response, It
{guarantees that critical tasks complete on time. This type must have a pre-
known maximum time limit for each of the functions to be performed on the
computer, Real-time systems are used when there are rigid time requirements
‘on the operation of a processor or the flow of data and real-time systems can
be used as a control device in a dedicated application.
‘The airline reservation system is an example ofthis tyPe.
1. Ondine and off-line operation
|A special subroutine was writen for each VO device called a device
controller. Some VO devices has been equipped for either on-line
operation (they are connected to the processor), or off-line operations
(they are run by control unit.
2,
Buffering
'A buffer is an area of primary storage for holding data during 1/O transfer.
(On input, the data are placed in the buffer by an VO channel, when the
transfer is complete the data may be accessed the processor. The buffing
may be single or double
1g (Simultaneously Peripheral Operation On-Line)
3. Spo
Spooling uses the disk as a very large buffer. Spooling is useful because
device access data that different rates. The buffer provides @ waiting
station where data ean rest while the slower device catches up.
‘pooling allows overlapping between the computation of one job and VO
of another job.
Sv OO
a Page 94, Multiprogramming
In multiprogramming several programs are kept in main memory at the
same time, and the CPU is switching between them , thus the CPU always
has a program to be execute, The OS begins to execute one program from
memory, if this program need wait such as an V/O operation, the OS
switches to another program, Moultiprogramming increases CPU
utilization, Multiprogramming system provide an environment in which
the various system resources are utilized effectively, but they do not
provide for user interaction with the computer system.
Advantages
a) High CPU utilization.
b) It appears that many programs are allotted CPU almost
simultaneously.
Disadvantages
a) CPU scheduling is requires
b) To accommodate many jobs in memory, memory management is
required.
5, Parallel system
‘There are more than on processor inthe system. These processors share
the computer bus, clock, memory and I/O devices.
‘The advantage is to increase throughput (the number of programs
‘completed in time unit.
asim Mohammed Hussein]
[Dr. ham <=6. Distributed system
among several physical processors. It involves
Distribute the computation
connceting 2 or more independent computer systems via communication
link, So, each processor has its own 0.S. and local memory; processors
communicate with one another through various communications lines,
such as high-speed buses or telep!
Storage & 0.8 ‘storage & O.
‘Communication Link
SD {Processor
@
“Advantages of distributed systems:
hone lines,
4) Resources Sharing ~ You can share files and printers
+) Computation speed up - A job can be partitioned so that each
processor can do a portion concurrently (load sharing),
«) Reliability ~ If one processor failed the rest still can function with no
problem.
4) Communications — Such as elevtronie mail, ftp
7. Personal computer
Personal computers ~ computer system dedicated to a single user, PC
operating systems were neither multi-user nor multi-tasking, The goal of
PC operating systems were to maximize user convenience and
responsiveness instead of maximizing CPU and VO utilization,
Examples: Microsoft Windows and Apple Macintosh
Page 11‘An operating system provides ‘services to programs and to the users of
those programs. The common services provided by the operating
system are:
rating system loads a program into memory
1. Program execution: Oper
he program must be able to end its
and executes the program. T!
jormally.
execution, either normally or abn
e or any specific VO device.
2, VO Operation: VO means any fil
Program may require any /O device while running: So operating
system must provide the required /O.
‘manipulation: Program needs to Tea‘
.g system gives the permission to the
id a file or write a
3. File system
file. The operatin program for
operation on file
fa transfer between two processes is required
processes are on the one computer or on
‘onnected through computer network.
4, Communication: Dat
for some time. The both
different computer but c
Communication may be implemented by two methods:
a, Shared memory
b. Message passing,
ror detection: error may occur in CPU, in /O devices or in the
memory hardware. The operating system constantly needs to be
aware of possible errors. It should take the appropriate action to
ensure correct and consistent computing,
Operating system with multiple users provides efficient system
ns:
operat
1. Resource allocation: For simultaneously executing job,
Thr asim Mohammed Hussein}
Page 12
ee2. Accounting: For account billing and usage statistics,
3. Protection: Ensure access to system resource is controlled,
ca
‘Modem operating systems are interrupt
ervice, and no users t0 whom to respond, an
riven. If there are no processes to
execute, no VO devices to s
operating system will sit quietly, waiting for something to happen. Events are
surrence of an interrupt oF @ trap. A trap isa
almost always signaled by the occ
(for example, division by
software-generated interrupt caused either by a €rr0”
vero or invalid raemory scces) or by a speci raquest from © UAT BOE
that an operating-system service be performed. For each type of interrupt,
separate segments of code inthe operating system determine what action should
be taken. An interrpt service routine is provide that is responsible for dealing
‘with the interrupt
Since the operating system and the
resources of the computer system, we need to make sure that an eror in 8 USSr
program could eause problems ony forthe one program that was running, With
ly affected by a bug in one program. A
‘users share the hardware and software
many processes could be adverse
sharing,
system must ensure that an incorrect (or
properly designed operating
malicious) program cannot cause other programs to execute incorrect.
'A) Dual-Mode Operation
‘We must be able to distinguish between the execution of operating,system code
and user defined code. The approach i o separate the wo modes of operatio
user mode and Kern
‘A bit, called the mode bit is added to the hardware of the
1 mode (also called supervisor mode, system mode, or
privileged mode).
computer to indicate the current mode: kemel (0) or user (1). The dual mode of
operation provides us with the means for protecting the operating system fi
from
errant users-and errant users from one another
[De Qasim Mohammed Hussetn}
Page 13ns fora user program t0 ask the operating system
System calls provide the meat
erating system on the user program's behalf
perform tasks reserved for the op
B) Protection CPU
‘To ensure thatthe operating system maintains MmUSt control over the CPU. We
inust prevent a user program from getting stuck in an infinite loop or not
calling system services and never returning control to the operating system. To
accomplish this goal, we can use a fimer- ‘A timer can be set to interrupt the
fe ified fixed or variable period.
“The operating system components are
|
SSSsccc“
0S decides which process gets the processor
In multiprogramming environment,
sible for the following
hen and how much time. The operating system is respons
activities in regard to process management:
1) Creating and deleting both user and system processes
2) Suspending and resuming processes
3) Providing mechanisms for process synchronization
4) Providing mechanisms for process communication
5) Providing mechanisms for deadlock handling
Main memory is « large array of words or bytes where each word or byte has its
wa address, The operating system is responsible forthe following activities in
regard to memory management:
1) Keeping track of which parts of memory are currently being used and by
whom
2) Deciding which proceses (or parts thereof) and data to move into and out of
out of
memory
[Dr qasim Mohammed Hussein] -—__
Page 14memory space as needed,
3) Allocating and deallocating
ve for the following activities in regard to fle
The operating system is responsibl
management:
1) Creating and deleting files
2) Creating and deleting direct
3) Supporting primitives for m
4) Mapping files onto secondary storage
ronvolatile) storage media
cries to organize files
anipulating files and directories
'5) Backing up files on stable (n
ith disk management:
(0S provides the following activities in connection W!
1. Free-space management.
2, Storage allocation
3. Disk scheduling.
System calls provide m interfer between the runing, program and the
operating system. User cannot execute privileged instructions the user must ask
6 to execute them system calls. Sytem calls are implemented using taps
(08 gins control through tap, switches to Kemel mode, performs service,
switches back to user mode,
1 how system ealls are used from the OS to read data from one
and gives control back to user.
Example about
files and copy them to another file, shown in figure . the programmer never see
this level of details
sm Mohammed Husseit]
Tor gusim Moharnmed Hussein] Page 13“require input Hileman
‘Waite prompt 10 ser
‘Accept input
‘Require output lens
‘rte prompt 10 se"
‘Accept input
‘Open the input file
iffile does not exis
Create output fle
If file exis, abort
yt fle
file
abort
Loop
Read from inp
Write to oP!
Until read fail
Close output file
Write completion
“Terminate normal
fe basie function 10 0
for program devel
message on soreen
n't need to write
mpilers) and
ers, 50 that they 40
system program provid
lopment (editors, ¢0
their own environment
program execution (shells).
“airol the access of programs OF USETS to the
tion mechanism must:
‘mechanism that ¢
‘The protect
ized and authorized user.
Protection refers tO
pth system and resources.
stinguish between unauthori
2. Specify the control to be imposed.
3, Provide
Security measut
‘or internal attack.
Thersoraing System: Questions and their answers: Process and Deadlock
1m questions with their answers
SY ne) rates ee management,
‘a means of enforcement.
res are responsible for defending « computer system from external
2, Operating syste
‘Virtual memory,
mi
ee
= ——