INTRODUCTION AND OVERVIEW
Today’s world is an information-rich world and it has become a necessity for everyone to know
about computers. A computer is an electronic data processing device, which accepts and
stores data input, processes the data input, and generates the output in a required format.
If we look at it in a very broad sense, any digital computer carries out the following five
functions
Functionalities of Computers
Step 1 − Takes data as input.
Step 2 − Stores the data/instructions in its memory and uses them as required.
Step 3 − Processes the data and converts it into useful information.
Step 4 − Generates the output.
Step 5 − Controls all the above four steps.
Advantages of Computers
Following are certain advantages of computers.
High Speed
Computer is a very fast device.
It is capable of performing calculation of very large amount of data.
The computer has units of speed in microsecond, nanosecond, and even the
picosecond.
It can perform millions of calculations in a few seconds as compared to man who will
spend many months to perform the same task.
Accuracy
In addition to being very fast, computers are very accurate.
The calculations are 100% error free.
Computers perform all jobs with 100% accuracy provided that the input is correct.
Storage Capability
Memory is a very important characteristic of computers.
A computer has much more storage capacity than human beings.
It can store large amount of data.
It can store any type of data such as images, videos, text, audio, etc.
Diligence
Unlike human beings, a computer is free from monotony, tiredness, and lack of
concentration.
It can work continuously without any error and boredom.
It can perform repeated tasks with the same speed and accuracy.
Versatility
A computer is a very versatile machine.
A computer is very flexible in performing the jobs to be done.
This machine can be used to solve the problems related to various fields.
At one instance, it may be solving a complex scientific problem and the very next
moment it may be playing a card game.
Reliability
A computer is a reliable machine.
Modern electronic components have long lives.
Computers are designed to make maintenance easy.
Automation
Computer is an automatic machine.
Automation is the ability to perform a given task automatically. Once the computer
receives a program i.e., the program is stored in the computer memory, then the
program and instruction can control the program execution without human
interaction.
Reduction in Paper Work and Cost
The use of computers for data processing in an organization leads to reduction in paper
work and results in speeding up the process.
As data in electronic files can be retrieved as and when required, the problem of
maintenance of large number of paper files gets reduced.
Though the initial investment for installing a computer is high, it substantially reduces
the cost of each of its transaction.
Disadvantages of Computers
Following are certain disadvantages of computers.
No I.Q.
A computer is a machine that has no intelligence to perform any task.
Each instruction has to be given to the computer.
A computer cannot take any decision on its own.
Dependency
It functions as per the user’s instruction, thus it is fully dependent on humans.
Environment
The operating environment of the computer should be dust free and suitable.
No Feeling
Computers have no feelings or emotions.
It cannot make judgment based on feeling, taste, experience, and knowledge unlike
humans.
History of Operating Systems
The First Generation (1945–55) Vacuum Tubes and Plugboards
After Babbage's unsuccessful efforts, little progress was made in constructing digital computers
until World War II. Around the mid-1940s, Howard Aiken at Harvard, John von Neumann at the
Institute for Advanced Study in Princeton, J. Presper Eckert and William Mauchley at the
University of Pennsylvania, and Konrad Zuse in Germany, among others, all succeeded in
building calculating engines. The first ones used mechanical relays but were very slow, with
cycle times measured in seconds. Relays were later replaced by vacuum tubes. These machines
were enormous, filling up entire rooms with tens of thousands of vacuum tubes, but they were
still millions of times slower than even the cheapest personal computers available today.
In these early days, a single group of people designed, built, programmed, operated, and
maintained each machine. All programming was done in absolute machine language, often by
wiring up plugboards to control the machine's basic functions. Programming languages were
unknown (even assembly language was unknown). Operating systems were unheard of. The
usual mode of operation was for the programmer to sign up for a block of time on the signup
sheet on the wall, then come down to the machine room, insert his or her plugboard into the
computer, and spend the next few hours hoping that none of the 20,000 or so vacuum tubes
would burn out during the run. Virtually all the problems were straightforward numerical
calculations, such as grinding out tables of sines, cosines, and logarithms. By the early 1950s,
the routine had improved somewhat with the introduction of punched cards. It was now
possible to write programs on cards and read them in instead of using plugboards; otherwise,
the procedure was the same.
The Second Generation (1955-1965)
The Third Generation (1965-1980), The Fourth Generation (1980-Present Day)
Operating system structure
The Operating System is a program with the following features −
An operating system is a program that acts as an interface between the software and
the computer hardware.
It is an integrated set of specialized programs used to manage overall resources and
operations of the computer.
It is a specialized software that controls and monitors the execution of all other
programs that reside in the computer, including application programs and other system
software.
Objectives of Operating System
The objectives of the operating system are −
To make the computer system convenient to use in an efficient manner.
To hide the details of the hardware resources from the users.
To provide users a convenient interface to use the computer system.
To act as an intermediary between the hardware and its users, making it easier for the
users to access and use other resources.
To manage the resources of a computer system.
To keep track of who is using which resource, granting resource requests, and
mediating conflicting requests from different programs and users.
To provide efficient and fair sharing of resources among users and programs.
Characteristics of Operating System
Here is a list of some of the most prominent characteristic features of Operating Systems
Memory Management − Keeps track of the primary memory, i.e. what part of it is in
use by whom, what part is not in use, etc. and allocates the memory when a process or
program requests it.
Processor Management − Allocates the processor (CPU) to a process and deallocates
the processor when it is no longer required.
Device Management − Keeps track of all the devices. This is also called I/O controller
that decides which process gets the device, when, and for how much time.
File Management − Allocates and de-allocates the resources and decides who gets the
resources.
Security − Prevents unauthorized access to programs and data by means of passwords
and other similar techniques.
Job Accounting − Keeps track of time and resources used by various jobs and/or users.
Control Over System Performance − Records delays between the request for a service
and from the system.
Interaction with the Operators − Interaction may take place via the console of the
computer in the form of instructions. The Operating System acknowledges the same,
does the corresponding action, and informs the operation by a display screen.
Error-detecting Aids − Production of dumps, traces, error messages, and other
debugging and error-detecting methods.
Coordination Between Other Software and Users − Coordination and assignment of
compilers, interpreters, assemblers, and other software to the various users of the
computer systems.
FUNCTIONS OF AN OPERATING SYSTEM
Although some operating systems offer unique features or designs, most have a consistent set
of functions at their core:
The user interface, either a graphical user interface (GUI) or a command-line
interface (CLI), provides a way for users to interact with the operating system and
perform operations outside of an application. The primary difference between these
types of user interfaces is that a CLI uses a text-based terminal, whereas a GUI
provides a visual desktop with icons and virtual buttons.
The software platform is what gives application programs the foundation to operate.
In most cases, an operating system launches and maintains the applications,
facilitates the input to and output from the hardware, and manages the resources
being used to run the application. These applications can also send requests for the
operating system to perform specific tasks using an application program interface
(API).
The kernel provides base-level management of a device’s underlying hardware. This
includes the central processing unit (CPU), memory, USB ports, graphics devices, and
storage devices.
DESKTOP OPERATING SYSTEMS
Most devices come with an operating system already preloaded. As such, the operating system
a device has depends on the hardware manufacturer. A desktop or laptop computer will
typically use one of the following operating systems:
Microsoft Windows represents the largest share of operating systems in use today.
Microsoft distributes Windows across its line of Surface devices and also licenses the
software to almost all PC manufacturers including Dell, HP, Lenovo, Asus, and Acer.
macOS (formerly Mac OS X) is the operating system exclusive to Apple devices.
Famous for its closed architecture designs, Apple developed macOS to run
exclusively on its collection of Mac laptops and desktops.
Linux is an open source operating system that’s freely distributed for a number of
hardware platforms. The Linux OS family was developed in the 1990s as a derivative
of the commercial UNIX operating system.
MOBILE OPERATING SYSTEMS
Most mobile devices, from smartphones to tablets to smartwatches, have dedicated operating
systems that provide unique functionalities. Because these devices are usually smaller and offer
limited resources, the operating systems prioritize efficiency and responsiveness. Popular
developers for mobile device operating systems include:
Apple, which has developed separate operating systems for each of its mobile
devices: iOS for iPhone, iPadOS, and watchOS. Alongside macOS, each of these
operating systems leverage iCloud to create a seamless user experience across
devices.
Microsoft, which included support for tablets in its 2015 release of Windows 10.
Google, whose Android operating system dominates the market for tablets and
smartphones. Amazon’s line of Fire tablets use an adapted version of the Android
software, called Fire OS, that maintains most of the core features but has a heavier
focus on Amazon services like Prime Video, Amazon Music, Kindle, and Audible.
REAL-TIME OPERATING SYSTEMS
Some operating systems are embedded in devices that serve a niche purpose, like medical
devices, automated teller machines (ATMs), and smart home devices. These operating systems
are called real-time operating systems (RTOS) because they perform actions within a set
amount of time and process data as soon as it’s received. An RTOS is generally much lighter
than a mobile or desktop operating system, so it’s developed to execute a limited number of
operations with high efficiency and reliability.
PROCESS MANAGEMENT
A Program does nothing unless its instructions are executed by a CPU. A program in execution is
called a process. In order to accomplish its task, process needs the computer resources.
There may exist more than one process in the system which may require the same resource at
the same time. Therefore, the operating system has to manage all the processes and the
resources in a convenient and efficient way.
Some resources may need to be executed by one process at one time to maintain the
consistency otherwise the system can become inconsistent and deadlock may occur.
The operating system is responsible for the following activities in connection with Process
Management
1. Scheduling processes and threads on the CPUs.
2. Creating and deleting both user and system processes.
3. Suspending and resuming processes.
4. Providing mechanisms for process synchronization.
5. Providing mechanisms for process communication.
Attributes of a process
The Attributes of the process are used by the Operating System to create the process control
block (PCB) for each of them. This is also called context of the process. Attributes which are
stored in the PCB are described below.
1. Process ID
When a process is created, a unique id is assigned to the process which is used for unique
identification of the process in the system.
2. Program counter
A program counter stores the address of the last instruction of the process on which the
process was suspended. The CPU uses this address when the execution of this process is
resumed.
3. Process State
The Process, from its creation to the completion, goes through various states which are new,
ready, running and waiting. We will discuss about them later in detail.
4. Priority
Every process has its own priority. The process with the highest priority among the processes
gets the CPU first. This is also stored on the process control block.
5. General Purpose Registers
Every process has its own set of registers which are used to hold the data which is generated
during the execution of the process.
6. List of open files
During the Execution, Every process uses some files which need to be present in the main
memory. OS also maintains a list of open files in the PCB
OS also maintain the list of all open devices which are used during the execution of the process.
Process State. The process, from its creation to completion, passes through various
states. The minimum number of states is five.
The names of the states are not standardized although the process may be in one of
the following states during execution
New
A program which is going to be picked up by the OS into the main memory is called a new
process.
2. Ready
Whenever a process is created, it directly enters in the ready state, in which, it waits for the
CPU to be assigned. The OS picks the new processes from the secondary memory and put all of
them in the main memory.
The processes which are ready for the execution and reside in the main memory are called
ready state processes. There can be many processes present in the ready state.
3. Running
One of the processes from the ready state will be chosen by the OS depending upon the
scheduling algorithm. Hence, if we have only one CPU in our system, the number of running
processes for a particular time will always be one. If we have n processors in the system then
we can have n processes running simultaneously.
4. Block or wait
From the Running state, a process can make the transition to the block or wait state depending
upon the scheduling algorithm or the intrinsic behavior of the process.
When a process waits for a certain resource to be assigned or for the input from the user then
the OS move this process to the block or wait state and assigns the CPU to the other processes.
5. Completion or termination
When a process finishes its execution, it comes in the termination state. All the context of the
process (Process Control Block) will also be deleted the process will be terminated by the
Operating system.
6. Suspend ready
A process in the ready state, which is moved to secondary memory from the main memory due
to lack of the resources (mainly primary memory) is called in the suspend ready state.
If the main memory is full and a higher priority process comes for the execution then the OS
have to make the room for the process in the main memory by throwing the lower priority
process out into the secondary memory. The suspend ready processes remain in the secondary
memory until the main memory gets available.
7. Suspend wait
Instead of removing the process from the ready queue, it's better to remove the blocked
process which is waiting for some resources in the main memory. Since it is already waiting for
some resource to get available hence it is better if it waits in the secondary memory and make
room for the higher priority process. These processes complete their execution once the main
memory gets available and their wait is finished.
Operations on the Process
1. Creation
Once the process is created, it will be ready and come into the ready queue (main memory) and
will be ready for the execution.
2. Scheduling
Out of the many processes present in the ready queue, the Operating system chooses one
process and start executing it. Selecting the process which is to be executed next, is known as
scheduling.
3. Execution
Once the process is scheduled for the execution, the processor starts executing it. Process may
come to the blocked or wait state during the execution then in that case the processor starts
executing the other processes.
4. Deletion/killing
Once the purpose of the process gets over then the OS will kill the process. The Context of the
process (PCB) will be deleted and the process gets terminated by the Operating system.
PROCESS ARCHITECTURE
Process Architecture Image
Here, is an Architecture diagram of the Process
Stack: The Stack stores temporary data like function parameters, returns addresses, and
local variables.
Heap Allocates memory, which may be processed during its run time.
Data: It contains the variable.
Text: Text Section includes the current activity, which is represented by the value of the
Program Counter.
Process Control Block (PCB)
Every process is represented in the operating system by a process control block, which is also
called a task control block.
Here, are important components of PCB
Process Control Block
Process state: A process can be new, ready, running, waiting, etc.
Program counter: The program counter lets you know the address of the next instruction,
which should be executed for that process.
CPU registers: This component includes accumulators, index and general-purpose registers,
and information of condition code.
CPU scheduling information: This component includes a process priority, pointers for
scheduling queues, and various other scheduling parameters.
Accounting and business information: It includes the amount of CPU and time utilities like
real time used, job or process numbers, etc.
Memory-management information: This information includes the value of the base and
limit registers, the page, or segment tables. This depends on the memory system, which is
used by the operating system.
I/O status information: This block includes a list of open files, the list of I/O devices that are
allocated to the process, etc.
Summary:
A process is defined as the execution of a program that performs the actions specified in
that program.
Process management involves various tasks like creation, scheduling, termination of
processes, and a dead lock.
The important elements of Process architecture are 1)Stack 2) Heap 3) Data, and 4) Text
The PCB is a full form of Process Control Block. It is a data structure that is maintained
by the Operating System for every process
A process state is a condition of the process at a specific instant of time.
Every process is represented in the operating system by a process control block, which is
also called a task control block.
Concurrent Processes in Operating System
Concurrent processing is a computing model in which multiple processors execute
instructions simultaneously for better performance. Concurrent means, which occurs when
something else happens. The tasks are broken into sub-types, which are then assigned to
different processors to perform simultaneously, sequentially instead, as they would have to
be performed by one processor. Concurrent processing is sometimes synonymous with
parallel processing .
The term real and virtual concurrency in concurrent processing:
1. Multiprogramming Environment: In multiprogramming environment, there are multiple
tasks shared by one processor. While a virtual concert can be achieved by the operating
system, if the processor is allocated for each individual task, so that the virtual concept is
visible if each task has a dedicated processor. The multilayer environment shown in figure.
2. Multiprocessing Environment : In multiprocessing environment two or more
processors are used with shared memory. Only one virtual address space is used,
which is common for all processors. All tasks reside in shared memory. In this
environment, concurrency is supported in the form of concurrently executing
processors. The tasks executed on different processors are performed with each other
through shared memory. The multiprocessing environment is shown in figure.
Distributed Processing Environment : In a distributed processing environment, two or
more computers are connected to each other by a communication network or high speed
bus. There is no shared memory between the processors and each computer has its own
local memory. Hence a distributed application consisting of concurrent tasks, which are
distributed over network communication via messages. The distributed processing
environment is shown in figure.