Os Unit I
Os Unit I
UNIT I
Introduction
I. OperatingSystem:
II. HistoryandEvolutionofOS
Belowarefourgenerationsofoperatingsystems.
TheFirstGeneration
TheSecondGeneration
TheThirdGeneration
TheFourthGeneration
1. TheFirstGeneration(1940toearly1950s)
In 1940, an operating system was not included in the creation of the first
electrical computer. Early computer users had complete control over the device and
wrote programs in pure machine language for every task. During the computer
generation, a programmer can merely execute and solve basic mathematical
calculations. an operating system is not needed for these computations.
2. TheSecondGeneration(1955–1965)
GMOSIS,thefirstoperatingsystem(OS)wasdevelopedintheearly1950s.
For the IBM Computer, General Motors has created the operating system. Because it
gathers all related jobs into groups or batches and then submits them to the operating
system using a punch card to finish all of them, the second-generation
operatingsystem was built on a single-stream batch processing system.
3. TheThirdGeneration(1965–1980)
Because it gathers all similar jobs into groups or batches and then submits them
to the second generationoperating system using a punch card to finish all jobs in a
machine, the second-generation operating system was based ona single
stream batch processing system. Control is transferred to the operating system upon
each job’s completion, whether it be routinely or unexpectedly. The operating system
cleans up after each work is finished before readingand starting the subsequent job
ona punch card. Large, professionally operated machinesknownas mainframes were
introduced after that. Operating system designers were able to create a new operating
system in the late 1960s that was capable of multiprogramming—
thesimultaneousexecution of several tasks in a single computer program.
1
OperatingSystems
4. TheFourthGeneration(1980–PresentDay)
The fourth generation of personal computers is the result of these PDPs. The
Generation IV (1980–Present)The evolution of the personal computer is linked to
thefourth generation of operating systems. Nonetheless, the third-generation
minicomputers and the personal computer have many similarities. At that time,
minicomputers were only slightly more expensive than personal computers, which
were highly expensive.
The development of Microsoft and the Windows operating system was a significant
influence in the creation of personal computers. In 1975, Microsoft developed the first
Windowsoperating system. Bill Gatesand Paul Allen had the idea to advance personal
computers after releasing the Microsoft Windows OS. As a result, the MS-DOS was
released in 1981, but users found it extremely challenging to decipher its complex
commands. Windows is now the most widely used and well-liked operating system
available
III. TypesofOperatingSystem
Operating Systems have evolved in past years. It went through several changes
before getting its original form. These changes in the operating system are known as
the evolution of operating systems. OS improve itself with the invention of new
technology. Basically , OS added the feature ofnew technology and making itself more
powerful.Let us see the evolutionofoperating systemyear-wise in detail:
NoOS–(0sto1940s)
BatchProcessingSystems-(1940sto1950s)
MultiprogrammingSystems-(1950sto1960s)
Time-SharingSystems-(1960sto1970s)
IntroductionofGUI-(1970sto1980s)
NetworkedSystems–(1980sto1990s)
MobileOperatingSystems–(Late1990stoEarly2000s)
AIIntegration–(2010sto ongoing)
1. NoOS–(0sto1940s)
As we know that before 1940s, there was no use of OS . Earlier, people are
lackingOSintheircomputersystemsotheyhadtomanuallytypeinstructionsfor each tasks in
machine language(0-1 based language) . And at that time , it was very hard for users to
implementeven a simple task. And it was very time consuming and also not user-
friendly . Because not everyone had that much level of understanding to understand the
machine language and it requireda deep understanding.
2. BatchProcessingSystems-(1940sto1950s)
With the growth of time, batch processing system came into the market .Now
Users had facility to write their programs on punch cards and load it to the computer
operator. And then operatormake differentbatches of similartypesofjobs and then
2
OperatingSystems
serve the different batch(group of jobs) one by one to the CPU .CPU first executes
jobsofonebatchandthemjumptothejobsofotherbatchinasequencemanner.
3. MultiprogrammingSystems-(1950sto1960s)
Multiprogramming was the first operating system where actual revolution
began. It provide user facility to load the multiple program into the memory and
provide a specific portion of memory to each program. When one program is waiting
for any I/O operations (which take much time) at that time the OS give permission to
CPU to switch from previous program to other program(which is first in ready queue)
for continuous execution of program with interrupt.
4. Time-SharingSystems-(1960sto1970s)
Time-sharing systems is extended version of multiprogramming system. Here
one extra feature was added to avoid the use of CPU for long time by any single
programand give accessof CPU to every program aftera certain intervaloftime.
Basically OS switches from one program to another program after a certain interval of
time so thatevery program can getaccessof CPU and complete theirwork.
5. IntroductionofGUI-(1970sto1980s)
With the growth of time, Graphical User Interfaces (GUIs) came. First time OS
became more user-friendly and changed the way of people to interact with computer.
GUI provides computer system visual elements which made user’s interaction with
computer more comfortable and user-friendly. User can just click on visual elements
rather than typing commands. Here are some feature of GUI in Microsoft’s windows
icons, menus and windows.
6. NetworkedSystems–(1980sto1990s)
At 1980s,the craze of computernetworksat it’speak .A special type of Operating
Systemsneededto manage the network communication. The OS like Novell NetWare
and Windows NT were developed to manage network communication
whichprovideusersfacilitytoworkincollaborativeenvironmentandmadefile sharing and
remote access very easy.
7. MobileOperatingSystems–(Late1990stoEarly2000s)
Invention of smartphones create a big revolution in software industry, To
handle the operation of smartphones , a special type of operating systems were
developed. Some of them are : iOS and Android etc. These operating systems were
optimized with the time and became more powerful.
8. AIIntegration–(2010stoongoing)
With the growth of time, Artificial intelligence came into picture. Operating
system integrates features of AI technology like Siri, Google Assistant, and Alexa and
became more powerful and efficient in many way. These AI features with operating
system create a entire new feature like voice commands, predictive text, and
personalized recommendations.
3
OperatingSystems
IVComputerSystemArchitecture:
ThedifferentcomponentsintheComputerSystemArchitectureareInput Unit,Output
Unit, Storage Unit, Arithmetic Logic Unit, Control Unitetc.
TheinputdatatravelsfrominputunittoALU.Similarly,thecomputeddatatravels from
ALU to output unit. The data constantly moves from storage unit to ALU and back
again. This is because stored data is computed on before being stored again. The
control unit controls all the other units as well as their data.
Detailsaboutallthecomputerunitsare−
InputUnit
Theinputunitprovides datatothecomputersystemfromtheoutside.So,
basically it links the external environment with the computer. It takes data from
the input devices, converts it into machine language and then loads it into the
computer system. Keyboard, mouse etc. are the most commonly used input
devices.
OutputUnit
Theoutputunitprovidestheresults ofcomputerprocesstotheusersi.eit links
thecomputer withthe external environment. Most of the output data is the form of
audio or video. Thedifferent output devices are monitors, printers, speakers,
headphones etc.
4
OperatingSystems
StorageUnit
Storageunitcontains manycomputercomponentsthatareusedtostore data.
It is traditionally divided into primary storage andsecondary storage.
Primarystorageis alsoknown as the main memory andis the memorydirectly
accessiblebytheCPU.Secondaryorexternalstorageisnotdirectlyaccessible by
the CPU. The data from secondary storage needs to be brought intothe
primarystoragebeforetheCPU can useit.Secondarystoragecontains alarge
amount of data permanently.
ArithmeticLogicUnit
All the calculations related to the computer system are performed by the
arithmetic logic unit. It can perform operations like addition, subtraction,
multiplication, division etc. Thecontrol unit transfers data from storage unit to
arithmeticlogicunitwhencalculationsneedtobeperformed.Thearithmeticlogic unit
and thecontrol unit together form the central processing unit.
ControlUnit
This unit controls all the other units of the computer system and so is
known as its central nervous system. It transfers data throughout the computer
asrequiredincludingfromstorageunittocentralprocessingunitandviceversa. The
control unit also dictates how the memory, input output devices, arithmetic logic
unit etc. should behave.
V. OperatingSystemArchitecture:
The operating system can be implemented with the help of various
structures. The structure of the OS depends mainly on how the various standard
componentsoftheoperatingsystemareinterconnectedandmeldedintothekernel. A design
known as an operating system enables user application programs to communicate with
the machine’s hardware. Given its complex design and need to be easy to use and
modify, the operating system should be constructed with the utmost care.A system
structurefor an operating system is like the blueprint of how an OS is organized and
how its different parts interact with each other.
TypesofOperatingSystemsStructures
Dependingonthis,wehavethefollowingstructuresintheoperatingsystem:
Simple/MonolithicStructure
Micro-KernelStructure
Hybrid-KernelStructure
Exo-KernelStructure
LayeredStructure
ModularStructure
VirtualMachines
5
OperatingSystems
Simple/Monolithicstructure
Such operating systems do not have well-defined structures and are small, simple,
and limited. The interfaces and levels of functionality are not well separated. MS-
DOS is an example of such an operating system. In MS-DOS, application programs
are able to access the basic I/O routines. These types of operating systems cause
the entire system to crash if one ofthe user programs fails.
AdvantagesofSimple/MonolithicStructure
It delivers better application performance because of the few interfaces
between the application program and the hardware.
Itiseasyforkerneldeveloperstodevelopsuchanoperatingsystem.
DisadvantagesofSimple/MonolithicStructure
The structure is very complicated, as no clear boundaries exist between
modules.
Itdoesnotenforcedatahidingintheoperatingsystem.
Micro-KernelStructure
This structure designs the operating system by removing all non-essentialcomponents
from the kernel and implementing them as system and user programs. This results in
asmaller kernel called the micro-kernel. It is more secure and reliable as if a service
fails, then rest of the operating system remains untouched. Mac OS is an example of
this type of OS.
AdvantagesofMicro-kernelStructure
Itmakestheoperatingsystemportabletovariousplatforms.
Asmicrokernelsaresmallsothesecanbetestedeffectively.
DisadvantagesofMicro-kernelStructure
Increasedlevelofintermodulecommunicationdegradessystemperformance.
6
OperatingSystems
Hybrid-KernelStructure
Hybrid-kernel structure is nothing but just a combination of both monolithic-kernel
structure and micro-kernel structure. Basically, it combines properties of both
monolithic and micro-kernel and make a more advance and helpful approach. It
implement speed and design of monolithic and modularity and stability of micro-
kernel structure.
AdvantagesofHybrid-KernelStructure
It offers good performance as it implements the advantages of both structure init.
Itsupportsawiderangeofhardwareandapplications.
It provides better isolation and security by implementing micro-kernel
approach.
It enhances overall system reliability by separating critical functions into micro-
kernel for debugging and maintenance.
DisadvantagesofHybrid-KernelStructure
It increases overall complexity of system by implementing both structure
(monolithic and micro) and making the system difficult to understand.
The layer of communication between micro-kernel and other component
increases time complexity and decreases performance compared to monolithic
kernel.
Exo-KernelStructure
Exokernel is an operating system developed at MIT to provide application-level
management of hardware resources. By separating resource management from
protection, the exokernel architecture aims to enable application-specific
customization. Due to its limited operability, exokernel size typically tends to be
minimal.
The OSwillalwayshave animpactonthe functionality,performance,andscope of the apps
that are developed on it because it sits in between the software and the hardware. The
exokernel operating system makes an attempt to address this problem
byrejectingthenotionthatanoperatingsystemmustprovideabstractionsupon which to
base applications. The objective is to limit developers use of abstractions as little as
possible while still giving them freedom.
AdvantagesofExo-Kernel
Supportforimprovedapplicationcontrol.
Separatesmanagementfromsecurity.
Itimprovestheperformanceoftheapplication.
Itissimplertotestandcreatenewoperatingsystems.
Each user-space program is allowed to use a custom memory management
system.
7
OperatingSystems
DisadvantagesofExo-Kernel
Adeclineinconsistency.
Exokernelinterfaceshavea complexarchitecture.
LayeredStructure
An OS can be broken into piecesand retain much more controlover the
system.In thisstructure,the OS isbrokeninto a numberoflayers(levels).The bottom layer
(layer 0) is the hardware, and the topmost layer (layer N) is the user interface. These
layers are so designed that each layeruses the functions of thelower-level layers. This
simplifies the debugging process, if lower-level layers are debugged and an error
occurs during debugging, then the error must be on that layer only, as the lower-level
layers have already been debugged.
The main disadvantage of this structure is that at each layer, the data needs to
be modified and passed on which adds overhead to the system. Moreover, careful
planning of the layers is necessary, asa layer can use only lower-level
layers.UNIXisanexampleofthisstructure.
AdvantagesofLayeredStructure
Layering makes it easier to enhance the operating system, as
theimplementationofa layercan be changed easily withoutaffecting the otherlayers.
Itisveryeasytoperformdebuggingandsystemverification.
DisadvantagesofLayeredStructure
In this structure, the application’s performance is degraded as compared to
simple structure.
It requires careful planning for designing the layers, as the higher layers use
the functionalities of only the lower layers.
ModularStructure
It is considered as the best approach for an OS. It involves designing of a
modular kernel. The kernel has only a set of core components and other services are
added as dynamically loadable modules to the kernel either during runtime or boot
time.Itresembleslayeredstructure due to the fact thateachkernelhas definedand
8
OperatingSystems
protected interfaces, but it is more flexible than a layered structure as a module can
call any othermodule.Forexample Solaris OS isorganizedas shownin the figure.
VMs(VirtualMachines)
Based on our needs, a virtual machine abstracts the hardware of our personal
computer, including the CPU, disc drives, RAM, and NIC (Network Interface
Card),into a variety of different execution contexts, giving us the impression that each
execution environmentis a differentcomputer. An illustration ofit isa virtual box.
An operating system enables us to run multiple processes concurrently while
making it appear as though each one is using a different processor and virtual
memory by using CPU scheduling and virtual memory techniques.
VI. OperatingSystemServices:
Programexecution
InputOutputOperations
CommunicationbetweenProcess
FileManagement
MemoryManagement
ProcessManagement
SecurityandPrivacy
ResourceManagement
UserInterface
Networking
Errorhandling
TimeManagement
9
OperatingSystems
ProgramExecution
It is the Operating System that manages how a program is going to be
executed. It loads the program into the memory after which it is executed. The
orderin which they are executed dependson the CPU Scheduling Algorithms. A few
are FCFS, SJF, etc. When the program is in execution, the Operating System also
handles deadlock i.e. no two processes come for execution at the same time. The
Operating System is responsible for the smooth execution of both user and system
programs. The Operating System utilizes various resources available for the efficient
running of all types of functionalities.
InputOutputOperations
Operating System manages the input-output operations and establishes
communication between the user and device drivers. Device drivers are software
thatisassociatedwithhardware thatisbeingmanagedby the OS so thatthe sync
betweenthedevicesworksproperly.Italsoprovidesaccesstoinput-outputdevices to a
program when needed.
CommunicationBetweenProcesses
The Operating system manages the communication between processes.
Communication between processes includes data transfer among them. If the
processes are not on the same computer but connected through a computer network,
then also their communication ismanaged by the Operating System itself.
FileManagement
The operating systemhelpsin managing filesalso.Ifa programneedsaccess
toafile,itistheoperatingsystemthatgrantsaccess.Thesepermissionsinclude read-
only,read-write,etc.Italsoprovidesaplatformfortheusertocreate,anddelete
files. The Operating System is responsible for making decisions regarding the storage
of all types of data or files, i.e, floppy disk/hard disk/pen drive, etc. The Operating
System decides how the data should be manipulatedand stored.
MemoryManagement
Let’s understand memory management by OS in simple way. Imagine a cricket
team with limited number of player . The team manager (OS) decide whether the
upcomingplayerwillbe in playing11 ,playing15orwillnotbe includedin team , based on his
performance . In the same way, OS first check whether the upcoming program fulfil all
requirement to get memory space or not ,if all things good, it checks
howmuchmemoryspacewillbe sufficientforprogramandthenloadtheprogram into
memoryat certainlocation.And thus ,it preventsprogram fromusing unnecessary
memory.
ProcessManagement
Let’s understand the process management in unique way. Imagine, our kitchen
stove asthe (CPU)where allcooking(execution)isreally happenand chefasthe (OS)who
uses kitchen-stove(CPU) to cook differentdishes(program). The chef(OS)
10
OperatingSystems
11
OperatingSystems
VII. UserOperatingSystemInterface
The user and operating system are connected with each other with the help of
interface, so interface is used to connect the user and OS. In computers there are
differenttypes ofinterfacethatcanbeusedforconnectionwithcomputerstousersand their
connection is responsible for data transfer.
Commandlineinterface
Thecommandlineinterfaceisnecessarybecauseallthebasic operationsinthe
computer are performed with the help of the OS and it is responsible for memory
management. By using this we can divide the memory and wecan use the memory.
CommandLineInterfaceadvantages−
ControlsOSorapplication
fastermanagement
abilitytostorescriptswhichhelpsinautomatingregulartasks.
Troubleshootnetworkconnectionissues.
CommandLineInterfacedisadvantages−
Thesteeperlearningcurveisassociatedwithmemorizingcommands anda
complex syntax.
Differentcommandsareusedindifferentshells.
Graphicaluserinterface
12
OperatingSystems
ThebasiccomponentsofGUIsare−
Startmenuwithprogramgroups
Taskbarwhichshowingrunningprograms
Desktopscreen
Differenticonsandshortcuts.
SystemCalls,
NeedofSystemCall:
Therearevarioussituationswhereyou mustrequiresystemcallsintheoperating
system. Following of the situations are as follows:
Itismustrequirewhenafilesystemwantstocreateordeleteafile.
Networkconnectionsrequirethesystemcallstosendingandreceivingdata
packets.
Ifyouwanttoreadorwriteafile,youneedtosystemcalls.
Ifyou wanttoaccesshardwaredevices,includingaprinter,scanner,you needa
system call.
Systemcallsareusedtocreateandmanagenew processes.
VIIITypesofSystemCalls
TypesofSystemCalls
Therearecommonlyfivetypesofsystemcalls.Theseareasfollows:
ProcessControl
FileManagement
DeviceManagement
InformationMaintenance
Communication
13
OperatingSystems
ProcessControl:
Process control is the system call that is used to direct the processes. Some
processcontrolexamplesincludecreating,load,abort,end,execute,process,terminate the
process, etc.
FileManagement:
DeviceManagement:
InformationMaintenance:
Communication:
IX.OverviewofUNIXOperatingSystem
14
OperatingSystems
X,BasicFeaturesofUnix
15
OperatingSystems
16