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

An Operating System

An operating system (OS) acts as an interface between the user and computer hardware, managing tasks like memory, processes, input/output, and devices. Popular OSs include Linux, Windows, VMS, OS/400, AIX, and z/OS. The OS controls execution of programs, allocates memory and processor time, manages devices and files, provides security, and coordinates other software and users.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views

An Operating System

An operating system (OS) acts as an interface between the user and computer hardware, managing tasks like memory, processes, input/output, and devices. Popular OSs include Linux, Windows, VMS, OS/400, AIX, and z/OS. The OS controls execution of programs, allocates memory and processor time, manages devices and files, provides security, and coordinates other software and users.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

An Operating System (OS) is an interface between a computer user and computer hardware.

An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices
such as disk drives and printers.

Some popular Operating Systems include Linux Operating System, Windows Operating System,
VMS, OS/400, AIX, z/OS, etc.

Definition
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.

Following are some of important functions of an operating System.

 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users

1
Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.

Main memory provides a fast storage that can be accessed directly by the CPU. For a program to
be executed, it must in the main memory. An Operating System does the following activities for
memory management −

 Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are
not in use.
 In multiprogramming, the OS decides which process will get memory when and how
much.
 Allocates the memory when a process requests it to do so.
 De-allocates the memory when a process no longer needs it or has been terminated.

Processor Management
In multiprogramming environment, the OS decides which process gets the processor when and
for how much time. This function is called process scheduling. An Operating System does the
following activities for processor management −

 Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
 Allocates the processor (CPU) to a process.
 De-allocates processor when a process is no longer required.

Device Management
An Operating System manages device communication via their respective drivers. It does the
following activities for device management −

 Keeps tracks of all devices. Program responsible for this task is known as the I/O
controller.
 Decides which process gets the device when and for how much time.
 Allocates the device in the efficient way.
 De-allocates devices.

File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.

An Operating System does the following activities for file management −


2
 Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
 Decides who gets the resources.
 Allocates the resources.
 De-allocates the resources.

Other Important Activities


Following are some of the important activities that an Operating System performs −

 Security − By means of password and similar other techniques, it prevents unauthorized


access to programs and data.
 Control over system performance − Recording delays between request for a service and
response from the system.
 Job accounting − Keeping track of time and resources used by various jobs and users.
 Error detecting aids − Production of dumps, traces, error messages, and other
debugging and error detecting aids.
 Coordination between other softwares and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.

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.

3
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.

4
 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,

An Operating System provides services to both the users and to the programs.

 It provides programs an environment to execute.


 It provides users the services to execute the programs in a convenient manner.

Following are a few common services provided by an operating system −

 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection

Program execution
Operating systems handle many kinds of activities from user programs to system programs like
printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a
process.

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.
5
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.

I/O Operation
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 represents a collection of related information. Computers can store files on the disk
(secondary storage), for long-term storage purpose. Examples of storage media include magnetic
tape, magnetic disk and optical disk drives like CD, DVD. Each of these media has its own
properties like speed, capacity, data transfer rate and data access methods.

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.
 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
In case of distributed systems which are a collection of processors that do not share memory,
peripheral devices, or a clock, the operating system manages communications between all the
processes. Multiple processes communicate with one another through communication lines in the
network.

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.

6
 Communication may be implemented by two methods, either by Shared Memory or by
Message Passing.

Error handling
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 Management
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.

Protection
Considering a computer system having multiple users and concurrent execution of multiple
processes, the various processes must be protected from each other's activities.

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.

What is Thread?
A thread is a flow of execution through the process code, with its own program counter that
keeps track of which instruction to execute next, system registers which hold its current working
variables, and a stack which contains the execution history.

A thread shares with its peer threads few information like code segment, data segment and open
files. When one thread alters a code segment memory item, all other threads see that.

7
A thread is also called a lightweight process. Threads provide a way to improve application
performance through parallelism. Threads represent a software approach to improving
performance of operating system by reducing the overhead thread is equivalent to a classical
process.

Each thread belongs to exactly one process and no thread can exist outside a process. Each
thread represents a separate flow of control. Threads have been successfully used in
implementing network servers and web server. They also provide a suitable foundation for
parallel execution of applications on shared memory multiprocessors. The following figure
shows the working of a single-threaded and a multithreaded process.

Difference between Process and Thread


S.N. Process Thread

Thread is light weight, taking lesser resources than a


1 Process is heavy weight or resource intensive.
process.

Process switching needs interaction with Thread switching does not need to interact with
2
operating system. operating system.

3 In multiple processing environments, each All threads can share same set of open files, child

8
process executes the same code but has its
processes.
own memory and file resources.

If one process is blocked, then no other


While one thread is blocked and waiting, a second
4 process can execute until the first process is
thread in the same task can run.
unblocked.

Multiple processes without using threads use


5 Multiple threaded processes use fewer resources.
more resources.

In multiple processes each process operates One thread can read, write or change another
6
independently of the others. thread's data.

Advantages of Thread
 Threads minimize the context switching time.
 Use of threads provides concurrency within a process.
 Efficient communication.
 It is more economical to create and context switch threads.
 Threads allow utilization of multiprocessor architectures to a greater scale and efficiency.

Types of Thread
Threads are implemented in following two ways −

 User Level Threads − User managed threads.

 Kernel Level Threads − Operating System managed threads acting on kernel, an


operating system core.

User Level Threads


In this case, the thread management kernel is not aware of the existence of threads. The thread
library contains code for creating and destroying threads, for passing message and data between
threads, for scheduling thread execution and for saving and restoring thread contexts. The
application starts with a single thread.

9
Advantages

 Thread switching does not require Kernel mode privileges.


 User level thread can run on any operating system.
 Scheduling can be application specific in the user level thread.
 User level threads are fast to create and manage.

Disadvantages

 In a typical operating system, most system calls are blocking.


 Multithreaded application cannot take advantage of multiprocessing.

Kernel Level Threads


In this case, thread management is done by the Kernel. There is no thread management code in
the application area. Kernel threads are supported directly by the operating system. Any
application can be programmed to be multithreaded. All of the threads within an application are
supported within a single process.

The Kernel maintains context information for the process as a whole and for individuals threads
within the process. Scheduling by the Kernel is done on a thread basis. The Kernel performs

10
thread creation, scheduling and management in Kernel space. Kernel threads are generally
slower to create and manage than the user threads.

Advantages

 Kernel can simultaneously schedule multiple threads from the same process on multiple
processes.
 If one thread in a process is blocked, the Kernel can schedule another thread of the same
process.
 Kernel routines themselves can be multithreaded.

Disadvantages

 Kernel threads are generally slower to create and manage than the user threads.
 Transfer of control from one thread to another within the same process requires a mode switch
to the Kernel.

Multithreading Models
Some operating system provide a combined user level thread and Kernel level thread facility.
Solaris is a good example of this combined approach. In a combined system, multiple threads
within the same application can run in parallel on multiple processors and a blocking system call
need not block the entire process. Multithreading models are three types

 Many to many relationship.


 Many to one relationship.
 One to one relationship.

Many to Many Model


The many-to-many model multiplexes any number of user threads onto an equal or smaller
number of kernel threads.

The following diagram shows the many-to-many threading model where 6 user level threads are
multiplexing with 6 kernel level threads. In this model, developers can create as many user
threads as necessary and the corresponding Kernel threads can run in parallel on a multiprocessor
machine. This model provides the best accuracy on concurrency and when a thread performs a
blocking system call, the kernel can schedule another thread for execution.

11
Many to One Model
Many-to-one model maps many user level threads to one Kernel-level thread. Thread
management is done in user space by the thread library. When thread makes a blocking system
call, the entire process will be blocked. Only one thread can access the Kernel at a time, so
multiple threads are unable to run in parallel on multiprocessors.

If the user-level thread libraries are implemented in the operating system in such a way that the
system does not support them, then the Kernel threads use the many-to-one relationship modes.

12
One to One Model
There is one-to-one relationship of user-level thread to the kernel-level thread. This model
provides more concurrency than the many-to-one model. It also allows another thread to run
when a thread makes a blocking system call. It supports multiple threads to execute in parallel on
microprocessors.

Disadvantage of this model is that creating user thread requires the corresponding Kernel thread.
OS/2, windows NT and windows 2000 use one to one relationship model.

13
Difference between User-Level & Kernel-Level Thread
S.N. User-Level Threads Kernel-Level Thread

User-level threads are faster to create and Kernel-level threads are slower to create and
1
manage. manage.

Implementation is by a thread library at the user Operating system supports creation of Kernel
2
level. threads.

User-level thread is generic and can run on any Kernel-level thread is specific to the operating
3
operating system. system.

Multi-threaded applications cannot take Kernel routines themselves can be


4
advantage of multiprocessing. multithreaded.

Linux is one of popular version of UNIX operating System. It is open source as its source code is
freely available. It is free to use. Linux was designed considering UNIX compatibility. Its
functionality list is quite similar to that of UNIX.

14
Components of Linux System
Linux Operating System has primarily three components

 Kernel − Kernel is the core part of Linux. It is responsible for all major activities of this
operating system. It consists of various modules and it interacts directly with the
underlying hardware. Kernel provides the required abstraction to hide low level hardware
details to system or application programs.
 System Library − System libraries are special functions or programs using which
application programs or system utilities accesses Kernel's features. These libraries
implement most of the functionalities of the operating system and do not requires kernel
module's code access rights.
 System Utility − System Utility programs are responsible to do specialized, individual
level tasks.

Kernel Mode vs User Mode


Kernel component code executes in a special privileged mode called kernel mode with full
access to all resources of the computer. This code represents a single process, executes in single
address space and do not require any context switch and hence is very efficient and fast. Kernel
runs each processes and provides system services to processes, provides protected access to
hardware to processes.

Support code which is not required to run in kernel mode is in System Library. User programs
and other system programs works in User Mode which has no access to system hardware and
kernel code. User programs/ utilities use System libraries to access Kernel functions to get
system's low level tasks.

15
Basic Features
Following are some of the important features of Linux Operating System.

 Portable − Portability means software can works on different types of hardware in same
way. Linux kernel and application programs supports their installation on any kind of
hardware platform.
 Open Source − Linux source code is freely available and it is community based
development project. Multiple teams work in collaboration to enhance the capability of
Linux operating system and it is continuously evolving.
 Multi-User − Linux is a multiuser system means multiple users can access system
resources like memory/ ram/ application programs at same time.
 Multiprogramming − Linux is a multiprogramming system means multiple applications
can run at same time.
 Hierarchical File System − Linux provides a standard file structure in which system
files/ user files are arranged.
 Shell − Linux provides a special interpreter program which can be used to execute
commands of the operating system. It can be used to do various types of operations, call
application programs. etc.
 Security − Linux provides user security using authentication features like password
protection/ controlled access to specific files/ encryption of data.

Architecture
The following illustration shows the architecture of a Linux system −

16
The architecture of a Linux System consists of the following layers −

 Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).
 Kernel − It is the core component of Operating System, interacts directly with hardware,
provides low level services to upper layer components.
 Shell − An interface to kernel, hiding complexity of kernel's functions from users. The
shell takes commands from the user and executes kernel's functions.
 Utilities − Utility programs that provide the user most of the functionalities of an
operating systems.

One of the important jobs of an Operating System is to manage various I/O devices including
mouse, keyboards, touch pad, disk drives, display adapters, USB devices, Bit-mapped screen,
LED, Analog-to-digital converter, On/off switch, network connections, audio I/O, printers etc.

An I/O system is required to take an application I/O request and send it to the physical device,
then take whatever response comes back from the device and send it to the application. I/O
devices can be divided into two categories −

 Block devices − A block device is one with which the driver communicates by sending
entire blocks of data. For example, Hard disks, USB cameras, Disk-On-Key etc.

 Character devices − A character device is one with which the driver communicates by
sending and receiving single characters (bytes, octets). For example, serial ports, parallel
ports, sounds cards etc
17
Device Controllers
Device drivers are software modules that can be plugged into an OS to handle a particular
device. Operating System takes help from device drivers to handle all I/O devices.

The Device Controller works like an interface between a device and a device driver. I/O units
(Keyboard, mouse, printer, etc.) typically consist of a mechanical component and an electronic
component where electronic component is called the device controller.

There is always a device controller and a device driver for each device to communicate with the
Operating Systems. A device controller may be able to handle multiple devices. As an interface
its main task is to convert serial bit stream to block of bytes, perform error correction as
necessary.

Any device connected to the computer is connected by a plug and socket, and the socket is
connected to a device controller. Following is a model for connecting the CPU, memory,
controllers, and I/O devices where CPU and device controllers all use a common bus for
communication.

Synchronous vs asynchronous I/O


 Synchronous I/O − In this scheme CPU execution waits while I/O proceeds

 Asynchronous I/O − I/O proceeds concurrently with CPU execution

Communication to I/O Devices


The CPU must have a way to pass information to and from an I/O device. There are three
approaches available to communicate with the CPU and Device.

 Special Instruction I/O

18
 Memory-mapped I/O
 Direct memory access (DMA)

Special Instruction I/O

This uses CPU instructions that are specifically made for controlling I/O devices. These
instructions typically allow data to be sent to an I/O device or read from an I/O device.

Memory-mapped I/O

When using memory-mapped I/O, the same address space is shared by memory and I/O devices.
The device is connected directly to certain main memory locations so that I/O device can transfer
block of data to/from memory without going through CPU.

While using memory mapped IO, OS allocates buffer in memory and informs I/O device to use
that buffer to send data to the CPU. I/O device operates asynchronously with CPU, interrupts
CPU when finished.

The advantage to this method is that every instruction which can access memory can be used to
manipulate an I/O device. Memory mapped IO is used for most high-speed I/O devices like
disks, communication interfaces.

Direct Memory Access (DMA)


Slow devices like keyboards will generate an interrupt to the main CPU after each byte is
transferred. If a fast device such as a disk generated an interrupt for each byte, the operating
system would spend most of its time handling these interrupts. So a typical computer uses direct
memory access (DMA) hardware to reduce this overhead.

19
Direct Memory Access (DMA) means CPU grants I/O module authority to read from or write to
memory without involvement. DMA module itself controls exchange of data between main
memory and the I/O device. CPU is only involved at the beginning and end of the transfer and
interrupted only after entire block has been transferred.

Direct Memory Access needs a special hardware called DMA controller (DMAC) that manages
the data transfers and arbitrates access to the system bus. The controllers are programmed with
source and destination pointers (where to read/write the data), counters to track the number of
transferred bytes, and settings, which includes I/O and memory types, interrupts and states for
the CPU cycles.

The operating system uses the DMA hardware as follows −

Step Description

1 Device driver is instructed to transfer disk data to a buffer address X.

2 Device driver then instruct disk controller to transfer data to buffer.

3 Disk controller starts DMA transfer.

20
4 Disk controller sends each byte to DMA controller.

DMA controller transfers bytes to buffer, increases the memory address, decreases the counter C
5
until C becomes zero.

6 When C becomes zero, DMA interrupts CPU to signal transfer completion.

Polling vs Interrupts I/O


A computer must have a way of detecting the arrival of any type of input. There are two ways
that this can happen, known as polling and interrupts. Both of these techniques allow the
processor to deal with events that can happen at any time and that are not related to the process it
is currently running.

Polling I/O

Polling is the simplest way for an I/O device to communicate with the processor. The process of
periodically checking status of the device to see if it is time for the next I/O operation, is called
polling. The I/O device simply puts the information in a Status register, and the processor must
come and get the information.

Most of the time, devices will not require attention and when one does it will have to wait until it
is next interrogated by the polling program. This is an inefficient method and much of the
processors time is wasted on unnecessary polls.

Compare this method to a teacher continually asking every student in a class, one after another, if
they need help. Obviously the more efficient method would be for a student to inform the teacher
whenever they require assistance.

Interrupts I/O

An alternative scheme for dealing with I/O is the interrupt-driven method. An interrupt is a
signal to the microprocessor from a device that requires attention.

A device controller puts an interrupt signal on the bus when it needs CPU’s attention when CPU
receives an interrupt, It saves its current state and invokes the appropriate interrupt handler using
the interrupt vector (addresses of OS routines to handle various events). When the interrupting
device has been dealt with, the CPU continues with its original task as if it had never been
interrupted.

I/O software is often organized in the following layers −

 User Level Libraries − This provides simple interface to the user program to perform
input and output. For example, stdio is a library provided by C and C++ programming
languages.

21
 Kernel Level Modules − This provides device driver to interact with the device
controller and device independent I/O modules used by the device drivers.
 Hardware − This layer includes actual hardware and hardware controller which interact
with the device drivers and makes hardware alive.

A key concept in the design of I/O software is that it should be device independent where it
should be possible to write programs that can access any I/O device without having to specify the
device in advance. For example, a program that reads a file as input should be able to read a file
on a floppy disk, on a hard disk, or on a CD-ROM, without having to modify the program for
each different device.

Device Drivers
Device drivers are software modules that can be plugged into an OS to handle a particular
device. Operating System takes help from device drivers to handle all I/O devices. Device
drivers encapsulate device-dependent code and implement a standard interface in such a way that
code contains device-specific register reads/writes. Device driver, is generally written by the
device's manufacturer and delivered along with the device on a CD-ROM.

22
A device driver performs the following jobs −

 To accept request from the device independent software above to it.


 Interact with the device controller to take and give I/O and perform required error
handling
 Making sure that the request is executed successfully

How a device driver handles a request is as follows: Suppose a request comes to read a block N.
If the driver is idle at the time a request arrives, it starts carrying out the request immediately.
Otherwise, if the driver is already busy with some other request, it places the new request in the
queue of pending requests.

Interrupt handlers
An interrupt handler, also known as an interrupt service routine or ISR, is a piece of software or
more specifically a callback function in an operating system or more specifically in a device
driver, whose execution is triggered by the reception of an interrupt.

When the interrupt happens, the interrupt procedure does whatever it has to in order to handle the
interrupt, updates data structures and wakes up process that was waiting for an interrupt to
happen.

The interrupt mechanism accepts an address ─ a number that selects a specific interrupt handling
routine/function from a small set. In most architectures, this address is an offset stored in a table
called the interrupt vector table. This vector contains the memory addresses of specialized
interrupt handlers.

Device-Independent I/O Software


The basic function of the device-independent software is to perform the I/O functions that are
common to all devices and to provide a uniform interface to the user-level software. Though it is
difficult to write completely device independent software but we can write some modules which
are common among all the devices. Following is a list of functions of device-independent I/O
Software −

 Uniform interfacing for device drivers


 Device naming - Mnemonic names mapped to Major and Minor device numbers
 Device protection
 Providing a device-independent block size
 Buffering because data coming off a device cannot be stored in final destination.
 Storage allocation on block devices
 Allocation and releasing dedicated devices
 Error Reporting

23
User-Space I/O Software
These are the libraries which provide richer and simplified interface to access the functionality of
the kernel or ultimately interactive with the device drivers. Most of the user-level I/O software
consists of library procedures with some exception like spooling system which is a way of
dealing with dedicated I/O devices in a multiprogramming system.

I/O Libraries (e.g., stdio) are in user-space to provide an interface to the OS resident device-
independent I/O SW. For example putchar(), getchar(), printf() and scanf() are example of user
level I/O library stdio available in C programming.

Kernel I/O Subsystem


Kernel I/O Subsystem is responsible to provide many services related to I/O. Following are some
of the services provided.

 Scheduling − Kernel schedules a set of I/O requests to determine a good order in which
to execute them. When an application issues a blocking I/O system call, the request is
placed on the queue for that device. The Kernel I/O scheduler rearranges the order of the
queue to improve the overall system efficiency and the average response time
experienced by the applications.
 Buffering − Kernel I/O Subsystem maintains a memory area known as buffer that stores
data while they are transferred between two devices or between a device with an
application operation. Buffering is done to cope with a speed mismatch between the
producer and consumer of a data stream or to adapt between devices that have different
data transfer sizes.
 Caching − Kernel maintains cache memory which is region of fast memory that holds
copies of data. Access to the cached copy is more efficient than access to the original.
 Spooling and Device Reservation − A spool is a buffer that holds output for a device,
such as a printer, that cannot accept interleaved data streams. The spooling system copies
the queued spool files to the printer one at a time. In some operating systems, spooling is
managed by a system daemon process. In other operating systems, it is handled by an in
kernel thread.
 Error Handling − An operating system that uses protected memory can guard against
many kinds of hardware and application errors.

A kernel is a central component of an operating system. It acts as an interface between the


user applications and the hardware. The sole aim of the kernel is to manage the
communication between the software (user level applications) and the hardware (CPU, disk
memory etc). The main tasks of the kernel are :

Process management

Types Of Kernels

24
Kernels may be classified mainly in two categories

1. Monolithic

2. Micro Kernel

1. Monolithic

In a modern day approach to monolithic architecture, the kernel consists of different modules
which can be dynamically loaded and un-loaded. This modularapproach allows easy extension of
OS's capabilities. With this approach, maintainability of kernel became very easy as only the
concerned module needs to be loaded and unloaded every time there is a change or bug fix in a
particular module. So, there is no need to bring down and recompile the whole kernel for a
smallest bit of change. Also, stripping of kernel for various platforms (say for embedded devices
etc) became very easy as we can easily unload the module that we do not want.

Linux follows the monolithic modular approach

2. Micro Kernel

This architecture majorly caters to the problem of ever growing size of kernel code which we
could not control in the monolithic approach. This architecture allows some basic services like
device driver management, protocol stack, file system etc to run in user space. This reduces the
kernel code size and also increases the security and stability of OS as we have the bare minimum
code running in kernel. So, if suppose a basic service like network service crashes due to buffer
overflow, then only the networking service's memory would be corrupted, leaving the rest of the
system still functional.

I think this is enough for introduction.Let's not dive into the details of kernel as it is immensely
complicated

Develop PHP and Web projects with PhpStorm.

Great code assistance, smart debugger, safe refactorings, all major PHP frameworks support. Try for
free!

Download at jetbrains.com

 What is a kernel? Is it hardware or software?

25
 What is Kernel in Unix operating system?
 What is the main function of the kernel in operating systems?
 What is the difference between a kernel and an operating system?
 Which kernel (operating system) is used in Android?

Majority of mobile phone user use android phone but did you about the all setting features and
option of your phone? May be yes or may be no. No, I am not going to tell you about the all
setting options of our android phone but I will tell you about the most important option of our
phone, called Kernel.

What is Kernel?

Simply, the Kernel is a software which works in between our hardware and our applications or
software. suppose you installed a file sharing application, now it will seek access of your WIFI
or Hotspot but the application can’t access your computer directly. Here the Kernel is used.

Why it is used?

As I told before Kernel is used to give access of any hardware to our third party installed
applications or software. If it is not used then we can’t use some third party application like File
sharing, Camera, third party photo application etc.

The kernel is the central module of an operating system (OS). It is the part of the operating
system that loads first, and remains in the main memory. Because it stays in memory, it is
important for the kernel to be as small as possible while still providing all the essential services
required by other parts of the operating system and applications. The kernel code is usually
loaded into a protected area of memory to prevent it from being overwritten by programs or other
parts of the operating system.

Typically, the kernel is responsible for memory management, process and task management, and
disk management. The kernel connects the system hardware to the application software. Every
operating system has a kernel. For example the Linux kernel is used in numerous operating
systems including Linux, FreeBSD, Android and others.

 How is kernel used in embedded systems?


 What process in operating system?
 What is difference between software and kernel operating system?
 What is an operating system, what are types of operating systems?
 What is buddy system in operating system?
 What is distributed operating system?
 How the bios knows which operating systems kernel it should load in case of multiple operating
systems on a computer?
 What is Cloud operating system?
 What is Fushcia Operating system?
 What is BSD operating system?
 What are the mobile operating systems?
 What are the features of operating system?

26
 Is Linux an operating system or a kernel?

27

You might also like