Unit - 1
Introduction
This article delves into the evolution of operating systems since 1950. We'll go over six major operating system types that have been reviewed during the last 70 years.
Fig 1: Evolution of OS
Serial processing
The operating system's history dates back to 1950. There was no operating system in 1950, therefore programmers interacted directly with the hardware. The following serial steps are required if a programmer wishes to run a program on specific days.
- The program or punched card should be typed in.
- Use a card reader to convert the punched card.
- If there are any errors, submit to the computing machine, and the lights will indicate the error.
- To determine the source of an error, the programmer inspected the registers and main memory.
- Print the results on the printers.
- Then the programmer ready for the next program.
Batch processing
- This kind of operating system does not collaborate with the computer legitimately. There is an administrator which takes comparable jobs having same prerequisite and gathering them into batches.
- In this kind of system, there is no direct connection among user and the computer.
- The client needs to present work (composed on cards or tape) to a computer administrator.
- At that point computer administrator puts a batch of a several jobs on an input device.
- Jobs are batched together by sort of language and necessity.
- At that point an exceptional program, the monitor, deals with the execution of each program in the batch.
- The monitor is consistently in the primary memory and accessible for execution.
Advantages of Batch Operating System:
- It is exceptionally hard to estimate or realize the time required by any job to finish. Processors of the batch systems realize to what extent the job would be when it is in line.
- Various users can share the batch systems
- The inert time for batch system is extremely less
- It is easy to oversee huge work more than once in batch systems
Disadvantages of Batch Operating System:
- The computer administrators should have complete information with batch systems
- Batch systems are difficult to debug
- It is at some point expense
- Different jobs should sit tight for an obscure time if any jobs fail
Multiprogramming
- This sort of OS is utilized to execute more than one job at the same time by a single processor.
- It builds CPU by sorting out jobs with the goal that the CPU consistently has one job to execute.
- The idea of multiprogramming is depicted as pursues:
- Every one of the jobs that enter the system are kept in the job pool (in a disk). The operating system stacks a lot of jobs from job pool into main memory and starts to execute.
- During execution, the job may need to wait for some task, for example, an I/O operation, to finish. In a multiprogramming system, the operating system basically changes to another activity and executes. At the point when that job needs to wait, the CPU is changed to another job, etc.
- At the point when the first job completes the process of waiting and it recovers the CPU.
- For whatever length of time that in any event one job needs to execute, the CPU is never idle.
- Multiprogramming operating systems utilize the component of job scheduling and CPU scheduling.
Time sharing
- Time-sharing systems are not accessible in 1960s.
- Time-sharing or performing multiple tasks is a legitimate expansion of multiprogramming. That is processors time is shared among numerous users at the same time is called time-sharing.
- The primary contrast between Multi-programmed Batch Systems and Time-Sharing Systems is, in Multi-programmed batch systems its goal is expand processor use, while in Time-Sharing Systems its goal is minimize response time.
- Numerous jobs are executed by the CPU by switching between them, however the switches happen in such a less time, so that the user can gets a prompt response.
- For instance, in a transaction processing, processor execute every user program in a short burst or quantum of calculation.
- That is if n users are available, every user can get time quantum.
- At the point when the user presents the instruction, the response time is seconding all things considered.
- Operating system utilizes CPU scheduling and multiprogramming to give every user a little part of a time.
- Computer systems that were structured essentially as batch systems have been altered to time-sharing systems.
- For instance, IBM's OS/360.
- As the name itself recommends, in a time-sharing system or performing various tasks system, different jobs can be executed on a system simultaneously by sharing the CPU time among them.
- It is viewed as a logical expansion of multiprogramming on the grounds that the two does synchronous execution yet vary in their prime aims.
- The fundamental goal of time-sharing systems is to limit reaction time yet not boosting the processor use (which is the target of multiprogramming systems).
- The time-sharing systems were created to give an intuitive utilization of the computer system.
- A time-shared system utilizes CPU planning and multiprogramming to give every user a little segment of a period shared computer.
- It enables numerous users to share the computer resources all the while. As the system switches quickly from one user to the next, a brief timeframe opening is given to every user for their executions.
- The time-sharing operating system guarantees that every one of the assignments get the chance to get to the CPU individually and for a fixed little interval of time. This interval is known as the time quantum.
- E.g.: Unix Systems
Advantages of Time-Sharing OS:
- Each user gets an equivalent chance
- Less chances of duplication of programming
- CPU inert time can be diminished
Disadvantages of Time-Sharing OS:
- Unwavering quality issue
- One must need to deal with security and respectability of user programs and information.
- Information correspondence issue
Fig 2. Time-Sharing Operating System
Parallel system
- Parallel Processing Systems are intended to accelerate the execution of programs by isolating the program into numerous pieces and processing those fragments simultaneously.
- Such systems are multiprocessor systems called as tightly coupled systems.
- Parallel systems manage the synchronous utilization of numerous computer resources that can incorporate a single computer with various processors, various computers associated by a network to frame a parallel processing cluster or a blend of both.
- Parallel systems are harder to program than computers with a single processor in light of the fact that the engineering of parallel computers fluctuates appropriately and the procedures of numerous CPUs must be composed and synchronized.
- A few models for interfacing processors and memory modules exist, and every topology requires an alternate programming model.
- The three models that are most regularly utilized in structuring parallel computers incorporate synchronous processors each with its very own memory, asynchronous processors each with its own memory and asynchronous processors with a typical, shared memory.
- Parallel operating systems are essentially worried about dealing with the resources of parallel machines.
- This task faces numerous difficulties: application software engineers request all the performance possible, numerous equipment configurations exist and change all around quickly, yet the operating system should progressively be good with the standard adaptations utilized in computers.
- Today, new applications emerge and request faster computers. Business applications are the most utilized on parallel computers.
- A computer that runs such an application; ought to have the option to process enormous amount of data in modern ways. These applications incorporate designs, virtual reality, and decision support, parallel databases, medical diagnosis, etc.
- We can say with almost certainly that business applications will characterize future parallel computers design however scientific applications will stay significant users of parallel processing innovation.
Distributed system
The processors in a distributed operating system cannot share memory or a clock; instead, each CPU has its own local memory. The processors connect with one another via a variety of channels, including high-speed buses. "Loosely Coupled" systems are what these systems are called.
Advantages
- It is possible to share resources from one site to another if a number of sites are connected by high-speed communication lines, for example, s1 and s2. Some communication lines link them together. The site s1 has a printer, however there is no print on the site. The system can then be changed without having to switch from s2 to s1. As a result, resource sharing in a distributed operating system is possible.
- In distributed systems, a large computer is partitioned into a number of sub-partitions that run concurrently.
- We can use alternative systems/resources in other sites if a resource or system fails in one site owing to technological issues. As a result, the distributed system's reliability will improve.
History of OS
The operating system can be classified into four generations, as follows:
First Generation (1945-1955)
It marks the start of the development of electronic computing systems as a replacement for mechanical computers. Because of the flaws in mechanical computing devices, humans' calculation speed is limited, and they are prone to making mistakes. Because there is no operating system in this generation, the computer system is given instructions that must be carried out immediately.
Plug Boards are an example of a type of operating system and device.
Second Generation (1955-1965)
In the second generation, the batch processing system was implemented, which allows a job or task to be done in a series and then completed sequentially. The computer system in this generation does not have an operating system, although there are various operating system functionalities available, such as FMS and IBSYS.
Batch systems are an example of the type of operating system and devices employed.
Third Generation (1965-1980)
In the third generation, the operating system was designed to service numerous users at the same time. Interactive users can communicate with a computer via an online terminal, making the operating system multi-user and multiprogramming.
Multiprogramming is an example of a type of operating system and devices employed.
Fourth Generation (1980-Now)
The operating system is employed in this age for computer networks where users are aware of the existence of computers connected to one another.
The era of distributed computing has already begun, and users are comforted by a Graphical User Interface (GUI), which is an incredibly comfortable graphical computer interface.
The demand for traditional operating systems has increased as a result of the introduction of new wearable devices such as Smart Watches, Smart Glasses, VRGears, and others.
With the introduction of innovative gadgets such as Smart Watches, Smart Glasses, VR gears, and other wearable devices, the demand for unorthodox operating systems is also increasing.
Personal computers are an example of a type of operating system and device.
Key takeaway
Time-sharing or performing multiple tasks is a legitimate expansion of multiprogramming. That is processors time is shared among numerous users at the same time is called time-sharing.
Parallel Processing Systems are intended to accelerate the execution of programs by isolating the program into numerous pieces and processing those fragments simultaneously.
Operating systems area unit there from the terribly 1st pc generation and that they keep evolving with time. During this chapter, we will discuss a number of the vital varieties of in operation systems that are most ordinarily used.
Batch software system
The users of a batch software system don't act with the pc directly. Every user prepares his job on associate degree off-line device like punch cards and submits it to the pc operator. To hurry up process, jobs with similar wants area unit batched along and run as a bunch. The programmers leave their programs with the operator and therefore the operator then kinds the programs with similar needs into batches.
The problems with Batch Systems area unit as follows –
- Lack of interaction between the user and therefore the job.
- CPU is usually idle, as a result of the speed of the mechanical I/O devices is slower than the mainframe.
- Difficult to supply the required priority.
Time-sharing in operation systems
Time-sharing could be a technique that permits many of us, settled at varied terminals, to use a specific system at identical time. Time-sharing or multitasking could be a logical extension of execution. Processor's time that is shared among multiple users at the same time is termed as time-sharing.
The main distinction between Multiprogrammed Batch Systems and Time-Sharing Systems is that just in case of Multiprogrammed batch systems, the target is to maximize processor use, whereas in Time-Sharing Systems, the target is to attenuate latency.
Multiple jobs area unit dead by the mainframe by change between them, however the switches occur thus oftentimes. Thus, the user will receive a right away response. For instance, in an exceedingly dealings process, the processor executes every user program in an exceedingly short burst or quantum of computation. That is, if n users area unit gift, then every user will get a time quantum. Once the user submits the command, the latency is in few seconds at the most.
The software system uses mainframe programing and execution to supply every user with a tiny low portion of a time. Pc systems that were designed primarily as batch systems are changed to time-sharing systems.
Advantages of Timesharing in operation systems area unit as follows –
- Provides the advantage of fast response.
- Avoids duplication of code.
- Reduces mainframe idle time.
Disadvantages of Time-sharing in operation systems area unit as follows –
- Problem of responsibility
- Question of security and integrity of user programs and information.
- Problem of information communication.
Distributed software system
Distributed systems use multiple central processors to serve multiple time period applications and multiple users. Processing jobs area unit distributed among the processors consequently.
The processors communicate with each other through varied communication lines (such as high-speed buses or phone lines). These area unit referred as loosely coupled systems or distributed systems. Processors in an exceedingly distributed system could vary in size and performance. These processors area unit referred as sites, nodes, computers, and so on.
The advantages of distributed systems area unit as follows –
- With resource sharing facility, a user at one website could also be ready to use the resources on the market at another.
- Speedup the exchange of information with each other via electronic message.
- If one website fails in an exceedingly distributed system, the remaining sites will doubtless continue in operation.
- Better service to the shoppers.
- Reduction of the load on the host pc.
- Reduction of delays in processing.
Network software system
A Network software system runs on a server and provides the server the potential to manage information, users, groups, security, applications, and different networking functions. The first purpose of the network software system is to permit shared file and printer access among multiple computers in an exceedingly network, generally an {area|a neighborhood} area network (LAN), a non-public network or to different networks.
Examples of network in operation systems embody Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD.
The advantages of network in operation systems area unit as follows –
- Centralized server’s area unit extremely stable.
- Security is server managed.
- Upgrades to new technologies and hardware is simply integrated into the system.
- Remote access to servers is feasible from completely different locations and kinds of systems.
The disadvantages of network in operation systems area unit as follows –
- High price of shopping for and running a server.
- Dependency on a central location for many operations.
- Regular maintenance and updates area unit needed.
Real Time software system
A time period system is outlined as a knowledge process system during which the interval needed to method and answer inputs is thus little that it controls the atmosphere. The time taken by the system to reply to associate degree input and show of needed updated info is termed because the latency. Thus, during this methodology, the latency is extremely less as compared to on-line process.
Real-time systems area unit used once the area unit rigid time needs on the operation of a processor or the flow of information and time period systems is used as an impact device in an exceedingly dedicated application. A time period software system should have well-defined, mounted time constraints, otherwise the system can fail. For instance, Scientific experiments, medical imaging systems, industrial management systems, weapon systems, robots, traffic management systems, etc.
The area unit 2 varieties of time period in operation systems.
Hard time period systems
Hard time period systems guarantee that essential tasks complete on time. In onerous time period systems, external storage is restricted or missing and therefore the information is kept in storage. In these systems, computer storage is sort of ne'er found.
Soft real-time systems
Soft real-time systems are less restrictive. A critical real-time task gets priority over other tasks and retains the priority until it completes. Soft real-time systems have limited utility than hard real-time systems. For example, multimedia, virtual reality, Advanced Scientific Projects likes undersea exploration and planetary rovers, etc.
Key takeaway
Operating systems are there from the very first computer generation and they keep evolving with time. In this chapter, we will discuss some of the important types of operating systems which are most commonly used.
An OS provides services to each the users and to the programs.
- It provides programs Associate in Nursing atmosphere to execute.
- It provides users the services to execute the programs during a convenient manner.
Following square measure many common services provided by Associate in Nursing OS Associate in Nursing
- Program execution
- I/O operations
- File System manipulation
- Communication
- Error Detection
- Resource Allocation
- Protection
Program execution
Operating systems handle several styles of activities from user programs to system programs like printer spooler, name servers, digital computer, etc. every of those activities is encapsulated as a method.
A method includes the entire execution context (code to execute, knowledge to govern, registers, OS resources in use). Following square measure, the foremost activities of Associate in Nursing OS with relevancy program management −
- Loads a program into memory.
- Executes the program.
- Handles program's execution.
- Provides a mechanism for method synchronization.
- Provides a mechanism for method communication.
- Provides a mechanism for impasse handling.
I/O Operation
An I/O scheme includes of I/O devices and their corresponding driver code. Drivers hide the peculiarities of specific hardware devices from the users.
- An OS manages the communication between user and device drivers.
- I/O operation suggests that scan or write operation with any file or any specific I/O device.
- Operating system provides the access to needed|the specified|the desired} I/O device once required.
File system manipulation
A file represents a group of connected data. Computers will store files on the disk (secondary storage), for long-run storage purpose. Samples of storage media embody mag tape, disk and storage device drives like CD, DVD. Every of those media has its own properties like speed, capacity, knowledge transfer rate and knowledge access strategies.
A classification system is often organized into directories for simple navigation and usage. These directories could contain files and alternative directions. Following square measure, the foremost activities of Associate in Nursing OS with relevancy file management −
- Program must scan a file or write a file.
- The OS offers the permission to the program for operation on file.
- Permission varies from read-only, read-write, denied so on.
- Operating System provides Associate in Nursing interface to the user to create/delete files.
- Operating System provides Associate in Nursing interface to the user to create/delete directories.
- Operating System provides Associate in Nursing interface to form the backup of classification system.
Communication
In case of distributed systems that square measure a group of processors that don't share memory, peripheral devices, or a clock, the OS manages communications between all the processes. Multiple processes communicate with each other through communication lines within the network.
The OS handles routing and association ways, and therefore the issues of competition and security. Following square measure the foremost activities of Associate in Nursing OS with relevancy
- Two processes usually need knowledge to be transferred between them
- Both the processes may be on one pc or on totally different computers, however square measure connected through a electronic network.
- Communication could also be enforced by 2 strategies, either by Shared Memory or by Message Passing.
Error handling
Errors will occur anytime and anyplace. a mistake could occur in computer hardware, in I/O devices or within the memory hardware. Following square measure, the foremost activities of Associate in Nursing OS with relevancy error handling −
- The OS perpetually checks for potential errors.
- The OS takes Associate in Nursing applicable action to make sure correct and consistent computing.
Resource Management
In case of multi-user or multi-tasking atmosphere, resources like main memory, computer hardware cycles and files storage square measure to be allotted to every user or job. Following square measure, the foremost activities of Associate in Nursing OS with relevancy resource management −
- The OS manages every kind of resources victimisation scheduler.
- Computer hardware planning algorithms square measure used for higher utilization of CPU.
Protection
Considering a ADPS having multiple users and multiprogramming of multiple processes, the assorted processes should be shielded from every other's activities.
Protection refers to a mechanism or the way to manage the access of programs, processes, or users to the resources outlined by a ADPS. Following square measure, the foremost activities of Associate in Nursing OS with relevancy
- The OS ensures that each one access to system resources is controlled.
- The OS ensures that external I/O devices square measure shielded from invalid access tries.
- The OS provides authentication options for every user by suggests that of passwords.
Key Takeaway
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
In an operating system software plays out every one of the following function:
- Process management:- Process management causes OS to create and delete processes. It likewise gives mechanisms for synchronization and communication among processes.
- Memory management:- Memory management module plays out the role of assignment and de-allotment of memory space to programs needing the resources.
- File management:- It deals with all the file-related task, for example, storage organization, recovery, naming, sharing, and protection of files.
- Device Management:- Device management keeps tracks of all the devices. This module is in charge of the task also known as the I/O controller. It additionally plays out the undertaking of designation and de-distribution of the devices.
- I/O System Management: One of the primary objects of any OS is to conceal the identity of that hardware devices from the user.
- Secondary-Storage Management: Systems have a few degrees of storage which incorporates primary storage, secondary storage, and cache storage. Instructions and data must be put away in primary storage or cache so a running program can reference it.
- Security:- Security module ensures the data and information of a computer system against malware danger and authorized access.
- Command interpretation: This module is interpreting directions given by the acting system and assign resources to process that directions.
- Networking: A distributed system is a collection of processors which don't share memory, hardware devices, or a clock. The processors speak with each other through the network.
- Job accounting: Keeping track of time and resource utilized by different job and users.
- Communication management: Manage the coordination and task of compilers, interpreters, and other software resource of the different users of the computer systems.
Types of system calls:
System calls are divided into five categories.
Fig 3: Types of system call
The following are the various sorts of system calls:
Process control
Processes such as process creation, process termination, and so on are handled by these system calls.
Functions
● End and Abort
● Load and Execute
● Create Process and Terminate Process
● Wait and Signal Event
● Allocate and free memory
File management
File manipulation is handled by these system calls, which include creating, reading, and writing to files.
Functions
● Create a file
● Delete file
● Open and close file
● Read, write, and reposition
● Get and set file attributes
Device management
Device manipulation, such as reading from device buffers and writing into device buffers, is handled by these system calls.
Functions
● Request and release device
● Logically attach/ detach devices
● Get and Set device attributes
Information maintenance
These system calls control the flow of data between the operating system and the user programme.
Functions
● Get or set time and date
● Get process and device attributes
Communication
These system calls can be used to communicate between processes. They're also in charge of setting up and disabling communication connections.
Functions
● Create, delete communications connections
● Send, receive message
● Help OS to transfer status information
● Attach or detach remote devices
The software package is split into numerous layers within the stratified software package and every of the layers have totally different functionalities. This sort of software package was created as associate degree improvement over the first monolithic systems.
Why Layering in operative System?
Layering provides a definite advantage in associate degree software package. All the layers are outlined severally and move with one another pro re nata. Also, it's easier to form, maintain and update the system if it's tired the shape of layers. Modification in one-layer specification doesn't have an effect on the remainder of the layers.
Each of the layers within the software package will solely move with the layers that square measure higher than and below it. Very cheap layer handles the hardware and therefore the topmost layer deals with the user applications.
Layers in stratified software package
There square measure six layers within the stratified software package. A diagram demonstrating these layers is as follows:
Fig 4 – Layered operating system
Details about the six layers are:
Hardware
This layer interacts with the system hardware and coordinates with all the peripheral devices used like printer, mouse, keyboard, scanner etc. The hardware layer is that the lowest layer within the stratified software package design.
CPU planning
This layer deals with planning the processes for the hardware. There square measure several planning queues that square measure wants to handle processes. Once the processes enter the system, they're place into the work queue. The processes that square measure able to execute within the main memory square measure unbroken within the prepared queue.
Memory Management
Memory management deals with memory and therefore the moving of processes from disk to primary memory for execution and back once more. This is often handled by the third layer of the software package.
Process Management
This layer is accountable for managing the processes i.e. distribution the method or to a process at a time. This is often referred to as method planning. The various algorithms used for method planning square measure FCFS (first come back 1st served), SJF (shortest job first), priority planning, round-robin planning etc.
I/O Buffer
I/O devices square measure important within the pc systems. They supply users with the means that of interacting with the system. This layer handles the buffers for the I/O devices and makes positive that they work properly.
User Programs
This is the best layer within the stratified software package. This layer deals with the various user programs associate degreed applications that run in an software package like word processors, games, browsers etc.
Key takeaway
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.
Monolithic
The entire software package works within the kernel house within the monolithic system. This will increase the dimensions of the kernel furthermore because the software package. This is often totally different than the microkernel system wherever the minimum computer code that's needed to properly implement associate software package is unbroken within the kernel.
A diagram that demonstrates the design of a monolithic system is as follows −−
Fig 5 – Monolithic operating system
The kernel provides numerous services like memory management, file management, method programing etc. victimization perform calls. This makes the execution of the software package quite quick because the services square measure enforced beneath constant address house.
Differences between Microkernel and Monolithic Kernel
Some of the variations between microkernel and monolithic kernel square measure given as follows −
- The microkernel is far smaller in size as compared to the monolithic kernel.
- The microkernel is well protractible whereas this is often quite sophisticated for the monolithic kernel.
- The execution of the microkernel is slower as compared to the monolithic kernel.
- Much additional code is needed to jot down a microkernel than the monolithic kernel.
- Examples of Microkernel square measure QNX, Symbian, L4 UNIX operating system etc. Monolithic Kernel examples square measure UNIX operating system, BSD etc.
Advantages of Monolithic Kernel
Some of the benefits of monolithic kernel square measure square measure
- The execution of the monolithic kernel is kind of quick because the services like memory management, file management, method programming etc. are enforced beneath constant address house.
- A method runs utterly in an exceedingly single address house within the monolithic kernel.
- The monolithic kernel could be a static single computer file.
- Disadvantages of Monolithic Kernel
- Some of the disadvantages of monolithic kernel square measure square measure
- If any service fails within the monolithic kernel, it results in the failure of the whole system.
- To add any new service, the whole software package must be changed by the user.
Key takeaway
The entire operating system works in the kernel space in the monolithic system. This increases the size of the kernel as well as the operating system. This is different than the microkernel system where the minimum software that is required to correctly implement an operating system is kept in the kernel.
Microkernel Operating Systems
Kernel is that the core a part of AN OS that manages system resources. It additionally acts sort of a bridge between application and hardware of the pc. It's one amongst the primary programs loaded on start-up (after the Bootloader).
Fig 6 – Kernel
Kernel mode and User mode of electronic equipment operation
The electronic equipment will execute bound instruction only it's within the kernel mode. These instruction ar referred to as privilege instruction. They permit implementation of special operation whose execution by the user program might interface with the functioning of OS or activity of another user program. As an example, instruction for managing memory protection.
- The OS puts the electronic equipment in kernel mode once it's corporal punishment within the kernel thus, that kernel will execute some special operation.
- The OS puts the electronic equipment in user mode once a user program is in execution thus, that user program cannot interface with the OS program.
- User-level instruction doesn't need special privilege. Example ar ADD,PUSH,etc.
Fig 7- Process state
The conception of modes is extended on the far side 2, requiring over one mode bit CPUs that support virtualization use one amongst these additional bits to point once the virtual machine manager, VMM, is up to the mark of the system. The VMM has a lot of privileges than standard user programs, however not such a large amount of because the full kernel.
System calls are usually enforced within the sort of code interrupts, that causes the hardware’s interrupt handler to transfer management over to AN applicable interrupt handler, that is an element of the OS, switch the mode bit to kernel mode within the method. The interrupt handler checks specifically that interrupt was generated, checks extra parameters (usually more experienced registers) if applicable, so calls the acceptable kernel routine to handle the service requested by the call.
User programs’ tries to execute banned directions (privileged or non-existent directions), or to access prohibited memory areas, additionally generate code interrupts, that are cornered by the interrupt handler and management is transferred to the OS, that problems AN applicable error message, presumably dumps information to a log (core) file for later analysis, so terminates the violative program.
What is Microkernel?
Microkernel is one amongst the classification of the kernel. Being a kernel, it manages all system resources. However, during a microkernel, the user services and kernel services are enforced in numerous address house. The user services are unbroken in user address house, and kernel services are unbroken underneath kernel address house, therefore additionally reduces the dimensions of kernel and size of OS also.
Fig 8 – Application
It provides token services of method and memory management. The communication between shopper program/application and services running in user address house is established through message passing, reducing the speed of execution microkernel. The OS remains unaffected as user services and kernel services are isolated thus if any user service fails it doesn't have an effect on kernel service. Therefore, it adds to at least one of the benefits during a microkernel. It's simply long i.e. if any new services are to be extra they're extra to user address house and therefore needs no modification in kernel house. It's additionally moveable, secure and reliable.
Microkernel design
Since kernel is that the core a part of the OS, thus it's meant for handling the foremost necessary services solely. Therefore, during this design solely, the foremost necessary services are within kernel and remainder of the OS services are gift within system computer program. Therefore, users are able to move with those not-so necessary services among the system application. And also, the microkernel is only to blame for the foremost necessary services of OS they're named as follows:
- Inter Process-Communication
- Memory Management
- CPU-Scheduling
Advantages of Microkernel
- The design of this kernel is little and isolated therefore it will perform higher.
- Expansion of the system is simpler, it's merely extra within the system application while not heavy the kernel.
Key takeaway
Kernel is the core part of an operating system which manages system resources. It also acts like a bridge between application and hardware of the computer. It is one of the first programs loaded on start-up (after the Bootloader).
There are various methods which can be used to allocate disk space to the files. Selection of an appropriate allocation method will significantly affect the performance and efficiency of the system. Allocation method provides a way in which the disk will be utilized and the files will be accessed.
There are following methods which can be used for allocation.
- Contiguous Allocation.
- Extents
- Linked Allocation
- Clustering
- FAT
- Indexed Allocation
- Linked Indexed Allocation
- Multilevel Indexed Allocation
- Inode
Contiguous Allocation
If the blocks are allocated to the file in such a way that all the logical blocks of the file get the contiguous physical block in the hard disk then such allocation scheme is known as contiguous allocation.
In the image shown below, there are three files in the directory. The starting block and the length of each file are mentioned in the table. We can check in the table that the contiguous blocks are assigned to each file as per its need.
Fig 9: Contiguous allocation
Advantages
- It is simple to implement.
- We will get Excellent read performance.
- Supports Random Access into files.
Disadvantages
- The disk will become fragmented.
- It may be difficult to have a file grow.
Linked List Allocation
Linked List allocation solves all problems of contiguous allocation. In linked list allocation, each file is considered as the linked list of disk blocks. However, the disks blocks allocated to a particular file need not to be contiguous on the disk. Each disk block allocated to a file contains a pointer which points to the next disk block allocated to the same file.
Fig 10: Linked list allocation
Advantages
- There is no external fragmentation with linked allocation.
- Any free block can be utilized in order to satisfy the file block requests.
- File can continue to grow as long as the free blocks are available.
- Directory entry will only contain the starting block address.
Disadvantages
- Random Access is not provided.
- Pointers require some space in the disk blocks.
- Any of the pointers in the linked list must not be broken otherwise the file will get corrupted.
- Need to traverse each block.
Indexed Allocation
Limitation of FAT
Limitation in the existing technology causes the evolution of a new technology. Till now, we have seen various allocation methods; each of them was carrying several advantages and disadvantages.
File allocation table tries to solve as many problems as possible but leads to a drawback. The more the number of blocks, the more will be the size of FAT.
Therefore, we need to allocate more space to a file allocation table. Since, file allocation table needs to be cached therefore it is impossible to have as many space in cache. Here we need a new technology which can solve such problems.
Indexed Allocation Scheme
Instead of maintaining a file allocation table of all the disk pointers, Indexed allocation scheme stores all the disk pointers in one of the blocks called as indexed block. Indexed block doesn't hold the file data, but it holds the pointers to all the disk blocks allocated to that particular file. Directory entry will only contain the index block address.
Fig 11: Index allocation
Advantages
- Supports direct access
- A bad data block causes the lost of only that block.
Disadvantages
- A bad index block could cause the lost of entire file.
- Size of a file depends upon the number of pointers, a index block can hold.
- Having an index block for a small file is totally wastage.
- More pointer overhead
Key takeaway
There are various methods which can be used to allocate disk space to the files. Selection of an appropriate allocation method will significantly affect the performance and efficiency of the system. Allocation method provides a way in which the disk will be utilized and the files will be accessed.
As we know, a process needs two type of time, CPU time and IO time. For I/O, it requests the Operating system to access the disk.
However, the operating system must be fair enough to satisfy each request and at the same time, operating system must maintain the efficiency and speed of process execution.
The technique that operating system uses to determine the request which is to be satisfied next is called disk scheduling.
Let's discuss some important terms related to disk scheduling.
Seek Time
Seek time is the time taken in locating the disk arm to a specified track where the read/write request will be satisfied.
Rotational Latency
It is the time taken by the desired sector to rotate itself to the position from where it can access the R/W heads.
Transfer Time
It is the time taken to transfer the data.
Disk Access Time
Disk access time is given as,
Disk Access Time = Rotational Latency + Seek Time + Transfer Time
Disk Response Time
It is the average of time spent by each request waiting for the IO operation.
Purpose of Disk Scheduling
The main purpose of disk scheduling algorithm is to select a disk request from the queue of IO requests and decide the schedule when this request will be processed.
Goal of Disk Scheduling Algorithm
- Fairness
- High throughout
- Minimal traveling head time
Disk Scheduling Algorithms
The list of various disks scheduling algorithm is given below. Each algorithm is carrying some advantages and disadvantages. The limitation of each algorithm leads to the evolution of a new algorithm.
- FCFS scheduling algorithm
- SSTF (shortest seek time first) algorithm
- SCAN scheduling
- C-SCAN scheduling
- LOOK Scheduling
- C-LOOK scheduling
FCFS Scheduling Algorithm
It is the simplest Disk Scheduling algorithm. It services the IO requests in the order in which they arrive. There is no starvation in this algorithm, every request is serviced.
Disadvantages
- The scheme does not optimize the seek time.
- The request may come from different processes therefore there is the possibility of inappropriate movement of the head.
Example
Consider the following disk request sequence for a disk with 100 tracks 45, 21, 67, 90, 4, 50, 89, 52, 61, 87, 25
Head pointer starting at 50 and moving in left direction. Find the number of head movements in cylinders using FCFS scheduling.
Solution
Number of cylinders moved by the head
= (50-45)+(45-21)+(67-21)+(90-67)+(90-4)+(50-4)+(89-50)+(61-52)+(87-61)+(87-25)
= 5 + 24 + 46 + 23 + 86 + 46 + 49 + 9 + 26 + 62
= 376
SSTF Scheduling Algorithm
Shortest seek time first (SSTF) algorithm selects the disk I/O request which requires the least disk arm movement from its current position regardless of the direction. It reduces the total seek time as compared to FCFS.
It allows the head to move to the closest track in the service queue.
Disadvantages
- It may cause starvation for some requests.
- Switching direction on the frequent basis slows the working of algorithm.
- It is not the most optimal algorithm.
Example
Consider the following disk request sequence for a disk with 100 tracks
45, 21, 67, 90, 4, 89, 52, 61, 87, 25
Head pointer starting at 50. Find the number of head movements in cylinders using SSTF scheduling.
Solution:
Number of cylinders = 5 + 7 + 9 + 6 + 20 + 2 + 1 + 65 + 4 + 17 = 136
SCAN and C-SCAN algorithm
Scan Algorithm
It is also called as Elevator Algorithm. In this algorithm, the disk arm moves into a particular direction till the end, satisfying all the requests coming in its path and then it turns back and moves in the reverse direction satisfying requests coming in its path.
It works in the way an elevator works, elevator moves in a direction completely till the last floor of that direction and then turns back.
Example
Consider the following disk request sequence for a disk with 100 tracks
98, 137, 122, 183, 14, 133, 65, 78
Head pointer starting at 54 and moving in left direction. Find the number of head movements in cylinders using SCAN scheduling.
Number of Cylinders = 40 + 14 + 65 + 13 + 20 + 24 + 11 + 4 + 46 = 237
C-SCAN algorithm
In C-SCAN algorithm, the arm of the disk moves in a particular direction servicing requests until it reaches the last cylinder, then it jumps to the last cylinder of the opposite direction without servicing any request then it turns back and start moving in that direction servicing the remaining requests.
Example
Consider the following disk request sequence for a disk with 100 tracks
98, 137, 122, 183, 14, 133, 65, 78
Head pointer starting at 54 and moving in left direction. Find the number of head movements in cylinders using C-SCAN scheduling.
No. Of cylinders crossed = 40 + 14 + 199 + 16 + 46 + 4 + 11 + 24 + 20 + 13 = 387
Key takeaway
As we know, a process needs two type of time, CPU time and IO time. For I/O, it requests the Operating system to access the disk.
However, the operating system must be fare enough to satisfy each request and at the same time, operating system must maintain the efficiency and speed of process execution.
The technique that operating system uses to determine the request which is to be satisfied next is called disk scheduling.
References:
1. Operating Systems (5th Ed) - Internals and Design Principles by William Stallings, Prentice Hall India, 2000.
2. Operating System: Concepts and Design by Milan Milenkovik, McGraw Hill Higher Education.
3. Operating Systems - 3rd Edition by Gary Nutt, Pearson Education.
4. Operating Systems, 3rd Edition by P. Balakrishna Prasad, SciTech Publications.