The document provides an introduction to operating system concepts. It discusses how an operating system acts as an intermediary between the user and computer hardware, managing resources and allowing users to run programs efficiently. It describes the main functions of an operating system, including program execution, I/O operations, file management, communication, error detection, resource allocation, and protection. It also discusses processes, process management, process states, and the process control block which contains information about running processes.
2. Introduction to Operating System Concept:
An operating system acts as an intermediary between the user of a
computer and computer hardware.
The purpose of an operating system is to provide an environment in
which a user can execute programs conveniently and efficiently.
An operating system is a software that manages computer hardware.
The hardware must provide appropriate mechanisms to ensure the
correct operation of the computer system and to prevent user programs
from interfering with the proper operation of the system.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
3. Features of Operating system – Operating system has the following
features:
1.Convenience: An OS makes a computer more convenient to use.
2.Efficiency: An OS allows the computer system resources to be used
efficiently.
3.Ability to Evolve: An OS should be constructed in such a way as to
permit the effective development, testing, and introduction of new
system functions at the same time without interfering with service.
4.Throughput: An OS should be constructed so that It can give
maximum throughput(Number of tasks per unit time).
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
4. Different services provided by Operating System to User.
Following are a few common services provided by an operating system −
Program execution : A process includes the complete execution context
(code to execute, data to manipulate, registers, OS resources in use).
Following are the major activities of an operating system with respect to
program management −
Loads a program into memory.
Executes the program.
Handles program's execution.
Provides a mechanism for process synchronization.
Provides a mechanism for process communication.
Provides a mechanism for deadlock handling.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
5. I/O operations : An I/O subsystem comprises of I/O devices and their
corresponding driver software. Drivers hide the peculiarities of specific
hardware devices from the users.
An Operating System manages the communication between user and
device drivers.
I/O operation means read or write operation with any file or any
specific I/O device.
Operating system provides the access to the required I/O device when
required.
File System manipulation :A file system is normally organized into
directories for easy navigation and usage.
These directories may contain files and other directions. Following are the
major activities of an operating system with respect to file management −
Program needs to read a file or write a file.
The operating system gives the permission to the program for
operation on file.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
6. Permission varies from read-only, read-write, denied and so on.
Operating System provides an interface to the user to create/delete
files.
Operating System provides an interface to the user to create/delete
directories.
Operating System provides an interface to create the backup of file
system.
Communication : The OS handles routing and connection strategies,
and the problems of contention and security.
Following are the major activities of an operating system with respect to
communication −
Two processes often require data to be transferred between them
Both the processes can be on one computer or on different computers,
but are connected through a computer network.
Communication may be implemented by two methods, either by
Shared Memory or by Message Passing.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
7. Error Detection : Errors can occur anytime and anywhere. An error may
occur in CPU, in I/O devices or in the memory hardware.
Following are the major activities of an operating system with respect to error
handling −
The OS constantly checks for possible errors.
The OS takes an appropriate action to ensure correct and consistent
computing.
Resource Allocation : In case of multi-user or multi-tasking environment,
resources such as main memory, CPU cycles and files storage are to be
allocated to each user or job.
Following are the major activities of an operating system with respect to
resource management −
The OS manages all kinds of resources using schedulers.
CPU scheduling algorithms are used for better utilization of CPU.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
8. Protection : Protection refers to a mechanism or a way to control the
access of programs, processes, or users to the resources defined by a
computer system.
Following are the major activities of an operating system with respect to
protection −
The OS ensures that all access to system resources is controlled.
The OS ensures that external I/O devices are protected from invalid
access attempts.
The OS provides authentication features for each user by means of
passwords.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
9. What is a Process?
Process is the execution of a program that performs the actions
specified in that program.
It can be defined as an execution unit where a program runs.
The OS helps you to create, schedule, and terminates the processes
which is used by CPU.
A process created by the main process is called a child process.
Process operations can be easily controlled with the help of
PCB(Process Control Block).
Consider it as the brain of the process, which contains all the crucial
information related to processing like process id, priority, state, CPU
registers, etc.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
10. What is Process Management?
Process management involves various tasks like creation, scheduling,
termination of processes, and a dead lock.
Process is a program that is under execution, which is an important
part of modern-day operating systems.
The OS must allocate resources that enable processes to share and
exchange information.
It also protects the resources of each process from other methods and
allows synchronization among processes.
It is the job of OS to manage all the running processes of the system.
It handles operations by performing tasks like process scheduling and
such as resource allocation.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
11. Process Architecture
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.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
12. Stack
The process Stack contains the temporary data such as
method/function parameters, return address and local variables.
Heap
This is dynamically allocated memory to a process during its run time.
Data
This section contains the global and static variables.
Text
This includes the current activity represented by the value of Program
Counter and the contents of the processor's registers.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
14. A process state is a condition of the process at a specific instant of time. It
also defines the current position of the process.
There are mainly seven stages of a process which are:
New: The new process is created when a specific program calls from
secondary memory/ hard disk to primary memory/ RAM a
Ready: In a ready state, the process should be loaded into the primary
memory, which is ready for execution.
Waiting: The process is waiting for the allocation of CPU time and
other resources for execution.
Executing: The process is an execution state.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
15. Blocked: It is a time interval when a process is waiting for an event like
I/O operations to complete.
Suspended: Suspended state defines the time when a process is ready
for execution but has not been placed in the ready queue by OS.
Terminated: Terminated state specifies the time when a process is
terminated
After completing every step, all the resources are used by a process, and
memory becomes free.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
16. Process Life Cycle:
When a process runs, it goes through many states.
Distinct operating systems have different stages, and the names of these
states are not standardised.
In general, a process can be in one of the five states listed below at any
given time.
1.Start
When a process is started/created first, it is in this state.
2.Ready
Here, the process is waiting for a processor to be assigned to it.
Ready processes are waiting for the operating system to assign them a
processor so that they can run.
The process may enter this state after starting or while running, but the
scheduler may interrupt it to assign the CPU to another process.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
17. 3.Running
When the OS scheduler assigns a processor to a process, the process
state gets set to running, and the processor executes the process
instructions.
4.Waiting
If a process needs to wait for any resource, such as for user input or for a
file to become available, it enters the waiting state.
5.Terminated or Exit
The process is relocated to the terminated state, where it waits for
removal from the main memory once it has completed its execution or
been terminated by the operating system.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
18. Process Control Block(PCB):
PCB stands for Process Control Block.
It is a data structure that is maintained by the Operating System for
every process.
The PCB should be identified by an integer Process ID (PID).
It helps you to store all the information required to keep track of all the
running processes.
It is also accountable for storing the contents of processor registers.
These are saved when the process moves from the running state and
then returns back to it.
The information is quickly updated in the PCB by the OS as soon as the
process makes the state transition.
Every process is represented in the operating system by a process
control block, which is also called a task control block.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
19. Here, are important components of PCB
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.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
20. What is a System Call?
A system call is a method for a computer program to request a service
from the kernel of the operating system on which it is running.
A system call is a method of interacting with the operating system via
programs.
A system call is a request from computer software to an operating
system's kernel.
The Application Program Interface (API) connects the operating
system's functions to user programs.
It acts as a link between the operating system and a process, allowing
user-level programs to request operating system services.
The kernel system can only be accessed using system calls. System calls
are required for any programs that use resources.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune