0% found this document useful (0 votes)
150 views

OS Unit 1 KCA - 203

The document provides an introduction to operating systems, describing their purpose, goals, components and functions. It discusses different types of operating systems including batch, time-sharing and real-time systems.

Uploaded by

Ak Rity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views

OS Unit 1 KCA - 203

The document provides an introduction to operating systems, describing their purpose, goals, components and functions. It discusses different types of operating systems including batch, time-sharing and real-time systems.

Uploaded by

Ak Rity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

OPERATING SYSTEM (KCA-203) Unit 1

INTRODUCTION
1.1 WHAT IS AN OPERATING SYSTEM?
Operating System is a program that acts as an intermediary between a
user and computer hardware.

A computer’s operating system is a group of programs designed to serve two basic


purposes:
• To control the allocation and use of the computing system’s resources
among the various users and tasks, and
• To provide an interface between the computer hardware and the
programmer that simplifies and makes feasible the creation, coding,
debugging, and maintenance of application programs.

GOALS OF AN OPERATING SYSTEM

The primary objective of a computer is to execute an instruction in an efficient


manner and to increase the productivity of processing resources attached with the
computer system such as hardware resources, software resources and the users. In
other words, we can say that maximum CPU utilization is the main objective,
because it is the main device which is to be used for the execution of the programs
or instructions. We can brief the goals as:
• The primary goal of an operating system is to make the computer convenient
to use.
• The secondary goal is to use the hardware in an efficient manner.

Components of Computer System

In a computer system, we find four main components: the hardware, the operating
system, the application software and the users. In a computer system the hardware
provides the basic computing resources. The applications programs define the way
in which these resources are used to solve the computing problems of the users.
The operating system controls and coordinates the use of the hardware among the
various systems programs and application programs for the various users.

1
OPERATING SYSTEM (KCA-203) Unit 1

The abstract view of the components of a computer system and the positioning of
OS is shown in the Figure 1.

Figure 1: Abstract View of the Components of a Computer System

2
OPERATING SYSTEM (KCA-203) Unit 1

FUNCTIONS OF AN OPERATING SYSTEM


An effective operating system should accomplish the following functions:
• Should act as a command interpreter by providing a user-friendly environment.
• Should facilitate communication with other users.
• Facilitate the directory/file creation along with the security option.
• Provide access to compilers to translate programs from high-level languages to
machine language
• Take care of storage and device allocation.
• Provide for long term storage of user information in the form of files.
• Permit system resources to be shared among users when appropriate and be protected
from unauthorized or mischievous intervention as necessary.

Layered Structure
The operating system is split into various layers. In the layered operating system
and each of the layers have different functionalities. This type of operating system
was created as an improvement over the early monolithic systems.

Why Layering in Operating System?

Layering provides a distinct advantage in an operating system. All the layers can
be defined separately and interact with each other as required. Also, it is easier to
create, maintain and update the system if it is done in the form of layers. Change in
one layer specification does not affect the rest of the layers.

Each of the layers in the operating system can only interact with the layers that are
above and below it. The lowest layer handles the hardware and the uppermost layer
deals with the user applications.

3
OPERATING SYSTEM (KCA-203) Unit 1

Layers in Layered Operating System

There are six layers in the layered operating system. A diagram demonstrating
these layers is as follows:

Details about the six layers are:

Hardware
This layer interacts with the system hardware and coordinates with all the
peripheral devices used such as printer, mouse, keyboard, scanner etc. The
hardware layer is the lowest layer in the layered operating system architecture.
CPU Scheduling
This layer deals with scheduling the processes for the CPU. There are many
scheduling queues that are used to handle processes. When the processes enter the
system, they are put into the job queue. The processes that are ready to execute in
the main memory are kept in the ready queue.

Memory Management

4
OPERATING SYSTEM (KCA-203) Unit 1

Memory management deals with memory and the moving of processes from disk
to primary memory for execution and back again. This is handled by the third layer
of the operating system.
Process Management
This layer is responsible for managing the processes i.e assigning the processor to
a process at a time. This is known as process scheduling. The different algorithms
used for process scheduling are FCFS (first come first served), SJF (shortest job
first), priority scheduling, round-robin scheduling etc.
I/O Buffer
I/O devices are very important in the computer systems. They provide users with
the means of interacting with the system. This layer handles the buffers for the I/O
devices and makes sure that they work correctly.
User Programs
This is the highest layer in the layered operating system. This layer deals with the
many user programs and applications that run in an operating system such as word
processors, games, browsers etc.

1.2TYPES OF AN OPERATING SYSTEM

1.2.1Simple Batch System:

The users who are using a batch operating system do not interact with the
computer directly. Each user prepares its job on an off-line device like punch cards
and submits it to the computer operator. An operator takes up similar jobs and
groups them together into a batch, and then these batches are executed one by one.

Advantages of Batch OS

• Execution time taken for similar jobs is higher.


• Multiple users can share batch systems.
• Managing large works becomes easy in batch systems.
• The idle time for a single batch is very less.

5
OPERATING SYSTEM (KCA-203) Unit 1

Disadvantages of OS
• There is a lack of interaction between the user and the job.
• CPU is being often idle, because the speed of the mechanical I/O devices is
slower than the CPU.
• It is difficult to provide the desired priority.
Examples of Batch OS: payroll system, bank statements, data entry, etc.

1.2.2 Time Sharing System:

Time-sharing is a logical extension of multiprogramming. The CPU performs


many tasks by switches that are so frequent that the user can interact with each
program while it is running. A time-shared operating system allows multiple
users to share computers simultaneously. With each action or order at a time the
shared system becomes smaller, so only a little CPU time is required for each
user. As the system rapidly switches from one user to another, each user is given
the impression that the entire computer system is dedicated to its use, although it
is being shared among multiple users.

Advantages
1. Each task gets an equal opportunity.
2. Fewer chances of duplication of software.
3. CPU idle time can be reduced.
Disadvantages
1. Reliability problem.
2. One must have to take of the security and integrity of user programs and data.

6
OPERATING SYSTEM (KCA-203) Unit 1

3. Data communication problem.

How does a time-sharing operating system work?

In a time-sharing operating system, the CPU time is divided into small time
intervals called time slices or quantum. Each user or process is allocated a time
slice during which it can execute its tasks. The operating system switches
between processes rapidly, giving the illusion of parallel execution.
The operating system uses scheduling algorithms, such as round-robin or
priority-based scheduling, to determine which process should be allocated the
CPU next. Context switching, which involves saving and restoring the execution
context of each process, is performed to switch between processes.

1.2.3 Real Time System:


Real-Time operating systems serve real-time systems. These operating systems
are useful where many events occur in a short time or certain deadlines, such as
real-time simulations.

Types of the real-time operating system are:

• Hard real-time OS
The hard real-time OS is the operating system for mainly the applications in
which the slightest delay is also unacceptable. The time constraints of such
applications are very strict. Such systems are built for life-saving equipment like
parachutes and airbags, which immediately need to be in action if an accident
happens.
• Soft real-time OS
The soft real-time OS is the operating system for applications where time
constraint is not very strict.
In a soft real-time system, an important task is prioritized over less important
tasks, and this priority remains active until the completion of the task.
Furthermore, a time limit is always set for a specific job, enabling short time
delays for future tasks, which is acceptable.
For Example, virtual reality, reservation systems, etc.

Advantages of Real-Time OS

7
OPERATING SYSTEM (KCA-203) Unit 1

• It provides more output from all the resources as there is maximum


utilization of systems.
• It provides the best management of memory allocation.
• These systems are always error-free.
• These operating systems focus more on running applications than those
in the queue.
• Shifting from one task to another takes very little time.

Disadvantages of Real-Time OS

•System resources are extremely expensive and are not so good.


• The algorithms used are very complex.
• Only limited tasks can run at a single time.
• In such systems, we cannot set thread priority as these systems cannot
switch tasks easily.
Examples of Real-Time OS: Medical imaging systems, robots, etc.

1.2.4 Multiprocessor Systems:


Multiprocessor system means more than one processor in close communication.
All the processor share common bus, clock, memory and peripheral devices.
• Multiprocessor system is also called parallel system or tightly coupled systems.
Multiprocessor operating systems are just regular operating systems. They handle
system calls, do memory management, provide a file system, and manage I/O
devices.
• Multiprocessor systems is also known as parallel systems or multicore systems.
•Features of Multiprocessor Systems :
1.The processor should support efficient context switching operation.
2. It supports large physical address space and larger virtual address space.
3. If one processor fails, then other processors should retrieve the interrupted
process state so that execution of the process can continue.
4.The inter-process communication mechanism should be provided and
implemented in hardware as it becomes efficient and easy.

8
OPERATING SYSTEM (KCA-203) Unit 1

Advantages of Multiprocessor Systems:


1. Throughput: Throughput increases because number of processor is increases.
2. Cost: Multiprocessor system is cheaper than the multiple single processor And
system.
3. Reliability: If one processor fails, it has no effect on whole system operation.
4. Response time: Response time is less because of increased number of
processors.
• Disadvantages of Multiprocessor Systems :
1. Multiprocessor systems are more complex in both hardware and software.
2. Additional CPU cycles are required to manage the cooperation, so per-CPU
efficiency goes down.

1.2.5 Multi-User Operating System:


In a multiuser operating system, multiple numbers of users can access different
resources of a computer at the same time. The access is provided using a network
that consists of various personal computers attached to a mainframe computer
system. A multi-user operating system allows the permission of multiple users for
accessing a single machine at a time. The various personal computers can send and
receive information to the mainframe computer system. Thus, the mainframe
computer acts as the server and other personal computers act as clients for that
server.
The multi-user operating system has the following features:
• Resource sharing: This maps to time slicing, multiple peripherals such as
printers can be shared different files or data.
• Time-sharing
• Background sharing
• Invisibility: Many functions of multi-user operating systems are invisible to
the user.

9
OPERATING SYSTEM (KCA-203) Unit 1

Types of Multi-user Operating Systems:


The multi-user operating systems is of the following types:
1. Distributed System
2. Time sliced system
3. Multiprocessor system
Distributed system: The distributed operating system also known as distributed
computing is a collection of multiple computers located on different computers.
Communicate and coordinate their actions by passing messages to one another
from any system. These all systems emulate a single coherent system to the end
user. The end user will communicate with them with the help of the network.
This system is divided in a way that multiple requests can be handled and in turn,
the individual request can be satisfied eventually.
Examples: Electronic banking, Mobile apps

Time-sliced system: It is the system where each user talk is allocated to a short
span of cpu time. A small time duration is allotted to every task. CPU time is
divided into small time slices, and one time is assigned to each other. The
decision to run the next piece of the job is decided by the schedule. This
schedule executes the run instructions that need to be executed. The user can
take turns and thus the operating system will handle the user’s request among the
users who are connected. This feature is not applicable in the single-user
operating system. They use the mainframe system concurrently.
Example: Mainframe, a partial exam of the time-sliced system.

Multi-processor system: It involves multiple processors at a time. Enhance


the overall performance. If one processor fails other continues
working. Example: Spreadsheets, Music player

10
OPERATING SYSTEM (KCA-203) Unit 1

Advantages:
• It helps in the sharing of data and information among different users.
• It also helps in the sharing of hardware resources such as printers.
• It avoids disruption if any one computer fails it does not affect any other
computer present on that network.
• Users can share their work with other users.
• The multi-user operating system is very helpful in economic improvement.
• Backing up data can be done in the multi-user operating system.
• The services of the multi-user operating systems are very stable and
systematic.
Disadvantages:
• It requires expensive hardware to set up a mainframe computer
• When multiple users log on or work on the same system it reduces the
overall performance of the system.
• Information is shared with the public so privacy becomes a concern here.

1.2.6 Multi process System:

Multitasking term used in a modern computer system. It is a logical extension of a


multiprogramming system that enables the execution of multiple programs
simultaneously. In an operating system, multitasking allows a user to perform more
than one computer task simultaneously. Multiple tasks are also known as processes
that share similar processing resources like a CPU. The operating system keeps
track of where you are in each of these jobs and allows you to transition between
them without losing data.

11
OPERATING SYSTEM (KCA-203) Unit 1

Early operating system could execute various programs at the same time, although
multitasking was not fully supported. As a result, a single software could consume
the entire CPU of the computer while completing a certain activity. Basic operating
system functions, such as file copying, prevented the user from completing other
tasks, such as opening and closing windows. Fortunately, because modern
operating systems have complete multitasking capability, numerous programs can
run concurrently without interfering with one other. In addition, many operating
system processes can run at the same time.

Types of Multitasking
There are mainly two types of multitasking. These are as follows:
1. Preemptive Multitasking
2. Cooperative Multitasking
Preemptive Multitasking
Preemptive multitasking is a special task assigned to a computer operating system.
It decides how much time one task spends before assigning another task to use the
operating system. Because the operating system controls the entire process, it is
referred to as 'preemptive'.
Cooperative Multitasking
The term 'Non-Preemptive Multitasking' refers to cooperative multitasking. The
main purpose of cooperative multitasking is to run the present task while releasing
the CPU to allow another process to run.
Windows and MacOS used cooperative multitasking. A Windows program will
respond to a message by performing some short unit of work before handing the
CPU over to the operating system until the program receives another message. It
worked perfectly as long as all programs were written with other programs in mind
and bug-free.
Advantage of Multitasking
• Manage Several Users
This operating system is more suited to supporting multiple users simultaneously,
and multiple apps can run smoothly without interfering with system performance.
• Virtual Memory
The greatest virtual memory system is found in multitasking operating systems.
Because of virtual memory, any program does not require a long wait time to
complete its tasks; if this problem arises, those programs are moved to virtual
memory.
• Good Reliability

12
OPERATING SYSTEM (KCA-203) Unit 1

Multitasking operating systems give more flexibility to several users, and they are
happier as a result. On which each user can execute single or multiple programs
simultaneously.
• Secured Memory
The multitasking operating systems have well-defined memory management. Due
to this operating system does not allow any types of permissions for undesirable
programs to waste memory.
• Time Shareable
All tasks are allotted a specified amount of time so that they do not have to wait for
the CPU.
• Background Processing
A multitasking operating system provides a better environment for background
processes to run. These background programs are not visible to most users, but
they help other programs like firewalls, antivirus software, and others run well.
• Optimize the computer resources
A multitasking operating system may manage various computer resources like I/O
devices, RAM, hard disk, CPU, and others.
• Use Several Programs
Users can run many programs simultaneously, like an internet browser, games, MS
Excel, PowerPoint, and other utilities.
Disadvantages
Various disadvantages of multitasking are as follows:
• Processor Boundation
The system may run programs slowly because of the poor speed of their
processors, and their reaction time might rise when processing many programs. To
solve this problem, more processing power is required.
• Memory Boundation
The computer's performance may get slow performance due to the multiple
programs run at the same time because the main memory gets overloaded while
loading multiple programs. Because the CPU is unable to provide different times
for each program, reaction time increases. The primary cause of this issue is that it
makes use of low-capacity RAM. As a result, the RAM capacity can be raised to
provide a solution.
• CPU Heat Up
The multiple processors are busier at the same time to complete any task in a
multitasking environment, so the CPU generates more heat.

13
OPERATING SYSTEM (KCA-203) Unit 1

1.2.7 Multi-threaded System:

Multithreading in OS allows a task to break into multiple threads. In simple terms,


a thread is a lightweight process consuming lesser resource sharing than the
process. It is defined as a flow of execution through the process code that has its
own program counter to keep track of which instruction thread to execute next.
The system registers to maintain its current working variables and a stack to keep
track of the execution history. A process is defined as a collection of threads
It's worth noting that each thread belongs to just one process, and there are no
threads outside of a classical process. Each thread reflects the flow of control in its
own way. Threads are a good basis for running programs in parallel on shared-
memory multiprocessors. The concept of thread is used for improving the
performance of the execution of applications through parallelism.

Through parallelism, thread forks provide a technique to boost application-level


performance. Threads are a software approach to increase operating system speed
by lowering overhead thread. A thread is equivalent to a traditional process.
Threads provide a suitable foundation for running applications in parallel
processing on shared-memory multiprocessors.

There are two sorts of process based on the number of threads:

1. Single thread process: Only one thread in an entire process


2. Multi-thread process: Multiple threads within an entire process.

14
OPERATING SYSTEM (KCA-203) Unit 1

Advantages of Multithreading

• Improves execution speed (by combining CPU machine and I/O wait
times).
• Multithreading can be used to achieve concurrency.
• Reduces the amount of time it takes for context switching.
• Improves responsiveness.
• Make synchronous processing possible (separates the execution of
independent threads).
• Increases throughput.
• Performs foreground and background work in parallel.
Disadvantages of Multithreading

• Because the threads share the same address space and may access resources
such as open files, difficulties might arise in managing threads if they
utilize incompatible data structures.
• If we don't optimize the number of threads, instead of gaining performance,
we may lose performance.
• If a parent process requires several threads to function properly, the child
processes should be multithreaded as well, as they may all be required.

15
OPERATING SYSTEM (KCA-203) Unit 1

Operating System Services


The programming environment where a programmer works on a given computer
system is provided by the operating system. The user software uses the operating
system to request various resources. Utility programmers and users can take
advantage of a number of services provided by the operating system. These
services are accessed by application programming interfaces (APIs) or system
calls. The application can use those interfaces to request a service from the OS,
pass parameters, and get the results of the action.

An operating system provides the following services:

Program Execution
Several tasks must be completed in order to run a programme. Both the data and
instructions must be loaded into the main memory. Furthermore, files and input-
output devices should be initialized, as well as other resources that have to be
prepared. These types of jobs are handled by the operating structures. The user no
longer has to be concerned about memory allocation, multitasking, or anything
else.

Control Input/Output Devices


Because there are many different types of I/O devices in a computer system, each
one has its own set of precise instructions for operation. By offering a unified
interface, the operating system hides such information. As a result, it is simple for
a programmer to access such devices.

Program Creation
The operating system provides structures and tools, like editors and debuggers, to
aid programmers in the creation, modification, and debugging of programs.

Error Detection and Response


An error in a device can cause the entire device to malfunction. Device failure,
division by zero, memory errors, attempts to access restricted memory regions, and
other hardware and software problems are examples. The OS monitors the system
for problems and takes appropriate action with minimal impact on running
programs to avoid errors.

16
OPERATING SYSTEM (KCA-203) Unit 1

Errors can happen frequently when working with computers. Errors can occur in
the following areas:

• Memory hardware: For example, the memory becomes full, memory error,
etc.
• User program: For example, attempting to access illegal locations of
memory, dividing by zero, using too much CPU time, and many more.
• Input/ Output devices: For example, a network having a connection failure,
the lack of paper in a printer, and many more.
The operating system would take appropriate action and create messages to
guarantee correct and consistent computation in the face of these and other types of
probable mistakes.

Accounting
To improve overall performance, an operating device collects utilisation records
for a variety of assets and tracks overall performance metrics and responsive time.
These personal records are useful for future upgrades and device adjustments to
improve overall performance.

Security and Protection


The operating device secures a person’s statistics and packages from unauthorised
users and prevents them from being tampered with. The security feature guards
against threats that are broadcast by people who are not in control of the running
device.

For example,

When a user downloads software from the internet, that programme could contain
malicious code that harms other programs. While downloading such programs, the
operating system guarantees that suitable checks are performed.

If a couple of users share a computer system, the various processes must be


safeguarded from another intrusion. For this, the operating system provides a
number of mechanisms that would allow only those processes to access resources
that have received valid operating system authorisation. The technique could
include assigning each user a unique user id and password.

File Management

17
OPERATING SYSTEM (KCA-203) Unit 1

Secondary storage devices, such as magnetic tapes, magnetic disks and optical
disks, are used by computers to store data and information. Speed, data transfer
rate, capacity, and data access techniques are all characteristics of storage media.

The OS must be aware of the many types of files as well as the properties of
various storage devices in order to manage them. It must also provide the
proportion and security method for papers.

Communication
The operating system is in charge of coordinating the transfer of data and programs
across computers connected by a network. Message passing and shared memory
are used to accomplish this communication.

What is Kernel?

In computer science, Kernel is a computer program that is a core or heart of an


operating system. Before discussing kernel in detail, let's first understand its basic,
i.e., Operating system in a computer.

Kernel is central component of an operating system that manages operations of


computer and hardware. It basically manages operations of memory and CPU
time. It is core component of an operating system. Kernel acts as a bridge
between applications and data processing performed at hardware level using
inter-process communication and system calls.
Kernel loads first into memory when an operating system is loaded and remains
into memory until operating system is shut down again. It is responsible for
various tasks such as disk management, task management, and memory
management.
Kernel has a process table that keeps track of all active processes
• Process table contains a per process region table whose entry points to entries in
region table.
Kernel loads an executable file into memory during ‘exec’ system call’.

18
OPERATING SYSTEM (KCA-203) Unit 1

It decides which process should be allocated to processor to execute and which


process should be kept in main memory to execute. It basically acts as an
interface between user applications and hardware. The major aim of kernel is to
manage communication between software i.e. user-level applications and
hardware i.e., CPU and disk memory.
Objectives of Kernel :

• To establish communication between user level application and


hardware.
• To decide state of incoming processes.
• To control disk management.
• To control memory management.
• To control task management.

Types of Kernel

1. Monolithic Kernels

In a monolithic kernel, the same memory space is used to implement user


services and kernel services.

It means, in this type of kernel, there is no different memory used for user services
and kernel services.

As it uses the same memory space, the size of the kernel increases, increasing the
overall size of the OS.

19
OPERATING SYSTEM (KCA-203) Unit 1

The execution of processes is also faster than other kernel types as it does not use
separate user and kernel space.

Examples of Monolithic Kernels are Unix, Linux, Open VMS, XTS-400, etc.

Advantages:

o The execution of processes is also faster as there is no separate user space


and kernel space and less software involved.
o As it is a single piece of software hence, it's both sources and compiled
forms are smaller.

Disadvantages:

o If any service generates any error, it may crash down the whole system.
o These kernels are not portable, which means for each new architecture, they
must be rewritten.
o Large in size and hence become difficult to manage.
o To add a new service, the complete operating system needs to be modified.

2. Microkernel

A microkernel is also referred to as μK, and it is different from a traditional kernel


or Monolithic Kernel. In this, user services and kernel services are implemented
into two different address spaces: user space and kernel space. Since it uses
different spaces for both the services, so, the size of the microkernel is decreased,
and which also reduces the size of the OS.

20
OPERATING SYSTEM (KCA-203) Unit 1

Microkernels are easier to manage and maintain as compared to monolithic


kernels. Still, if there will be a greater number of system calls and context
switching, then it might reduce the performance of the system by making it slow.

These kernels use a message passing system for handling the request from one
server to another server.

Only some essential services are provided by microkernels, such as defining


memory address spaces, IPC(Interprocess Communication), and process
management. Other services such as networking are not provided by Kernel and
handled by a user-space program known as servers.

One of the main disadvantages of monolithic kernels that an error in the


kernel can crash the whole system, can be removed in the microkernel. As in a
microkernel, if a kernel process crashes, the crashing of the whole system can still
be prevented by restarting the error-caused services.

Examples of Microkernel are L4, AmigaOS, Minix, K42, etc.

Advantages

o Microkernels can be managed easily.


o A new service can be easily added without modifying the whole OS.
o In a microkernel, if a kernel process crashes, it is still possible to prevent the
whole system from crashing.

Disadvantages

o There is more requirement of software for interfacing, which reduces the


system performance.
o Process management is very complicated.
o The messaging bugs are difficult to fix.

Reentrant Kernel

Reentrant Kernel: In kernel mode, a reentrant kernel allows processes (or, more
precisely, their corresponding kernel threads) to give up the CPU. They have no

21
OPERATING SYSTEM (KCA-203) Unit 1

effect on other processes entering kernel mode. Multiple processor systems may
be scheduled together in the case of single-processor systems.
Example:
A disc read is an example of this. When a user program requests a disc read, the
scheduler will delegate the CPU to another process (kernel thread) until the disc
controller issues an interrupt indicating that the data is accessible and our thread
can be resumed. This process can still access I/O, such as user input, which
requires kernel functions. The system remains responsive, and the amount of
CPU time wasted as a result of IO delays is reduced. The original function
(whatever requested data) would be blocked in a non-reentrant kernel until the
disc read was completed.
If a computer program or routine can be safely called again before its previous
invocation has been completed, it is said to be reentrant (i.e it can be safely
executed concurrently). A computer program or routine that is reentrant:
• There cannot be any non-constant data that is static (or global).
• The address must not be returned to static (or global) non-constant data.
• It must only work with the data provided by the caller.
• Locks should not be used to protect singleton resources, a variable that
is only referenced once
• It must not change its own code (unless executing in its own unique
thread storage).
• Non-reentrant computer programs or routines must not be called.
Non-reentrant functions can still be executed by reentrant kernels if locks are
used to ensure that only one process can run the non-reentrant function. Even
though the current process is operating in kernel mode, hardware interrupts can
suspend it (allowing things like Ctrl+c to cease execution).

Kernel Control Path: A set of instructions that the kernel executes in order to
handle a system call. Normally, instructions are executed in order, but some
activities force the CPU to interleave control routes. In user mode, the following
system call is made: The scheduler chooses a new process to run and switches it
on. On behalf of two separate processes, two control pathways are executed.

22

You might also like