Module-1.ppt operating system unit 1 notes

FaizanAhmad293255 348 views 81 slides May 31, 2024
Slide 1
Slide 1 of 81
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81

About This Presentation

operating system unit 1 notes


Slide Content

Module 1: Introduction to Operating
System

2
Introduction:OperatingSystem.
ClassificationofOperatingsystems:Batch,Interactive,Time
sharing.
RealTimeSystem,MultiuserSystems,MultiprocessorSystems,
MultiprocessSystems,MultithreadedSystems.
OperatingSystem:Structure-Layeredstructure.
SystemComponents.
OperatingsystemServices.

3
What is an Operating System?
•ComputerSystem=Hardware+Software
•Software=ApplicationSoftware+SystemSoftware(OS)
•AnOperatingSystemisasystemSoftwarethatactsasan
intermediary/interfacebetweenauserofacomputerandthecomputer
hardware.
•Operatingsystemgoals:
Executeuserprogramsandmakesolvinguserproblemseasier
Makethecomputersystemconvenienttouse
Usethecomputerhardwareinanefficientmanner
Theoperatingsystemoperateseitherinkernelmodeorusermode.Compilersand
editorsruninusermode,whereasoperatingsystemcoderunsinkernelmode.

4
What is an Operating System?

5
The Structure of Computer Systems
Accessing computer resources is divided into layers.
Each layer is isolated and only interacts directly with the layer below or
above it.
If we install a new hardware device
No need to change anything about the user/applications.
However, you do need to make changes to the operating system.
You need to install the device drivers that the operating system will use
to control the new device.
If we install a new software application
No need to make any changes to your hardware.
But we need to make sure the application is supported by the operating
system
user will need to learn how to use the new application.
If we change the operating system
Need to make sure that both applications and hardware will compatible
with the new operating system.

6
CPU –Central Processing Unit
Thisisthebrainofyourcomputer.
Itperformsallofthecalculations.
Inordertodoitsjob,theCPUneedscommandstoperform,anddatato
workwith.
TheinstructionsanddatatraveltoandfromtheCPUonthesystembus.
Theoperatingsystemprovidesrulesforhowthatinformationgetsbackand
forth,andhowitwillbeusedbytheCPU.

7
RAM –Random Access Memory
This is like a desk, or a workspace, where your computer temporarily stores all of
the information (data) and instructions (software or program code) that it is
currently using.
Each RAM chip contains millions of address spaces.
Each address space is the same size, and has its own unique identifying number
(address).
The operating system provides the rules for using these memory spaces, and
controls storage and retrieval of information from RAM.
Device drivers for RAM chips are included with the operating system.
Problem: If RAM needs an operating system to work, and an operating system needs
RAM in order to work, how does your computer activate its RAM to load the
operating system?

8
Operating System Mode
TheUserModeisconcernedwiththeactual
interfacebetweentheuserandthesystem.
Itcontrolsthingslikerunningapplications
andaccessingfiles.
TheKernelModeisconcernedwitheverything
runninginthebackground.
Itcontrolsthingslikeaccessingsystem
resources,controllinghardwarefunctionsand
processingprograminstructions.
Systemcallsareusedtochangemode
fromUsertoKernel.

9
Kernel
KernelisasoftwarecodethatresideincentralcoreofOS.Ithascompletecontrol
oversystem.
Whenoperationsystemboots,kernelisfirstpartofOStoloadinmainmemory.
Kernelremainsinmainmemoryforentiredurationofcomputersession.Thekernel
codeisusuallyloadedintoprotectedareaofmemory.
Kernelperformsit’stasklikeexecutingprocessesandhandlinginterruptsinkernel
space.
Userperformsit’staskinuserareaofmemory.
Thismemoryseparationismadeinordertopreventuserdataandkerneldatafrom
interferingwitheachother.
Kerneldoesnotinteractdirectlywithuser,butitinteractsusingSHELLandother
programsandhardware.

10
Kernel cont…
Kernel includes:-
1. Scheduler: It allocates the Kernel’s processing time to various processes.
2. Supervisor: It grants permission to use computer system resources to each
process.
3. Interrupt handler : It handles all requests from the various hardware
devices which compete for kernel services.
4. Memory manager : allocates space in memory for all users of kernel
service.
kernel provides services for process management, file management, I/O
management, memory management.
System calls are used to provide these type of services.

11
System Call
Systemcallistheprogrammaticwayinwhichacomputerprogram/user
applicationrequestsaservicefromthekerneloftheoperatingsystemon
whichitisexecuted.
Applicationprogramisjustauser-process.Duetosecurityreasons,user
applicationsarenotgivenaccesstoprivilegedresources(theonescontrolled
byOS).
WhentheyneedtodoanyI/Oorhavesomemorememoryorspawna
processorwaitforsignal/interrupt,itrequestsoperatingsystemto
facilitateallthese.ThisrequestismadethroughSystemCall.
Systemcallsarealsocalledsoftware-interrupts.

12
Functions of Operating System

13
1. Process Management
•A process is a program in execution.
•A process needs certain resources, including CPU time, memory, files, and I/O devices to
accomplish its task.
•Simultaneousexecutionleadstomultipleprocesses.Hencecreation,executionandtermination
ofaprocessarethemostbasicfunctionalityofanOS
•Ifprocessesaredependent,thantheymaytrytosharesameresources.thustaskofprocess
synchronizationcomestothepicture.
•Ifprocessesareindependent,thanaduecareneedstobetakentoavoidtheiroverlappingin
memoryarea.
•Basedonpriority,itisimportanttoallowmoreimportantprocessestoexecutefirstthanothers.

14
2. Memory management
•Memoryisalargearrayofwordsorbytes,eachwithitsownaddress.
•ItisarepositoryofquicklyaccessibledatasharedbytheCPUandI/Odevices.
•Mainmemoryisavolatilestoragedevice.Whenthecomputermadeturnoffeverything
storedinRAMwillbeerasedautomatically.
•InadditiontothephysicalRAMinstalledinyourcomputer,mostmodernoperating
systemsallowyourcomputertouseavirtualmemorysystem.Virtualmemoryallows
yourcomputertousepartofapermanentstoragedevice(suchasaharddisk)asextra
memory.
•Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswith
memorymanagement:
Keeptrackofwhichpartsofmemoryarecurrentlybeingusedandbywhom.
Decidewhichprocessestoloadwhenmemoryspacebecomesavailable.
Allocateandde-allocatememoryspaceasneeded.

15
3. File Management
•Afileisacollectionofrelatedinformationdefinedbyitscreator.
•Filesystemsprovidetheconventionsfortheencoding,storageandmanagementofdata
onastoragedevicesuchasaharddisk.
FAT12 (floppy disks)
FAT16 (DOS and older versions of Windows)
FAT32 (older versions of Windows)
NTFS (newer versions of Windows)
EXT3 (Unix/Linux)
HFS+ (Max OS X)
•Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswithfilemanagement:
✦Filecreationanddeletion.
✦Directorycreationanddeletion.
✦Supportofprimitivesformanipulatingfilesanddirectories.
✦Mappingfilesontosecondarystorage.
✦Filebackuponstable(nonvolatile)storagemedia.

16
4. Device Management or I/O Management
•Devicecontrollersarecomponentsonthemotherboard(oronexpansioncards)thatactasaninterface
betweentheCPUandtheactualdevice.
•Devicedrivers,whicharetheoperatingsystemsoftwarecomponentsthatinteractwiththedevices
controllers.
•Aspecialdevice(insideCPU)calledtheInterruptControllerhandlesthetaskofreceivinginterrupt
requestsandprioritizesthemtobeforwardedtotheprocessor.
•Deadlockscanoccurwhentwo(ormore)processeshavecontrolofdifferentI/Oresourcesthatareneeded
bytheotherprocesses,andtheyareunwillingtogiveupcontrolofthedevice.
•Itperformsthefollowingactivitiesfordevicemanagement.
Keepstracksofalldevicesconnectedtosystem.
DesignatesaprogramresponsibleforeverydeviceknownasInput/outputcontroller.
Decideswhichprocessgetsaccesstoacertaindeviceandforhowlong.
Allocatesdevicesinaneffectiveandefficientway.
Deallocatesdeviceswhentheyarenolongerrequired.

17
5. Security & Protection
•Theoperatingsystemusespasswordprotectiontoprotect
userdataandsimilarothertechniques.
•Italsopreventsunauthorizedaccesstoprogramsanduser
databyassigningaccessrightpermissiontofilesand
directories.
•Theownersofinformationstoredinamultiuseror
networkedcomputersystemmaywanttocontroluseof
thatinformation,concurrentprocessesshouldnotinterfere
witheachother.

18
6. User Interface Mechanism
•A user interface (UI)controls how you enter data and
instructions and how information is displayed on the
screen
•There are two types of user interfaces
1.Command Line Interface
2.Graphical user Interface

19
1. Command-line interface
•In a command-line interface, a user types commands
represented by short keywords or abbreviations or presses
special keys on the keyboard to enter data and instructions

20
2. Graphical User Interface
•With a graphical user interface (GUI), you interact with
menus and visual images

21
History of Operating System
The First Generation (1940's to early 1950's)
No Operating System
All programming was done in absolute machine language, often by wiring up plug-boards to control
the machine’s basic functions.
The Second Generation (1955-1965)
First operating system was introduced in the early 1950's.It was called GMOS
Created by General Motors for IBM's machine the 701.
Single-stream batch processing systems
The Third Generation (1965-1980)
Introduction of multiprogramming
Development of Minicomputer
The Fourth Generation (1980-Present Day)
Development of PCs
Birth of Windows/MaC OS

22
Types of Operating Systems
1.Batch Operating System
2.Multiprogramming Operating System
3.Time-Sharing OS
4.Multiprocessing OS
5.Distributed OS
6.Network OS
7.Real Time OS
8.Multitasking OS

23
1. Batch Operating System
•Inthe1970s,Batchprocessingwasverypopular.Inthistechnique,similartypesofjobswerebatched
togetherandexecutedintime.Peoplewereusedtohavingasinglecomputerwhichwascalleda
mainframe.
•InBatchoperatingsystem,accessisgiventomorethanoneperson;theysubmittheirrespectivejobsto
thesystemfortheexecution.
•Thesystemputallofthejobsinaqueueonthebasisoffirstcomefirstserveandthenexecutesthejobs
onebyone.
•Theuserscollecttheirrespectiveoutputwhenallthejobsgetexecuted.

24
1. Batch Operating System cont..
Advantages of Batch Operating System:
Processors of the batch systems know how long the job would be when it is in queue
Multiple users can share the batch systems
The idle time for the batch system is very less
It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
The computer operators should be well known with batch systems
Batch systems are hard to debug
It is sometimes costly
The other jobs will have to wait for an unknown time if any job fails

25
2. MultiprogrammingOperating System:
•Multiprogramming is an extension to batch processing where the CPU is always kept busy.
•Each process needs two types of system time: CPU time and IO time.
•In a multiprogramming environment, when a process does its I/O, The CPU can start the execution of
other processes. Therefore, multiprogramming improves the efficiency of the system.

26
Advantages of Multi Programming OS:
Throughout the system, it increased as the CPU always had one program to execute.
Response time can also be reduced.
Disadvantages of Multi Programming OS:
Multiprogramming systems provide an environment in which various systems
resources are used efficiently, but they do not provide any user interaction with the
computer system.

27
3. Multi-Tasking OS
•The multitasking operating system is a logical extension of a multiprogramming system
that enablesmultipleprograms simultaneously.
•It allows a user to perform more than one computer task at the same time.

28
3. Multi-Tasking OS
•Advantages of Multi-Tasking OS:
•This operating system is more suited to supporting multiple users simultaneously.
•The multitasking operating systems have well-defined memory management.
•Disadvantages of Multi-Tasking OS:
•The multiple processors are busier at the same time to complete any task in a
multitasking environment, so the CPU generates more heat.

29
4. Time-Sharing Operating Systems
•TimeSharingoperatingsystem,computerresourcesareallocatedinatime-dependentfashiontoseveral
programssimultaneously.
•Ithelpstoprovidealargenumberofuser'sdirectaccesstothemaincomputer.
•Intime-sharing,theCPUisswitchedamongmultipleprogramsgivenbydifferentusersonascheduled
basis.
•A time-sharing operating system allows many users to be served simultaneously, so sophisticated CPU
scheduling schemes and Input/output management are required.
•Time-sharing operating systems are very difficult and expensive to build.

30
4. Time-Sharing Operating Systems cont..
•Advantages of Time-Sharing OS:
•The time-sharing operating system provides effective utilization and sharing of
resources.
•This system reduces CPU idle and response time.
•Disadvantages of Time-Sharing OS:
•Data transmission rates are very high in comparison to other methods.
•Security and integrity of user programs loaded in memory and data need to be
maintained as many users access the system at the same time.

31
5. Multiprocessor operating systems
•InMultiprocessing,Parallelcomputingisachieved.Therearemorethanoneprocessors
presentinthesystemwhichcanexecutemorethanoneprocessatthesametime.This
willincreasethethroughputofthesystem.

32
5. Multiprocessor operating systems
•Advantages of Multiprocessor OS:
•Increased reliability:Due to the multiprocessing system, processing tasks can be
distributed among several processors. This increases reliability as if one processor fails,
the task can be given to another processor for completion.
•Increased throughout:As several processors increase, more work can be done in less.
•Disadvantages of Multiprocessor OS :
•Multiprocessing operating system is more complex and sophisticated as it takes care of
multiple CPUs simultaneously.

33
6. DistributedOperating System
•TheDistributedOperatingsystemisnotinstalledonasinglemachine,itisdividedintoparts,and
thesepartsareloadedondifferentmachines.
•ApartofthedistributedOperatingsystemisinstalledoneachmachinetomaketheircommunication
possible.
•DistributedOperatingsystemsaremuchmorecomplex,large,andsophisticatedthanNetwork
operatingsystemsbecausetheyalsohavetotakecareofvaryingnetworkingprotocols.

34
6. DistributedOperating System
•Advantages of DistributedOperating System:
•The distributed operating system provides sharing of resources.
•This type of system is fault-tolerant.
•Disadvantages DistributedOperating System:
•Protocol overhead can dominate computation cost.

35
7. Network OperatingSystem
•AnOperatingsystem,whichincludessoftwareandassociatedprotocolstocommunicate
withothercomputersviaanetworkconvenientlyandcost-effectively,iscalledNetwork
OperatingSystem.

36
7. Network OperatingSystem
Advantages of Network Operating System:
•In this type of operating system, network traffic reduces due to the division between
clients and the server.
•This type of system is less expensive to set up and maintain.
Disadvantages of Network Operating System:
•In this type of operating system, the failure of any node in a system affects the whole
system.
•Security and performance are important issues. So trained network administrators are
required for network administration.

37
8. Real-Time Operating System
•In Real-Time Systems, each job carries a certain deadline within which the job is
supposed to be completed, otherwise, the huge loss will be there, or even if the result is
produced, it will be completely useless.
•The Application of a Real-Time system exists in the case of military applications, if you
want to drop a missile, then the missile is supposed to be dropped with a certain
precision.

38
8. Real-Time Operating System
Advantages of Network Operating System:
•Easy to layout, develop and execute real-time applications under the real-time operating
system.
•In a Real-time operating system, the maximum utilization of devices and systems.
Disadvantages of Network Operating System:
•Real-time operating systems are very costly to develop.
•Real-time operating systems are very complex and can consume critical CPU cycles.

39
Operating system components
•Anoperatingsystemisalargeandcomplexsystemthatcanonlybecreated
bypartitioningintosmallparts.
•Thesepiecesshouldbeawell-definedpartofthesystem,carefullydefining
inputs,outputs,andfunctions.
•Windows,Mac,UNIX,Linux,andotherOSdonothavethesamestructure,
mostoperatingsystemssharesimilarOSsystemcomponents,suchasfile,
memory,process,I/Odevicemanagement.
•Thecomponentsofanoperatingsystemplayakeyroletomakeavarietyof
computersystempartsworktogether.

40
Operating system components

41
Process Management
•The process management component is a procedure for managing many processes
running simultaneously on the operating system.
•Every running software application program has one or more processes associated with
them.
•For example, when you use a search engine like Chrome, there is a process running for
that browser program.
•Process management keeps processes running efficiently.
•It also uses memory allocated to them and shutting them down when needed.
•The execution of a process must be sequential so, at least one instruction should be
executed on behalf of the process.

42
Process Management
Functionsofprocessmanagement
Herearethefollowingfunctionsofprocessmanagementintheoperatingsystem,suchas:
Processcreationanddeletion.
Suspensionandresumption.
Synchronizationprocess
Communicationprocess

43
File management
Afileisasetofrelatedinformationdefinedbyitscreator.
Itcommonlyrepresentsprograms(bothsourceandobjectforms)anddata.
Datafilescanbealphabetic,numeric,oralphanumeric.

44
File management
•The operating system has the following important activities in connection with file
management:
•File and directory creation and deletion.
•For manipulating files and directories.
•Mapping files onto secondary storage.
•Backup files on stable storage media.

45
Network management
Network management is the process of administering and managing computer networks.
It includes performance management, provisioning of networks, fault analysis, and
maintaining the quality of service.
•A distributed system is a collection of computers or processors that never share their
memory and clock.
•In this type of system, all the processors have their local memory, and the processors
communicate with each other using different communication cables, such as fibreoptics
or telephone lines.
•The computers in the network are connected through a communication network, which
can configure in many different ways.
•The network can fully or partially connect in network management, which helps users
design routing and connection strategies that overcome connection and security issues.

46
Network management
Functions of Network management:
•Distributed systems help you to various computing resources in size and function. They
may involve minicomputers, microprocessors, and many general-purpose computer
systems.
•A distributed system also offers the user access to the various resources the network
shares.
•It helps to access shared resources that help computation to speed up or offers data
availability and reliability.

47
Main Memory management
•Main memory is a large array of storage or bytes, which has an address.
•The memory management process is conducted by using a sequence of reads or writes of
specific memory addresses.
•It should be mapped to absolute addresses and loaded inside the memory to execute a
program.
•Main memory offers fast storage that can be accessed directly by the CPU. It is costly
and hence has a lower storage capacity.

48
Function of main memory
•An Operating System performs the following functions for Memory Management in the
operating system:
•It helps you to keep track of primary memory.
•Determine what part of it are in use by whom, what part is not in use.
•In a multiprogramming system, the OS decides which process will get memory and how
much.
•Allocates the memory when a process requests.
•It also de-allocates the memory when a process no longer requires or has been
terminated.

49
Secondary-Storage management
The most important task of a computer system is to execute programs. These programs
help you to access the data from the main memory during execution. This memory of the
computer is very small to store all data and programs permanently. The computer system
offers secondary storage to back up the main memory.
Todaymoderncomputersuseharddrives/SSDastheprimarystorageofbothprograms
anddata.However,thesecondarystoragemanagementalsoworkswithstoragedevices,
suchasUSBflashdrivesandCD/DVDdrives.Programslikeassemblersandcompilers
arestoredonthediskuntilitisloadedintomemory,andthenusethediskisusedasa
sourceanddestinationforprocessing.

50
Secondary-Storage management
•Functions of Secondary storage management
•Here are some major functions of secondary storage management in the operating
system:
•Storage allocation
•Free space management
•Disk scheduling

51
Input-out put device management
One of the important use of an operating system that helps to hide the variations of specific
hardware devices from the user.
•Functions of I/O management
•The I/O management system offers the following functions, such as:
•It offers a buffer caching system
•It provides general device driver code
•It provides drivers for particular hardware devices.
•I/O helps you to know the individualities of a specific device.

52
Security Management
•Thevariousprocessesinanoperatingsystemneedtobesecuredfromotheractivities.
Therefore,variousmechanismscanensurethoseprocessesthatwanttooperatefiles,
memoryCPU,andotherhardwareresourcesshouldhaveproperauthorizationfromthe
operatingsystem.
•Securityreferstoamechanismforcontrollingtheaccessofprograms,processes,or
userstotheresourcesdefinedbycomputercontrolstobeimposed,togetherwithsome
meansofenforcement.
•Securitycanimprovereliabilitybydetectinglatenterrorsattheinterfacesbetween
componentsubsystems.
•Earlydetectionofinterfaceerrorscanpreventthefoulnessofahealthysubsystembya
malfunctioningsubsystem.
•Anunprotectedresourcecannotmisusebyanunauthorizedorincompetentuser.

53
Command Interpreter system
Oneofthemostimportantcomponentsofanoperatingsystemisitscommandinterpreter.
Thecommandinterpreteristheprimaryinterfacebetweentheuserandtherestofthe
system.

54
Command Interpreter system
•Manycommandsaregiventotheoperatingsystembycontrolstatements.Aprogram
thatreadsandinterpretscontrolstatementsisautomaticallyexecutedwhenanewjobis
startedinabatchsystemorauserlogsintoatime-sharedsystem.
•Thecontrolcardinterpreter
•Thecommand-lineinterpreter
•Theshell(inUNIX),andsoon
•Itsfunctionisquitesimple,getthenextcommandstatement,andexecuteit.The
commandstatementsdealwithprocessmanagement,I/Ohandling,secondarystorage
management,mainmemorymanagement,filesystemaccess,protection,and
networking.

55
Operating System services
•Anoperatingsystemoffersvariousservicestobothusersandprograms.
•Itincludesapplicationprogramsthatcanberunwithintheoperatingsystemandprovide
anenvironmentwheretheycanbeexecutedseamlessly.
•Theoperatingsystemalsooffersuserstheconvenienceofrunningmultipleprograms.
•Listofstandardservicesofferedbyalmostalloperatingsystems:
–UserInterface
–ProgramExecution
–Filesystemmanipulation
–Input/OutputOperations
–Communication
–ResourceAllocation
–ErrorDetection
–Accounting
–Securityandprotection

56
1.User Interface
•Operating system comes in three forms or types.
•Depending on the interface, their types have been further subdivided.
•Command line interface(CLI)
•Batch based interface(BI)
•Graphical User Interface(GUI)
•The Command Line Interface (CLI) is an interface that uses text commands and a
method for entering those commands.
•The Batch Interface (BI) utilizes commands and directives to manage the commands
entered into files executed later.
•Graphical User Interface (GUI) is a window system that uses a pointing device, such as
a mouse or trackball, to interact with the interface.
•Users can choose from menus and make selections from a variety of lists. A keyboard is
also used to enter text.

57
2. Program Execution
•The operating system must be able to load a program into memory and
execute that program.
•Furthermore, the program must be able to terminate its execution, either
normally or abnormally/forcefully.

58
3.File System Manipulation
Theoperatingsystemhelpsinmanagingfilesalso.Ifaprogramneeds
accesstoafile,itistheoperatingsystemthatgrantsaccess.These
permissionsincluderead-only,read-write,etc.
Italsoprovidesaplatformfortheusertocreate,anddeletefiles.
TheOperatingSystemisresponsibleformakingdecisionsregardingthe
storageofalltypesofdataorfiles,i.e,floppydisk/harddisk/pendrive,etc.
TheOperatingSystemdecideshowthedatashouldbemanipulatedand
stored.

59
4.Input Output Operations
Whenaprogramruns,itmayneedI/O(Input/Output)operationstointeract
withfilesorotherdevices.
However,userscannotdirectlycontrolI/Odevicesforefficiencyand
securityreasons.
Therefore,theoperatingsystemprovidesawaytoperformI/Ooperations,
suchasreadingfromandwritingtofiles.

60
5.Communication
•Theoperatingsystemmanagestheexchangeofdataandprogramsamong
differentcomputersconnectedoveranetwork.
•Theprocessneedstocommunicatewithanotherprocesstoexchange
information.
•Whetherprocessesareexecutingonthesamecomputerordifferentones,
operatingsystemsprovidecommunicationsupport.

61
6. Resources Allocations
•Whenmultiplejobsarerunningconcurrently,allocatingresourcestoeachis
necessary.
•TheseresourcesmayincludeCPUcycles,mainmemorystorage,file
storage,andI/Odevices.CPUschedulingroutinesareemployedto
determinethebestuseoftheCPU.

62
7.Error Detection and Response
AnErrorinadevicemayalsocausemalfunctioningoftheentiredevice.
Theseincludehardwareandsoftwareerrorssuchasdevicefailure,memoryerror,
divisionbyzero,attemptstoaccessforbiddenmemorylocations,etc.
Toavoiderror,theoperatingsystemmonitorsthesystemfordetectingerrorsandtakes
suitableactionwithatleastimpactonrunningapplications.
Input/Outputdevices:Forexample,connectionfailureinthenetwork,lackofpaperin
theprinter,etc.
Userprogram:Forexample:attempttoaccessillegalmemorylocations,dividebyzero,
usetoomuchCPUtime,etc.
Memoryhardware:Forexample,Memoryerror,thememorybecomesfull,etc.

63
8.Accounting
•Thisoperatingsystemservicekeepstrackofwhichusersareusinghow
muchandwhatkindsofcomputerresourceshavebeenusedforaccounting
ortoaccumulateusagestatistics.
•AnOperatingdevicecollectsutilizationrecordsfornumerousassetsandtracksthe
overallperformanceparametersandresponsivetimetoenhanceoverallperformance.
Thesepersonalrecordsarebeneficialforadditionalupgradesandtuningthedeviceto
enhanceoverallperformance.

64
9.Protection and Security
•System resources must be accessed in a controlled manner. For security,
users authenticate via login ID and password.

65
Operating system structures
65
1.Simple Structure
2.Monolithic Structure
3.Micro-Kernel Structure
4.Layered Structure
5.Modular Structure
6.Virtual Machines

66
Simple Structure
66
▪MS-DOSisanoperatingsystemcreatedforpersonalcomputers.
▪ItwasdevelopedbyMicrosoft.
▪Itisaclassicexampleofanoperatingsystemwithalayeredstructure.
▪MS-DOSoperatingsystemissplitintovariouslayersandeachofthelayershave
differentfunctionalities.
▪LayeringprovidesadistinctadvantageintheMS-DOSoperatingsystembecauseall
thelayerscanbedefinedseparatelyandinteractwitheachotherasrequired.
▪Also,itiseasiertocreate,maintainandupdatethesystemifitisdoneintheformof
layers.Changeinonelayerspecificationdoesnotaffecttherestofthelayers.
▪However,thelayersinMS-DOSarenotthatsharplydefinedandthelayer
specificationsoftenbleedintoeachother.

67
Fig: MS-DOS layer Structure
67
SIMPLE STRUCTURE

68
Simple Structure
68
AdvantagesofSimpleStructure:
Becausethereareonlyafewinterfacesandlevels,itissimpletodevelop.
Becausetherearefewerlayersbetweenthehardwareandtheapplications,
itofferssuperiorperformance.
DisadvantagesofSimpleStructure:
Theentireoperatingsystembreaksifjustoneuserprogrammalfunctions.
Sincethelayersareinterconnected,andincommunicationwithone
another,thereisnoabstractionordatahiding.
Theoperatingsystem'soperationsareaccessibletolayers,whichcan
resultindatatamperingandsystemfailure.

69
Monolithic Structure
69
Themonolithicoperatingsystemcontrolsallaspectsoftheoperating
system'soperation,includingfilemanagement,memory
management,devicemanagement,andoperationaloperations.
Themonolithicoperatingsystemisoftenreferredtoasthe
monolithickernel.
Multipleprogrammingtechniquessuchasbatchprocessingand
time-sharingincreaseaprocessor'susability.
Thisisanoldoperatingsystemthatwasusedinbankstocarryout
simpletaskslikebatchprocessingandtime-sharing,whichallows
numeroususersatdifferentterminalstoaccesstheOperating
System.

70
Monolithic Structure
•AdvantagesofMonolithicStructure:
•Becauselayeringisunnecessaryandthekernelaloneisresponsibleformanagingall
operations,itiseasytodesignandexecute.
•Duetothefactthatfunctionslikememorymanagement,filemanagement,process
scheduling,etc.,areimplementedinthesameaddressarea,themonolithickernelruns
ratherquicklywhencomparedtoothersystems.Utilizingthesameaddressspeedsup
andreducesthetimerequiredforaddressallocationfornewprocesses.
•DisadvantagesofMonolithicStructure:
•Themonolithickernel'sservicesareinterconnectedinaddressspaceandhaveanimpact
ononeanother,soifanyofthemmalfunctions,theentiresystemdoesaswell.
•Itisnotadaptable.Therefore,launchinganewserviceisdifficult.

71
Layered Structure
•TheOSisseparatedintolayersorlevelsinthiskindofarrangement.Layer0(thelowest
layer)containsthehardware,andlayer1(thehighestlayer)containstheuserinterface
(layerN).
•Theselayersareorganizedhierarchically,withthetop-levellayersmakinguseofthe
capabilitiesofthelower-levelones.
•Layeredstructuresarehierarchical,debuggingissimpler,thereforealllower-levellayers
aredebuggedbeforetheupperlayerisexamined.Asaresult,thepresentlayeralonehas
tobereviewedsinceallthelowerlayershavealreadybeenexamined.

LAYERED STRUCTURE
72

73
Layered Structure
•Advantages of Layered Structure:
•Work duties are separated since each layer has its own functionality, and there is some
amount of abstraction.
•Debugging is simpler because the lower layers are examined first, followed by the top
layers.
•Disadvantages of Layered Structure:
•Performance is compromised in layered structures due to layering.
•Construction of the layers requires careful design because upper layers only make use of
lower layers' capabilities.

74
Micro Kernel Structure
•The operating system is created using a micro-kernel framework that strips the kernel of
any unnecessary parts. Systems and user applications are used to implement these
optional kernel components. So, Micro-Kernels is the name given to these systems that
have been developed.
•Each Micro-Kernel is created separately and is kept apart from the others. As a result,
the system is now more trustworthy and secure. If one Micro-Kernel malfunctions, the
remaining operating system is unaffected and continues to function normally.

75
Microkernel Structure
75
Kernelismadeassmallaspossibleonlythemostimportantservicesareputinside
thekernelandrestoftheOSservicearepresentinthesystemapplicationprogram.
Theusercaneasilyinteractwiththosenot-soimportantserviceswithinthesystem
applicationskernelissolelyresponsibleforthethreemostimportantservices
ofoperatingsystemnamely:
Inter-Process communication
Memory management
CPU scheduling
Microkernelandsystemapplicationscaninteractwitheachotherbymessage
passingasandwhenrequired.
Thisisextremelyadvantageousarchitecturesinceburdenofkernelisreducedand
lesscrucialservicesareaccessibletotheuserandhencesecurityisimprovedtoo.
Itisbeinghighlyadoptedinthepresent-daysystems.
Mac-OSX, Eclipse IDE is a good example of Microkernel Architecture.

MICROKERNEL STRUCTURE
76

77
Micro Kernel Structure

MICROKERNEL STRUCTURE
78

79
•Advantages of Micro-Kernel Structure:
•It enables portability of the operating system across platforms.
•Due to the isolation of each Micro-Kernel, it is reliable and secure.
•The reduced size of Micro-Kernels allows for successful testing.
•The remaining operating system remains unaffected and keeps running properly even if
a component or Micro-Kernel fails.
•Disadvantages of Micro-Kernel Structure:
•The performance of the system is decreased by increased inter-module communication.
•The construction of a system is complicated.
Micro Kernel Structure

80
Modular Structure
ItisconsideredasthebestapproachforanOS.It
involvesdesigningofamodularkernel.The
kernelhasonlyasetofcorecomponentsand
otherservicesareaddedasdynamicallyloadable
modulestothekerneleitherduringruntimeor
boottime.Itresembleslayeredstructuredueto
thefactthateachkernelhasdefinedandprotected
interfaces,butitismoreflexiblethanalayered
structureasamodulecancallanyother
module.ForexampleSolarisOSisorganizedas
showninthefigure.

81
Virtual Machines
•Thehardwareofourpersonalcomputer,includingtheCPU,discdrives,RAM,andNIC
(NetworkInterfaceCard),isabstractedbyavirtualmachineintoavarietyofvarious
executioncontextsbasedonourneeds,givingustheimpressionthateachexecution
environmentisaseparatecomputer.Avirtualboxisanexampleofit.
•Anoperatingsystemenablesustorunmultipleprocessesconcurrentlywhilemakingit
appearasthougheachoneisusingadifferentprocessorandvirtualmemorybyusing
CPU-Schedulingandvirtualmemorytechniques.
•Thefundamentalissuewiththevirtualmachinetechniqueisdiscsystems.Let’ssaythe
physicalmachineonlyhasthreediscdrives,butitneedstohostsevenvirtualmachines.
•Theprogramthatcreatesvirtualmachineswouldneedasignificantamountofdiscspace
inordertoprovidevirtualmemoryandspooling,soitshouldbeclearthatitis
impossibletoassignadiscdrivetoeveryvirtualmachine.Theansweristomakevirtual
discsavailable.
Tags