Introduction To OS
Introduction To OS
Introduction: Architecture, Goals, Structures of O.S, Evolution of OS, types of OS, services
provided by OS, system programs and system calls, system design and implementation.
Operating System
The operating system provides an environment for the users to execute computer programs. Operating
systems are already installed on the computers you buy for eg personal computers have windows,
Linux, and macOS, mainframe computers have z/OS, z/VM, etc, and mobile phones have operating
systems such as Android, and iOS. The architecture of an operating system consists of four major
components hardware, kernel, shell, and application and we shall explore all of them in detail one by
one.
Operating System can be defined as an interface between user and the hardware. It provides an
environment to the user so that, the user can perform its task in convenient and efficient way.
In the Computer System (comprises of Hardware and software), Hardware can only understand
machine code (in the form of 0 and 1) which doesn't make any sense to a naive user.
We need a system which can act as an intermediary and manage all the processes and resources present
in the system.
An Operating System can be defined as an interface between user and hardware. It is responsible
for the execution of all the processes, Resource Allocation, CPU management, File Management and
many other tasks.
The purpose of an operating system is to provide an environment in which a user can execute programs
in convenient and efficient manner.
The operating system gives an environment for executing programs by the users.
Kernel is the most central part of the operating systems.
Software running on any operating system can be system software and application software.
The operating system as we know is an intermediary and its functionalities include file
management, memory management, process management, handling input and output, and
peripheral devices as well.
The operating system handles all of the above tasks for the system and application software.
The architecture of an operating system is basically the design of its software and hardware
components. Depending upon the tasks or programs we need to run users can use the operating
system most suitable for that program/software.
Before explaining various architectures of the operating systems, let's explore a few terms first which
are part of the operating system.
1) Application: The application represents the software that a user is running on an operating system
it can be either system or application software eg slack, sublime text editor, etc.
2) Shell: The shell represents software that provides an interface for the user where it serves to
launch or start some program for which the user gives instructions.
It can be of two types first is a command line and another is a graphical user interface for eg: MS-
DOS Shell, PowerShell, csh, ksh, etc.
3) Kernel: Kernel represents the most central and crucial part of the operating system where it is
used for resource management i.e. it provides necessary I/O, processor, and memory to the
application processes through inter-process communication mechanisms and system calls. Let's
understand the various types of architectures of the operating system.
Architectures of operating systems can be of four types monolithic, layered, microkernel, and hybrid.
Hybrid architecture is the combination of all architectures. There are major four major types of
architectures of operating systems.
1) Monolithic Architecture
In monolithic architecture, each component of the operating system is contained in the kernel i.e. it is
working in kernel space, and the components of the operating system communicate with each other
using function calls.
MM- Memory Scheduler IPC- Interprocess Communication
Advantages:
1. The main advantage of having a monolithic architecture of the operating system is that it
provides CPU scheduling, memory management, memory management, etc through system
calls.
2. In a single address space, the entire large process is running.
3. It is a single static binary file.
Disadvantages:
1. The main disadvantage is that all components are interdependent and when one of them fails
the entire system fails.
2. In case the user has to add a new service or functionality the entire operating system needs to
be changed.
2) Layered architecture
In Layered architecture, components with similar functionalities are grouped to form a layer and in this
way, total n+1 layers are constructed and counted from 0 to n where each layer has a different set of
functionalities and services. Example: THE operating system, also Windows XP, and LINUX
implements some level of layering.
1. Each layer can communicate with all of its lower layers but not with its upper layer i.e. any ith
layer can communicate with all layers from 0 to i-1 but not with the i+1th layer.
2. Each layer is designed in such a way that it will only need the functionalities that are present in
itself or the layers below it.
1) Hardware: This layer is the lowest layer in the layered operating system architecture, this layer is
responsible for the coordination with peripheral devices such as keyboards, mice, scanners etc.
2) CPU scheduling: This layer is responsible for process scheduling, multiple queues are used for
scheduling. Process entering the system are kept in the job queue while those which are ready to be
executed are put into the ready queue. It manages the processes which are to be kept in the CPU and
those which are to be kept out of the CPU.
3) Memory Management: This layer handles the aspect of memory management i.e. moving the
processes from the secondary to primary memory for execution and vice-versa. There are memories
like RAM and ROM. RAM is the memory where our processes run they are moved to the RAM for
execution and when they exit they are removed from RAM.
4) Process Management: This layer is responsible for managing the various processes i.e. assigning
the CPU to those processes on a priority basis for their execution. Process management uses many
scheduling algorithms for prioritizing the processes for execution such as the Round-Robin algorithm,
FCFS(First Come First Serve), SJF(Shortest Job First), etc.
5) I/O Buffer: Buffering is the temporary storage of data and I/O Buffer means that the data input is
first buffered before storing it in the secondary memory. All I/O devices have buffers attached to them
for the temporary storage of the input data because it cannot be stored directly in the secondary storage
as the speed of the I/O devices is slow as compared to the processor.
6) User Programs: This is the application layer of the layered architecture of the operating system, it
deals with all the application programs running eg games, browsers, words, etc. It is the highest layer
of layered architecture.
Advantages:
1) Layered architecture of the operating system provides modularity because each layer is programmed
to perform its own tasks only.
2) Since the layered architecture has independent components changing or updating one of them will
not affect the other component or the entire operating system will not stop working, hence it is easy to
debug and update.
3) The user can access the services of the hardware layer but cannot access the hardware layer itself
because it is the innermost layer.
4) Each layer has its own functionalities and it is concerned with itself only and other layers are
abstracted from it.
Disadvantages:
1. Layered architecture is complex in implementation because one layer may use the services of
the other layer and therefore, the layer using the services of another layer must be put below
the other one.
2. In a layered architecture, if one layer wants to communicate with another it has to send a request
that goes through all layers in between which increases response time causing inefficiency in
the system.
3) Microkernel Architecture
In this architecture, the components like process management, networking, file system interaction, and
device management are executed outside the kernel while memory management and synchronization
are executed inside the kernel. The processes inside the kernel have relatively high priority, the
components possess high modularity hence even if one or more components fail the operating system
keeps on working.
Advantages:
1. Microkernel operating systems are modular and hence, disturbing one of the components will
not affect the other component.
2. The architecture is compact and isolated and hence relatively efficient.
3. New features can be added without recompilation.
Disadvantages:
4) Hybrid Architecture
Hybrid architecture as the name suggests consists of a hybrid of all the architectures explained so far
and hence it has properties of all of those architectures which makes it highly useful in present-day
operating systems.
1) Hardware abstraction layer: It is the interface between the kernel and hardware and is present at
the lowest level.
2) Microkernel Layer: This is the old microkernel that we know and it consists of CPU scheduling,
memory management, and inter-process communication.
3) Application Layer: It acts as an interface between the user and the microkernel. It contains
functionalities like a file server, error detection, I/O device management, etc.
Example: Microsoft Windows NT kernel implements a hybrid architecture of the operating system.
Advantages:
1. Since it is a hybrid of other architectures it allows various architectures to provide their services
respectively.
2. It is easy to manage because it uses a layered approach.
3. The number of layers is relatively lesser.
4. Security and protection are relatively improved.
Disadvantage:
1)Hybrid architecture of the operating system keeps certain services in the kernel space while moving
less critical services to the user space.
Generations of Operating System
When the first electronic computer was developed in 1940, it was created without any operating system.
In early times, users have full access to the computer machine and write a program for each task in
absolute machine language. The programmer can perform and solve only simple mathematical
calculations during the computer generation, and this calculation does not require an operating system.
The first operating system (OS) was created in the early 1950s and was known as GMOS. General
Motors has developed OS for the IBM computer. The second-generation operating system was based
on a single stream batch processing system because it collects all similar jobs in groups or batches and
then submits the jobs to the operating system using a punch card to complete all jobs in a machine. At
each completion of jobs (either normally or abnormally), control transfer to the operating system that
is cleaned after completing one job and then continues to read and initiates the next job in a punch card.
After that, new machines were called mainframes, which were very big and used by professional
operators.
During the late 1960s, operating system designers were very capable of developing a new operating
system that could simultaneously perform multiple tasks in a single computer program called
multiprogramming. The introduction of multiprogramming plays a very important role in developing
operating systems that allow a CPU to be busy every time by performing different tasks on a computer
at the same time. During the third generation, there was a new development of minicomputer's
phenomenal growth starting in 1961 with the DEC PDP-1. These PDP's leads to the creation of personal
computers in the fourth generation.
The fourth generation of operating systems is related to the development of the personal computer.
However, the personal computer is very similar to the minicomputers that were developed in the third
generation. The cost of a personal computer was very high at that time; there were small fractions of
minicomputers costs. A major factor related to creating personal computers was the birth of Microsoft
and the Windows operating system. Microsoft created the first window operating system in 1975. After
introducing the Microsoft Windows OS, Bill Gates and Paul Allen had the vision to take personal
computers to the next level. Therefore, they introduced the MS-DOS in 1981; however, it was very
difficult for the person to understand its cryptic commands. Today, Windows has become the most
popular and most commonly used operating system technology. And then, Windows released various
operating systems such as Windows 95, Windows 98, Windows XP and the latest operating system,
Windows 7. Currently, most Windows users use the Windows 10 operating system. Besides the
Windows operating system, Apple is another popular operating system built in the 1980s, and this
operating system was developed by Steve Jobs, a co-founder of Apple. They named the operating
system Macintosh OS or Mac OS.
Advantages of Operating System
It allows only a few tasks that can run at the same time.
It any error occurred in the operating system; the stored data can be destroyed.
It is a very difficult task or works for the OS to provide entire security from the viruses because
any threat or virus can occur at any time in a system.
An unknown user can easily use any system without the permission of the original user.
The cost of operating system costs is very high.
1. Process Management
2. Process Synchronization
3. Memory Management
4. CPU Scheduling
5. File Management
6. Security
An operating system is a well-organized collection of programs that manages the computer hardware.
It is a type of system software that is responsible for the smooth functioning of the computer system.
In the 1970s, Batch processing was very popular. In this technique, similar types of jobs were
batched together and executed in time. People were used to having a single computer which was
called a mainframe.
In Batch operating system, access is given to more than one person; they submit their respective jobs
to the system for the execution.
The system put all of the jobs in a queue on the basis of first come first serve and then executes the
jobs one by one. The users collect their respective output when all the jobs get executed.
The purpose of this operating system was mainly to transfer control from one job to another as soon
as the job was completed. It contained a small set of programs called the resident monitor that always
resided in one part of the main memory. The remaining part is used for servicing jobs.
Advantages of Batch OS
The use of a resident monitor improves computer efficiency as it eliminates CPU time
between two jobs.
Disadvantages of Batch OS
1. Starvation
For Example:
There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution time of J1 is very high,
then the other four jobs will never be executed, or they will have to wait for a very long time. Hence
the other processes get starved.
2. Not Interactive
Batch Processing is not suitable for jobs that are dependent on the user's input. If a job requires the
input of two numbers from the console, then it will never get it in the batch processing scenario since
the user is not present at the time of execution.
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.
Advantages of Multiprogramming OS
Throughout the system, it increased as the CPU always had one program to execute.
Response time can also be reduced.
Disadvantages of Multiprogramming OS
In Multiprocessing, Parallel computing is achieved. There are more than one processors present in the
system which can execute more than one process at the same time. This will increase the throughput
of the system.
In Multiprocessing, Parallel computing is achieved. More than one processor present in the system
can execute more than one process simultaneously, which will increase the throughput of the system.
Advantages of Multiprocessing operating system:
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.
Multiprocessing operating system is more complex and sophisticated as it takes care of multiple
CPUs simultaneously.
The multitasking operating system is a logical extension of a multiprogramming system that enables
multiple programs simultaneously. It allows a user to perform more than one computer task at the
same time.
Advantages of Multitasking operating system
The multiple processors are busier at the same time to complete any task in a multitasking
environment, so the CPU generates more heat.
An Operating system, which includes software and associated protocols to communicate with other
computers via a network conveniently and cost-effectively, is called 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.
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.
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.
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.
In the Time Sharing operating system, computer resources are allocated in a time-dependent fashion
to several programs simultaneously. Thus it helps to provide a large number of user's direct access to
the main computer. It is a logical extension of multiprogramming. In time-sharing, the CPU is switched
among multiple programs given by different users on a scheduled basis.
A time-sharing operating system allows many users to be served simultaneously, so sophisticated CPU
scheduling schemes and Input/output management are required.
The time-sharing operating system provides effective utilization and sharing of resources.
This system reduces CPU idle and response time.
The Distributed Operating system is not installed on a single machine, it is divided into parts, and these
parts are loaded on different machines. A part of the distributed Operating system is installed on each
machine to make their communication possible. Distributed Operating systems are much more
complex, large, and sophisticated than Network operating systems because they also have to take care
of varying networking protocols.
Services provided by OS
No matter its size and application, every computer needs an operating system to make it functional and
useful. The operating system is an integral part of modern computer systems. It is a well-organized
collection of programs that manages the hardware.
An Operating System provides an interaction between the users and computer hardware. A user is a
person sitting at the computer terminal concerned about the application rather than the architecture of
the computer. The user never interacts with the hardware directly. To get the services of the hardware,
he has to request through the operating system.
The operating system is a primary resource manager. It manages the hardware, including processors,
memory, Input-Output devices, and communication devices.
The operating system provides the programming environment in which a programmer works on a
computer system. The user program requests various resources through the operating system. The
operating system gives several services to utility programmers and users. Applications access these
services through application programming interfaces or system calls. By invoking those interfaces, the
application can request a service from the operating system, pass parameters, and acquire the operation
outcomes.
Program execution
Control Input/output devices
Program creation
Error Detection and Response
Accounting
Security and Protection
File Management
Communication
Program execution
To execute a program, several tasks need to be performed. Both the instructions and data must be
loaded into the main memory. In addition, input-output devices and files should be initialized, and
other resources must be prepared. The Operating structures handle these kinds of tasks. The user now
no longer should fear the reminiscence allocation or multitasking or anything.
Program Creation
The Operating system offers the structures and tools, including editors and debuggers, to help the
programmer create, modify, and debugging programs.
An Error in a device may also cause malfunctioning of the entire device. These include hardware and
software errors such as device failure, memory error, division by zero, attempts to access forbidden
memory locations, etc. To avoid error, the operating system monitors the system for detecting errors
and takes suitable action with at least impact on running applications.
While working with computers, errors may occur quite often. Errors may occur in the:
Input/ Output devices: For example, connection failure in the network, lack of paper in the
printer, etc.
User program: For example: attempt to access illegal memory locations, divide by zero, use
too much CPU time, etc.
Memory hardware: For example, Memory error, the memory becomes full, etc.
To handle these errors and other types of possible errors, the operating system takes appropriate action
and generates messages to ensure correct and consistent computing.
Accounting
An Operating device collects utilization records for numerous assets and tracks the overall performance
parameters and responsive time to enhance overall performance. These personal records are beneficial
for additional upgrades and tuning the device to enhance overall performance.
Operating device affords safety to the statistics and packages of a person and protects any interference
from unauthorized users. The safety feature counters threats, which are published via way of
individuals out of doors the manage of the running device.
For Example:
When a user downloads something from the internet, that program may contain malicious code that
may harm the already existing programs. The operating system ensures that proper checks are applied
while downloading such programs.
If one computer system is shared amongst a couple of users, then the various processes must be
protected from another intrusion. For this, the operating system provides various mechanisms that
allow only those processes to use resources that have gained proper authorization from the operating
system. The mechanism may include providing unique users ids and passwords to each user.
File management
Computers keep data and information on secondary storage devices like magnetic tape, magnetic disk,
optical disk, etc. Each storage media has its capabilities like speed, capacity, data transfer rate, and data
access methods.
For file management, the operating system must know the types of different files and the characteristics
of different storage devices. It has to offer the proportion and safety mechanism of documents
additionally.
Communication
The operating system manages the exchange of data and programs among different computers
connected over a network. This communication is accomplished using message passing and shared
memory.
System calls and system programs are critical to the operation of the OS. These structures describe the
functions that the operating system must carry out. The system call establishes a connection between
the user software and the operating system's services. In contrast, the system software defines the OS
user interface. The system program also offers a proper environment for the development and execution
of a program. For example, a modern operating system includes system programs such as an
assembler, compiler, editor, loader, etc. These programs enable programmers to create and run new
programs.
System Call
It is a method of interaction with the OS through the system programs. It is a technique in which a
computer system program requests a service from the OS kernel.
The Application Program Interface (API) helps to connect the OS functions with user programs. It
serves as a bridge between a process and the OS, enabling user-level programs to request OS services.
System calls may only be accessed using the kernel system, and any software that consumes resources
must use system calls.
There are mainly five kinds of system calls. These are classified as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
Now, you will learn all these different types of system calls one by one.
Process Control
It is responsible for file manipulation jobs, including creating files, deleting files, reading, opening,
writing, closing, etc.
File Management
It is responsible for file manipulation jobs, including creating files, opening files, deleting files,
closing files, etc.
Device Management
These are responsible for device manipulation, including reading from device buffers, writing into
device buffers, etc.
Information Maintenance
These are used to manage the data and its share between the OS and the user program. Some
common instances of information maintenance are getting time or date, getting system data, setting
time or date, setting system data, etc.
Communication
These are used for inter process communication (IPC). Some examples of IPC are creating, sending,
receiving messages, deleting communication connections, etc.
System Program
System programming may be defined as the act of creating System Software by using the System
Programming Languages. A system program offers an environment in which programs may be
developed and run. In simple terms, the system programs serve as a link between the user interface
(UI) and system calls. Some system programs are only user interfaces, and others are complex. For
instance, a compiler is complicated system software.
The system program is a component of the OS, and it typically lies between the user interface (UI)
and system calls. The system user view is defined by the system programs, not the system call, because
the user view interacts with system programs and is closer to the user interface.
There are mainly six types of system programs. These are classified as follows:
1. File Management
2. Status Information
3. File Modification
4. Programming-Language support
5. Program Loading and Execution
6. Communication
Now, you will learn all these different types of system programs one by one.
File Management
It is a collection of specific information saved in a computer system's memory. File management is
described as manipulating files in a computer system, including the creation, modification, and
deletion of files.
Status Information
Status information is information about the input, output process, storage, and CPU utilization time,
how the process will be computed in how much memory is necessary to execute a task.
File Modification
These system programs are utilized to change files on hard drives or other storage media. Besides
modification, these programs are also utilized to search for content within a file or to change content
within a file.
Programming-Language Support
The OS includes certain standard system programs that allow programming languages such as C,
Visual Basic, C++, Java, and Pearl. There are various system programs, including compilers,
debuggers, assemblers, interpreters, etc.
After Assembling and Compiling, the program must be loaded into the memory for execution. A
loader is a component of an operating system responsible for loading programs and libraries, and it is
one of the most important steps to starting a program. The system includes linkage editors,
relocatable loaders, Overlay loaders, and loaders.
Communication
System program offers virtual links between processes, people, and computer systems. Users may
browse websites, log in remotely, communicate messages to other users via their screens, send
emails, and transfer files from one user to another.
The OS has various head-to-head comparisons between System Call and System Program. Some
comparisons of the System Call and System Program are as follows:
An operating system is a construct that allows the user application programs to interact with the
system hardware. Operating system by itself does not provide any function but it provides an
atmosphere in which different applications and programs can do useful work.
There are many problems that can occur while designing and implementing an operating system.
These are covered in operating system design and implementation.
It is quite complicated to define all the goals and specifications of the operating system while
designing it. The design changes depending on the type of the operating system i.e if it is batch
system, time shared system, single user system, multi user system, distributed system etc.
There are basically two types of goals while designing an operating system. These are −
User Goals
The operating system should be convenient, easy to use, reliable, safe and fast according to the users.
However, these specifications are not very useful as there is no set method to achieve these goals.
System Goals
The operating system should be easy to design, implement and maintain. These are specifications
required by those who create, maintain and operate the operating system. But there is not specific
method to achieve these goals as well.
Implementation
Implementation is the process of writing source code in a high-level programming language, compiling
it into object code, and then interpreting (executing) this object code by means of an interpreter. The
purpose of an operating system is to provide services to users while they run applications on their
computers.
The main function of an operating system is to control the execution of programs. It also provides
services such as memory management, interrupt handling, and file system access facilities so that
programs can be better utilized by users or other devices attached to the system.
An operating system is a program or software that controls the computer’s hardware and resources. It
acts as an intermediary between applications, users, and the computer’s hardware. It manages the
activities of all programs running on a computer without any user intervention.
The operating system performs many functions such as managing the computer’s memory, enforcing
security policies, and controlling peripheral devices. It also provides a user interface that allows users
to interact with their computers.
The operating system is typically stored in ROM or flash memory so it can be run when the computer
is turned on. The first operating systems were designed to control mainframe computers. They were
very large and complex, consisting of millions of lines of code and requiring several people to develop
them.