You are on page 1of 47

Operating Systems

(OUbs017112)

Agenda for Today

WhatisanOperatingSystem(OS)
WhatisaComputerSystem
TypesofOSbycharacteristics
ManagementfunctionsofOS
SystemCalls
Systemprograms
SystemBoot
ShellScriptinginLinux
VBscript

Operating System
WhatisanOperatingSystem?

Operating System
An operating system is a software package which allows the
computertofunction.Itisaprogramthatactsasaninterface
betweentheuserandthecomputerhardwareandcontrolsthe
executionofallkindsofprograms.

ThehistoryofBillGatesandIBM
n
n

WhoisBillGates?
WhatisthenameofhisfirstOS?

ThehistoryofBillGatesandIBM
Bill Gates is the founder of a large software company in the
1970scalledMicrosoft.
His first Operating System was named as Disk Operating
System(DOS).
Bill Gates approached IBM which was a hardware
manufacturertointroducetheMSDOSinthemachine

A computer system consists of hardware, software


and the user

n
n
n

WhatarethecomponentsofaComputerSystem?
Namethem?
Giveexamplesofeachofthecomponents?

The 4 components of Computer


System are:
TheHardware
TheOperatingSystem
TheApplicationProgram
TheUsers

The 2 main purposes of an operating


system are:

Toallocateandmanageresourcesinaneffectiveandefficient
manneravoidingconflictingrequests.

To control executionof programs in order to prevent errors


andimproperuseofthecomputer.

There are different types of Operating systems and


they can be characterized as follows:

Mainframe systems

A Mainframe operating system is a special-purpose


system that is used by companies with very high
transactionvolume,suchascreditcardcompaniesand
airline reservation systems. Mainframe computers are
capableofhandlingandprocessingverylargeamount
ofdataveryquickly.Asupercomputerormainframe
costs millions to buy and maintain. Mainframe
operating systems can be divided intobatch,
multiprogramming, and multitasking operating
systems.
Although these terms seems similar but there are
some differences between them which are given
below:

Batch Operating Systems


BatchprocessingisatechniqueinwhichanOperating
System collects the programs and data together in a
batchbeforeprocessingstarts.

Multiprogramming
Multiprogrammingisthetechniqueofrunningseveral
programs at a time using timesharing. It allows a
computer to do several things at the same time.
Multiprogramming creates logical parallelism. The
concept of multiprogramming is that the operating
systemkeepsseveraljobsinmemorysimultaneously.
systemkeepsseveraljobsinmemorysimultaneously
It makes use of CPU scheduling algorithms to
optimizetheperformanceoftheCPU.Thealgorithms
goals are to have maximum CPU utilization,
maximum throughput, minimum turnaround time,
minimumwaitingtime,andminimumresponsetime.

Multiprogramming

Multitasking
Multitasking in the context of a Mainframe system
implies that several users at different locations have
accesstotheprogrammeorsystematthesametime.
One example is querying a central database from
multiple places. Also referred to as time sharing
operating systems, the main objective of a
multitaskingoperatingsystemistominimiseresponse
time compared to multiprogrammings objective
whichistomaximiseprocessoruse.

Multiprocessor Systems
Multiprocessor Operating System refers to the use of
two or more central processing units (CPU) within a
singlecomputersystem.

Desktop Systems
Also called a "client operating system" is the
controlprograminauser'smachine(desktopor
laptop).
Distributed Systems
DistributedOperatingSystemisamodelwhere
distributedapplicationsarerunningonmultiple
computerslinkedbycommunications.

There are two different types of Distributed


Model:
Client-Server model
A defined server provides services (HW or SW) to
othersystemswhichserveasclients.

Peer-to-peer model
Anycomputerorprocessonthenetworkmayprovide
services to any other which requests it. There is no
clear"leader"oroverallorganization.

Network Operating Systems


A Network Operating System(NOS) is an operating
system designed for the sole purpose of supporting
workstations, database sharing, application and file
sharing and printer access sharing among multiple
computersinanetwork.NOSnormallyrunonservers
and require more hardware resources such as hard
diskcapacityandmemory(RAM).ExamplesofNOS
areWindowsServer2003,2008,2012andothers.

Clustered Systems
In a computer system, acluster is a group of servers
and other resources that act like a single system and
enable high availability and, in some cases, load
balancingandparallelprocessing.
Embedded Systems (Real time)
Unlike a general-purpose computer, such as a
personalcomputer,anembeddedsystemperformspre
-defined tasks, usually with very specific
requirements. Typically, an embedded system is
housed on a single microprocessor board with the
programsstoredinROM.
The time taken by the system to respond to an input
anddisplayofrequiredupdatedinformationistermed
astheresponse time.

Handheld Systems (Mobile Operating System)


Amobileoperatingsystem(mobileOS)isanOSbuilt
exclusively for a mobile device, such as a smart
phone, personal digital assistant (PDA), tablet or
otherembeddedmobileOS.Popularmobileoperating
systems are Android, Symbian, iOS, BlackBerry OS
andWindowsMobile.
A mobile OS is responsible for identifying and
defining mobile device features and functions,
including keypads, application synchronization,
email, thumbwheel and text messaging. A mobile OS
issimilartoastandardOS(likeWindows,Linux,and
Mac) but is relatively simple and light and primarily
manages the wireless variations of local and
broadband connections, mobile multimedia and
variousinputmethods.

Cloud Systems
Cloud computing is the delivery of computing
services over the Internet. Cloud services allow
individuals and businesses to use software and
hardware that are managed by third parties at remote
locations. Examples of cloud services include online
file storage, social networking sites, webmail, and
online business applications. The cloud computing
model allows access to information and computer
resourcesfromanywherethatanetworkconnectionis
available.Cloud computingprovides a shared pool of
resources, including data storage space, networks,
computerprocessingpower,andspecializedcorporate
anduserapplications.

Important Functions of an
Operating System

n
n
n
n
n

An operating system is responsible for managing the


whole computer system. It has many different
functions, which are all important for the overall
operation of the computer. Some of the operating
systemmanagement functionsare:
Process Management
Memory Management
Storage Management
File Management
Device Management

Process Management
A process is defined as a program in execution.To
accomplish its task, a process needs certain resources
likeCPUtime,memoryfilesandI/Odevicesandasa
process executes it changes its states. Each process
maybeinoneofthefollowingstages
New:Theprocessisbeingcreated.
Running: Instructionsarebeingexecuted.
Waiting: Waiting for some resource like memory,
I/O,CPUtimeetc.
Ready: Process is in main memory and waiting to be
assignedtoCPU.
Terminate: Theprocessfinishedexecution.

Theoperatingsystemisresponsibleforthefollowing
activitiesinconnectionwithprocessmanagement.
n
n
n
n

Creatinganddeletingbothuserandsystemprocesses.
Suspendingandresumingprocesses.
Providemechanismsforprocesssynchronization.
Providemechanismforprocesscommunication.

Memory Management
Main Memory refers to a physical memory that is the
internal memory to the computer. The word main is
used to distinguish it from external mass storage
devices such as disk drives. Main memory is also
known asRAM. The computerisableto changeonly
data that is in main memory. Therefore, every
programweexecuteandeveryfileweaccessmustbe
copiedfromastoragedeviceintomainmemory.

Themajoractivitiesofanoperatingsysteminregard
tomemory-managementare:
n

Keeptrackofwhichpartofmemoryarecurrently
beingusedandbywhom.
Decidewhichprocessesareloadedintomemory
whenmemoryspacebecomesavailable.
Allocateandde-allocatememoryspaceasneeded.

Storage Management
Generallyspeaking,systemshaveseverallevelsofstorage,
including primary storage, secondary storage and cache
storage. Instructions and data must be placed in primary
storage or cache to be referenced by a running program.
Because main memory is too small to accommodate all
dataandprograms,anditsdataarelostwhenpowerislost,
the computer system must provide secondary storage to
back up main memory. Secondary storage consists of
tapes,disks,andothermediadesignedtoholdinformation
that will eventually be accessed in primary storage
(primary,secondary,cache)isordinarilydividedintobytes
or words consisting of a fixed number of bytes. Each
location in storage has an address; the set of all addresses
availabletoaprogramiscalledanaddressspace.

Thethreemajoractivitiesofanoperatingsystemin
regardtosecondarystoragemanagementare:
Managingthefreespaceavailableonthesecondarystoragedevice.
Allocationofstoragespacewhennewfileshavetobe
written.
Schedulingtherequestsformemoryaccess.

File Management
A file is a collected of related information defined by
its creator. Computer can store files on the disk
(secondarystorage),whichprovidelongtermstorage.
Some examples of storage media are magnetic tape,
magnetic disk and optical disk. Each of these media
has its own properties like speed, capacity, data
transferrateandaccessmethods.
Afilesystemisnormallyorganizedintodirectoriesto
easetheiruse.Thesedirectoriesmaycontainfilesand
otherdirections.

Thefivemainmajoractivitiesofanoperatingsystem
inregardtofilemanagementare:

Thecreationanddeletionoffiles.
Thecreationanddeletionofdirections.
Thesupportofprimitivesformanipulatingfilesand
directions.
Themappingoffilesontosecondarystorage.

Thebackupoffilesonstablestoragemedia.

n
n
n

Device Management
The OS manages all the hardware and peripheral
devicesofyourcomputer.Forexample,whenyouput
in a DVD to play a movie, the OS will start reading
the data from the optical drive and launch a movie
player. Or when you are saving a file to a USB flash
drive, the OS checks to make sure there is enough
spaceonthedrivetostoreyourfile.

System Calls
Systemcallsprovideaninterfacebetweentheprocess
and the operating system. System calls allow userlevel processes to request some services from the
operating system which process itself is not allowed
to do. In handling the trap, the operating system will
enter in the kernel mode, where it has access to
privileged instructions, and can perform the desired
service on the behalf of user-level process. It is
because of the critical nature of operations that the
operating system itself does them every time they are
needed. For example, for I/O a process involves a
system call telling the operating system to read or
write particular area and this request is satisfied by
theoperatingsystem.

There are actually 6 Types of system calls namely:

Process Control
File Management
Device Management
Information Maintenance
Communications
Protection

Application developers often do not have direct


access to thesystem calls, but can access them
throughanapplicationprogramminginterface(API)
n

System Programs
System programs provide basic functioning to users
so that they do not need to write their own
environment for program development (editors,
compilers) and program execution (shells). In some
sense,theyarebundlesofusefulsystemcalls.

System Boot
The process of bringing up the operating system is
calledbooting. Your computer knows how to boot
because instructions for booting are built into one of
its chips, the BIOS (or Basic Input/Output System)
chip. The BIOS chip tells it to look in a fixed place,
usually on the lowest-numbered hard disk (theboot
disk) for a special program called aboot loader. The
boot loader is pulled into memory and started. The
bootloader'sjobistostarttherealoperatingsystem.

The loader does this by looking for akernel, loading


it into memory, and starting it. Thekernel is a
computerprogramthatconstitutesthecentralcoreof
acomputer'soperatingsystem.
You may for example change the sequence of the
boot process from primary hard disk to your DVD if
you wish to install a new operating system, save and
exit.

Unit 2: Shell Scripting


n

WhatisScript?

Scriptsareusuallyshortcodesinatextfilethat
helps to generate reports or run specific tasks
orapplications.
Common languages for scripting are Visual
BasicandJava

n
n

WhatisLinuxshell?
WhatisShellScripting?

Linux shell is a user interface used for executing the


commands. Shell is a program the user uses for
executing the commands. In UNIX, any program can
betheusersshell.
Shell categories in Linux are:
-Bourneshellcompatible,
-Cshellcompatible,
-Nontraditional,and
-Historical.

Ashellscript,asthenamesuggests,isascriptwritten
for the shell. A shell script is a program file in which
certain Linux commands are placed to execute one
after another. A shell script is a flat text file. Shell
scripts are useful to accept inputs and provide output
to the user. Everyday automation process can be
simplifiedbyashellscript.

VBScript is a piece of code that can be written in


Notepad and save as .vbs . You can visualise the
output in CScript or WScript. In CScript mode the
outputdisplaystheinformationintextformatwhereas
in WScript mode you will visualise the output in a
dialogboxcalledtheWindowsScriptHost(WSH).
The WScript.Echo command is used to type text
inside a command prompt or to produce a pop-up
message box, depending on how the VBScript is
actually run. When the VBScript is run by using
CScript,thescriptwritesinsidethecommandshell

You might also like