0% found this document useful (0 votes)
9 views17 pages

Os KCS401 Unit 1

An Operating System (OS) serves as an interface between users and computer hardware, managing resources like memory, processes, and devices. It has key objectives of convenience, efficiency, and the ability to evolve, while performing functions such as booting, memory management, and file management. Various types of operating systems include batch, time-sharing, distributed, network, real-time, and multiprocessor systems, each with distinct advantages and disadvantages.

Uploaded by

kimjohn2331
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)
9 views17 pages

Os KCS401 Unit 1

An Operating System (OS) serves as an interface between users and computer hardware, managing resources like memory, processes, and devices. It has key objectives of convenience, efficiency, and the ability to evolve, while performing functions such as booting, memory management, and file management. Various types of operating systems include batch, time-sharing, distributed, network, real-time, and multiprocessor systems, each with distinct advantages and disadvantages.

Uploaded by

kimjohn2331
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/ 17

OPERATING SYSTEMS (KCS401)

UNIT – 1 (INTRODUCTION)

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.

Examples of Operating System: Windows, Android, iOS, Mac OS, Linux, Window Phone OS, Chrome OS etc.

Definition

• An operating system is a program that controls the execution of application programs and acts as an
interface between the user of a computer and the computer hardware.
• A more common definition is that the operating system is the one program running at all times on the
computer (usually called the kernel), with all else being application programs.
• An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The operating system correspondingly includes programs to manage
these resources, such as a traffic controller, a scheduler, memory management module, I/O programs, and
a file system.
Objectives of Operating system(Goals) – The Operating system has three main Objectives:
1. Convenience: An OS makes a computer more convenient to use.
2. Efficiency: An OS allows the computer system resources to be used in an efficient manner.
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.

Functions of Operating system:


Following are some of important functions of an operating System.
1. Booting:
Booting is a process of starting the computer operating system starts the computer to work. It checks the
computer and makes it ready to work.

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

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

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

5. File Management:
A file system is normally organized into directories for easy navigation and usage. An Operating System does
the following activities for file management −
➢ 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.
6. Providing interface:
It is used in order that user interface acts with a computer mutually. User interface controls how you input
data and instruction and how information is displayed on screen. The operating system offers two types of the
interface to the user:
1. Graphical-line interface: It interacts with of visual environment to communicate with the computer. It
uses windows, icons, menus and other graphical objects to issues commands.
2. Command-line interface: it provides an interface to communicate with the Computer by typing
commands.
7. Security − By means of password and similar other techniques, it prevents unauthorized access to programs
and data.
8. Control over system performance − Recording delays between request for a service and response from
the system.
9. Job accounting − Keeping track of time and resources used by various jobs and users.
10. Error detecting aids − Production of dumps, traces, error messages, and other debugging and error
detecting aids.
11. Coordination between other software and users − Coordination and assignment of compilers,
interpreters, assemblers and other software to the various users of the computer systems.

Classification of Operating systems:

Some widely used operating systems are as follows-


.
1. Batch Operating System :
This type of operating system does not interact with the computer directly. There is an operator which takes
similar jobs having the same requirement and groups them into batches. It is the responsibility of the operator
to sort jobs with similar needs.

Advantages of Batch Operating System:


• It is very difficult to guess or know the time required for any job to complete. Processors of the batch systems
know how long the job would be when it is in queue.
• Multiple users can share the batch systems.
• The idle time for the batch system is very less.
• It is easy to manage large work repeatedly in batch systems.

Disadvantages of Batch Operating System:


• The computer operators should be well known with batch systems
• Batch systems are hard to debug
• It is sometimes costly
• The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System: Payroll System, Bank Statements, etc.

2. Time-Sharing Operating Systems :


Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time of CPU as
they use a single system. These systems are also known as Multitasking Systems. The task can be from a single
user or different users also. The time that each task gets to execute is called quantum. After this time interval is
over OS switches over to the next task.

Advantages of Time-Sharing OS:


• Each task gets an equal opportunity
• Fewer chances of duplication of software
• CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
• Reliability problem
• One must have to take care of the security and integrity of user programs and data
• Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix, etc.

3. Distributed/ loosely coupled Operating System –


These types of the operating system is a recent advancement in the world of computer technology and are being
widely accepted all over the world and, that too, with a great pace. Various autonomous interconnected computers
communicate with each other using a shared communication network. Independent systems possess their own
memory unit and CPU. These are referred to as loosely coupled systems or distributed systems. These system’s
processors differ in size and function. The major benefit of working with these types of the operating system is
that it is always possible that one user can access the files or software which are not actually present on his system
but some other system connected within this network i.e., remote access is enabled within the devices connected
in that network.
Advantages of Distributed Operating System:
• Failure of one will not affect the other network communication, as all systems are independent from each
other
• Electronic mail increases the data exchange speed
• Since resources are being shared, computation is highly fast and durable
• Load on host computer reduces
• These systems are easily scalable as many systems can be easily added to the network
• Delay in data processing reduces
Disadvantages of Distributed Operating System:
• Failure of the main network will stop the entire communication
• To establish distributed systems the language which is used are not well defined yet
• These types of systems are not readily available as they are very expensive. Not only that the underlying
software is highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS, etc.

4. Network Operating System –


These systems run on a server and provide the capability to manage data, users, groups, security, applications, and
other networking functions. These types of operating systems allow shared access of files, printers, security,
applications, and other networking functions over a small private network. One more important aspect of Network
Operating Systems is that all the users are well aware of the underlying configuration, of all other users within the
network, their individual connections, etc. and that’s why these computers are popularly known as tightly
coupled systems.
Advantages of Network Operating System:
• Highly stable centralized servers
• Security concerns are handled through servers
• New technologies and hardware up-gradation are easily integrated into the system
• Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
• Servers are costly
• User has to depend on a central location for most operations
• Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft Windows Server
2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc.

5. Real-Time Operating System –


These types of OSs serve real-time systems. The time interval required to process and respond to inputs is very
small. This time interval is called response time.
Real-time systems are used when there are time requirements that are very strict like missile systems, air traffic
control systems, robots, etc.
Two types of Real-Time Operating System which are as follows:
• Hard Real-Time Systems:
These OSs are meant for applications where time constraints are very strict and even the shortest possible
delay is not acceptable. These systems are built for saving life like automatic parachutes or airbags which are
required to be readily available in case of any accident. Virtual memory is rarely found in these systems.
• Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices and system, thus more output from all the
resources
• Task Shifting: The time assigned for shifting tasks in these systems are very less. For example, in older
systems, it takes about 10 microseconds in shifting one task to another, and in the latest systems, it takes 3
microseconds.
• Focus on Application: Focus on running applications and less importance to applications which are in the
queue.
• Real-time operating system in the embedded system: Since the size of programs are small, RTOS can
also be used in embedded systems like in transport and others.
• Error Free: These types of systems are error-free.
• Memory Allocation: Memory allocation is best managed in these types of systems.
Disadvantages of RTOS:
• Limited Tasks: Very few tasks run at the same time and their concentration is very less on few
applications to avoid errors.
• Use heavy system resources: Sometimes the system resources are not so good and they are expensive as
well.
• Complex Algorithms: The algorithms are very complex and difficult for the designer to write on.
• Device driver and interrupt signals: It needs specific device drivers and interrupts signals to respond
earliest to interrupts.
• Thread Priority: It is not good to set thread priority as these systems are very less prone to switching
tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging systems, industrial
control systems, weapon systems, robots, air traffic control systems, etc.

6. Microprocessor Systems/ Parallel Systems/ Tightly coupled Systems:


A Multiprocessor system consists of several processors that share a common physical memory. Multiprocessor
system provides higher computing power and speed. In multiprocessor system all processors operate under single
operating system. Multiplicity of the processors and how they do act together are transparent to the others.
Advantages of Multiprocessor Systems

1. Enhanced performance
2. Execution of several tasks by different processors concurrently, increases the system's throughput without
speeding up the execution of a single task.
3. If possible, system divides task into many subtasks and then these subtasks can be executed in parallel in
different processors. Thereby speeding up the execution of single tasks.

7. Single User Operating System


This operating system can run only one program at a time and hence called single user or single task systems.
These systems run on microcomputers Only one user is normally in command of the system at any given time.
Examples of such type of operating system are DOS-Disk Operating System and Macintosh systems.

1. MS-DOS and PC-DOS: When IBM-PC came in the market a new operating system was needed. Then
Microsoft Corporation came up with PC-DOS (Personal Computer Disk Operating System) for the IBM-
PC. Later the same company developed MS-DOS (Microsoft Disk Operating System) a portable version of
PC-DOS, that can run on 8086 family microprocessor. MS-DOS is a command driven system.
As new microprocessors are developed accordingly operating systems are modified and updated. 6.22 is the latest
version of MS-DOS available, but most of the computers are running under, windows 95, 97 and 98.

2. Macintosh: Apple Macintosh users, uses menus and icons rather than commands. Icons are small symbols
that represent commands. Using mouse input device, the user moves a pointer to a word or icon and enters
the selection. This system is slower than command driven system.

8. Multi User Operating System


Since large computers such as mainframes. can perform more functions than microcomputers and are more
complex, therefore, operating system requires for such a system must be able to run several jobs at one time. Such
operating systems are called multi-user operating systems. These operating systems can run two or More
computer programs concurrently. Now-a-days multi-user operating systems have been adopted for
microcomputers as well. Examples are multi user operation system.

1. UNIX: This operating system is written in C Language, which is a high level language. It is less hardware
dependent than the operating system written in low level language. Thus UNIX can easily transport from
one system to another. System is surrounded by the shell, which serves as a programming language and as a
command language interpreter, reading the user commands and interpreting them as requests to execute
certain programs. Around the shell are the utilities such as text processing.
2. ZENIX: is an implementation of UNIX operating system for microcomputers. This type of operating
system is gained capital rapid acceptance, because of its multiprogramming capabilities and many useful
utilities.

9. Multi-process system

A multiprocessing system is one which has more than two processors. The CPUs are added to the system to
increase the computing speed of the system. Each CPU has its own set of registers and main memory. Just
because CPUs are separate, it may happen that one CPU must not have anything to process and may sit idle and
the other may be overloaded with the processes. In such cases, the processes and the resources are shared
dynamically among the processors.
Multiprocessing can be classified as symmetric multiprocessing and asymmetric multiprocessing. In
symmetric multiprocessing, all processors are free to run any process in a system. In Asymmetric
multiprocessing, there is a master-slave relationship among the processors. The master processor is responsible
for allotting the process to slave processors.

If the processor has integrated memory controller then adding processor would increase the amount of
addressable memory in the system. Multiprocessing can change the memory access model from uniform
memory access to nonuniform memory access. The uniform memory access amounts the same time for
accessing any RAM from any Processor. On the other hands, non-uniform memory access amounts longer time to
access some part of memory than the other parts.

10. Multithreaded system:

Multithreading is the execution of multiple threads of a single process concurrently within the context of that
process. Now let us first discuss what is a thread? A thread of a process means a code segment of a process,
which has its own thread ID, program counter, registers and stack and can execute independently. But threads
belonging to the same process has to share the belongings of that process like code, data, and system resources.

Creating separate processes for each service request consumes time and exhaust system resources. Instead of
incurring this overhead, it is more efficient to create threads of a process.
To understand the multithreading concept let us take an example of a word processor. A word processor, displays
graphic, responds to keystrokes, and at the same time, it continues spelling and grammar checking. You do not
have to open different word processors to do this concurrently. It does get happen in a single word processor with
the help of multiple threads.

Now let us take into consideration the benefits of multithreading. Multithreading increases the responsiveness as
if one thread of a process is blocked or performing the lengthy operation, the process still continues. The second
benefit of multithreading is resource sharing as several threads of a process share same code and data within the
same address space.

Creating a thread is economical as it shares the code and data of the process to which they belong. So the system
does not have to allocate resources separately for each thread. Multithreading can be increased on
multiprocessing operating system. As multithreading on multiple CPUs increases parallelism.

Difference between multiprocessing and multithreading:

BASIS FOR MULTIPROCESSING MULTITHREADING


COMPARISON
Basic Multiprocessing adds CPUs to Multithreading creates multiple threads of a
increase computing power. single process to increase computing power.
Execution Multiple processes are executed Multiple threads of a single process are
concurrently. executed concurrently.
Creation Creation of a process is time- Creation of a thread is economical in both
consuming and resource intensive. sense time and resource.
Classification Multiprocessing can be symmetric or Multithreading is not classified.
asymmetric.

11. Interactive Systems:


Interactive systems are computers which accept input from humans. Human send commands or data to computers
by typing or by any gestures. Examples are MS word or spreadsheet. An operating system which supports
interactive behavior is known as interactive operating systems. Examples of interactive operating systems are
Mac and Windows operating system.
Interactive operating systems can also get input from the graphical interface. To design interactive system,
customer-oriented communication is used which involves media and collaborative process between technology
and people. The aim of the interactive system is simplicity with unique goals and eye-catching interface.
Interactive media plays an important role in designing interface. Interactive media includes text, animation, video,
animated image and buttons, video games etc.

Advantages of interactive systems


• It helps disabled people perform their tasks like iPad and other interactive devices used. For example, in
latest home AC, disabled people can control the temperature of a room, check the voltage of AC, AC
timer from mobile or tablet device.
• Interactive systems are easy to use.
• These systems are used in testing phase also like testing interface elements and before launching product
all items can be checked accurately.
• It is used in the medical field like cardiac device and different chips used in the body which sends signals
to the computer screen.
• Performs better in doing marketing than old marketing like TV, radio or newspaper. It gets an immediate
response from the audience.
• Also performs well in the promotional offer like we see on various websites. If a user performs some
actions on the websites then a popup may appear to offer user discounted prices of products.
• It helps business to make a long-term relationship between customers.
• Interactive tools provide continuous support to customers in an easy way.
• Getting feedback from the customer is also done with the interactive system, for example, online polls and
surveys.
• Giving rewards on more purchases is also done by interactive tools. On getting rewards customers feel
more comfortable and it builds his interest and trust in the company.
• Interactive systems are used for voice recognition and many tools are available in the market which
performs well in this field.
• The attractive portable software is available to be downloaded and use on the internet. These software
work on internet and they perform by user input combined with web-based data.

Disadvantages of interactive systems

• Interactive systems may cause extra noise pollution like recognizing the voice in public places.
• These systems are easy to break and get scratched by touching interface.
• Designing complex and nice graphical interactive systems are difficult and take longer time.
• Nowadays some telephone systems are interactive and they record and recognize the voice. But it is
difficult for old aged people to communicate with these systems. These systems are difficult to design and
perform inaccurately.
• Text to speech is another type of interactive system in which user interacts by inputting text. Some text
cannot be converted as we pronounce it due to culture difference. The real-time text of the speech is
difficult to understand and requires highly skilled people for voice over.
• During receiving calls of customers, text to speech software needs to be accurate to respond and if the
customer takes interest in product then guiding him to the accurate path is difficult to manage and may
involve live representative to talk.
• Automatic calls are also managed by interactive systems. Sometimes people are busy with their work and
when receiving automatic calls make them insecure. These calls are made by company computers for
campaigns which sometimes result in bad result.
• Some interactive web-based software needs an internet connection to perform which limits access to the
user. Sometimes web-based software needs to put information to the public which effects company
business.
• Some interactive software needs extra hardware and memory resources to perform well.
• In interactive marketing, if a customer has already a product then he will just pass away without taking the
interest.
• Some interactive system cost higher due to its installation and setup, for example, interactive whiteboard.
It also makes bad impact on user’s eyes. The content preparation for the interactive whiteboard is also
tough.

Operating System structure:

Simple structure:
There are several commercial system that don’t have a well" defined structure such operating systems begins
as small, simple & limited systems and then grow beyond their original scope. MS"DOS is an example of
such system. It was not divided into modules carefully. Another example of limited structuring is the UNIX
operating system.

Layered approach: In the layered approach, the OS is broken into a number of layers (levels) each built on top
of lower layers. The bottom layer (layer o ) is the hardware & top most layer (layer N) is the user interface.
The main advantage of the layered approach is modularity.
• The layers are selected such that each users functions (or operations) & services of only lower layer.

• This approach simplifies debugging & system verification, i.e. the first layer can be debugged without
concerning the rest of the system. Once the first layer is debugged, its correct functioning is assumed
while the 2nd layer is debugged & so on.
• If an error is found during the debugging of a particular layer, the error must be on that layer because the
layers below it are already debugged. Thus the design & implementation of the system are simplified
when the system is broken down into layers.
• Each layer is implemented using only operations provided by lower layers. A layer doesn’t need to know
how these operations are implemented; it only needs to know what these operations do.
• The layer approach was first used in the operating system. It was defined in six layers.
Layers Functions
5 User Program
4 I/O Management
3 Operator Process Communication
2 Memory Management
1 CPU Scheduling
0 Hardware

The main disadvantage of the layered approach is:


• The main difficulty with this approach involves the careful definition of the layers, because a layer can use
only those layers below it. For example, the device driver for the disk space used by virtual memory
algorithm must be at a level lower than that of the memory management routines, because memory
management requires the ability to use the disk space.
• It is less efficient than a non layered system (Each layer adds overhead to the system call & the net result
is a system call that take longer time than on a non layered system).

System Components
1. Process Management: A process is only ONE instant of a program in execution. There are many processes
can be running the same program. The five major activities of an operating system in regard to process
management are:
• Creation and deletion of user and system processes.
• Suspension and resumption of processes.
• A mechanism for process synchronization.
• A mechanism for process communication.
• A mechanism for deadlock handling.
2. Main-Memory Management: Main-Memory is a large array of words or bytes. Each word or byte has its
own address. Main memory is a repository of quickly accessible data shared by the CPU and I/O devices. The
major activities of an operating system in regard to memory-management are:
• Keep track of which part of memory are currently being used and by whom.
• Decide which processes are loaded into memory when memory space becomes available.
• Allocate and deallocate memory space as needed.
3. File Management: A file is a collected of related information defined by its creator. Computer can store files
on the disk (secondary storage), which provide long term storage.
• The creation and deletion of files.
• The creation and deletion of directions.
• The support of primitives for manipulating files and directions.
• The mapping of files onto secondary storage.
• The backup of files on stable storage media.
4. I/O System Management: One of the purposes of an operating system is to hide the peculiarities of specific
hardware devices from the user.
• Secondary-Storage Management Generally speaking, systems have several levels of storage, including
primary storage, secondary storage and cache storage. Instructions and data must be placed in primary storage or
cache to be referenced by a running program.
5. Networking A distributed system is a collection of processors that do not share memory, peripheral devices, or
a clock. The processors communicate with one another through communication lines called network.
6. Protection System Protection refers to mechanism for controlling the access of programs, processes, or users
to the resources defined by a computer system.
7. Command Interpreter System A command interpreter is an interface of the operating system with the user.
The user gives commands with are executed by operating system (usually by turning them into system calls).
Operating System Services:
An operating system provides an environment for the execution of the program. It provides some services to the
programs. The various services provided by an operating system are as follows:
1. Program Execution: The system must be able to load a program into memory and to run that program.
The program must be able to terminate this execution either normally or abnormally.
2. I/O Operation: A running program may require I/O. This I/O may involve a file or a I/O device for
specific device. Some special function can be desired. Therefore the operating system must provide a
means to do I/O.
3. File System Manipulation: The programs need to create and delete files by name and read and write
files. Therefore the operating system must maintain each and every files correctly.
4. Communication: The communication is implemented via shared memory or by the technique of message
passing in which packets of information are moved between the processes by the operating system.
5. Error detection: The operating system should take the appropriate actions for the occurrences of any type
like arithmetic overflow, access to the illegal memory location and too large user CPU time.
6. Research Allocation: When multiple users are logged on to the system the resources must be allocated to
each of them. For current distribution of the resource among the various processes the operating system
uses the CPU scheduling run times which determine which process will be allocated with the resource.
7. Accounting: The operating system keep track of which users use how many and which kind of computer
resources.
8. Protection: The operating system is responsible for both hardware as well as software protection. The
operating system protects the information stored in a multiuser computer system.

Kernal: A kernel is an important part of an OS that manages system resources. It also acts as a bridge/
interface between the software and hardware or operating system and central processing unit of the computer. It is
one of the first program which is loaded on start-up after the bootloader. The Kernel is also responsible for
offering secure access to the machine's hardware for various programs. It manages various services as input and
output management, handling various call made to the system known as system calls, etc. It also decides when and
how long a certain application uses specific hardware.
Types of Kernel:
Currently in use are only two types of the kernel which are a microkernel and monolithic kernel.
1. Microkernel:
A microkernel is a software or a program in which user services and kernel services are present in different
address space. Due to which the size of the microkernel becomes smaller than that of a monolithic kernel. But as
the user services and kernel services are in different address space in order for a user service to use a kernel
service, message passing was used. This makes the execution of microkernel to be slower.
The microkernel is easily extendible. Due to which if a new service has to be added then it would not require any
changes to the kernel itself. Also, if any user service crashes it doesn’t affect the working of the microkernel.
The examples of microkernel would be QNX, minix, Symbian, Mac OS X, L4Linux, Integrity, K42, etc.
2. Monolithic kernel:
A monolithic kernel is an operating system software framework that holds all privileges to access input/output
(I/O) devices, memory, hardware interrupts and the CPU stack. A monolithic kernel is program or a software in
which kernel services and user services are present in the same address space. So in order for a user services to
use any kernel services, a system call is used. It makes the execution of the monolithic kernel much faster than the
microkernel. Also, the size of the monolithic kernel is much larger than that of a microkernel. Which makes the
size of the operating system even larger.
Monolithic kernel is not easily extendible, because the user services and kernel services are present in same addess
space. So in order to add any service, changes have to be made in the entire kernel itself. But, the major drawback
of the monolithic kernel is if a user service crashes, it may crash the whole system.
Examples of the monolithic kernel are Microsoft Windows, Linux, BSD (OpenBSD, NetBSD, FreeBSD), Solaris,
DOS, OpenVMS, etc.

Difference Between Microkernel and Monolithic Kernel

Parameters Monolithic kernel MicroKernel

Basic It is a large process running in a single address It can be broken down into separate
space processes called servers.

Code In order to write a monolithic kernel, less code is In order to write a microkernel, more
required. code is required

Security If a service crashes, the whole system collapses in a If a service crashes, it never affects the
monolithic kernel. working of a microkernel.

Communication It is a single static binary file Servers communicate through IPC.

Example Linux, BSDs, Microsoft Windows (95,98, Me), L4Linux, QNX, SymbianK42, Mac OS
Solaris, OS-9, AIX, DOS, XTS-400, etc. X, Integrity, etc.

Kernel pre-emption
Kernel pre-emption does not help in the overall throughput of the system. Instead, it seeks for better responsiveness.

The idea here is that normally kernel functions are only interrupted by hardware causes: Either external interrupts, or IO
wait cases, where it voluntarily gives away control to the scheduler. A pre-emptive kernel instead also interrupts and
suspends kernel functions just like it would interrupt processes in user mode. The system is more responsive, as processes
e.g. handling mouse input, are woken up even while heavy work is done inside the kernel.

Pre-emption on kernel level makes things harder for the kernel developer: The kernel function cannot be suspended only
voluntarily or by interrupt handlers (which are somewhat a controlled environment), but also by any other process due to the
scheduler. Care has to be taken to e.g. avoid deadlocks: A thread locks resource A but needing resource B is interrupted by
another thread which locks resource B, but then needs resource A.

Reentrant Kernels: A reentrant kernel is one that consists of executable code (programs and data) stored in
memory such that several processes can use this code at the same time without hindering the working of other
processes. Thus in reentrant kernel several processes may be executing in kernel mode at the same time.
For example:- a Process ‘A’ wants to perform read operation on disc, then the kernel will send this request to
disc controller. The disc controller will handle this read operation request and kernel will assign CPU to some
other process ‘B’ . When the process ‘A’ read operation is completed, the interrupt will notify the kernel so the
process ‘A’ can resume the execution. A typical use case is IO wait
The different concurrently processes executing in kernel made also share data. The data modified by one process
will affect the functioning of other processes using the data, so to avoid this condition a reentrant kernel uses
reentrant functions and locking mechanism. Reentrant functions are the one which allow process to modify only
the local variables and do not affect the global data variables. In locking mechanism, several processes can
execute reentrant function concurrently but only one process at a time can execute non-reetrant function. Once
that process is done then only other process can execute non reentrant function. This will ensure that global data
is modified by only one process at a time and thus each process has same copy of global data being shared among
them. In other words, by using locking mechanism there will be no chance of data corruption or multiple copies
of global data. Unix is a good example of reentrant kernel.

Spooling: Suppose we have a printer connected to a machine. Many users may seek to use the printer. To
avoid print clashes, it is important to be able to queue up all the print requests. This is achieved by spooling. The
OS maintains all print requests and schedules each users' print requests. In other words, all output commands to
print are intercepted by the OS kernel. An area is used to spool the output so that a users' job does not have to
wait for the printer to be available.

You might also like