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

Unit-I_Introduction

The document provides an overview of Operating Systems (OS), detailing their necessity, objectives, definitions, and services. It discusses the evolution of OS from early mainframes to modern systems, highlighting various types such as batch processing, multiprogramming, and multitasking. Additionally, it explains the user and system perspectives of OS, emphasizing the importance of resource management and user interaction.

Uploaded by

thunderkinggamer
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)
3 views

Unit-I_Introduction

The document provides an overview of Operating Systems (OS), detailing their necessity, objectives, definitions, and services. It discusses the evolution of OS from early mainframes to modern systems, highlighting various types such as batch processing, multiprogramming, and multitasking. Additionally, it explains the user and system perspectives of OS, emphasizing the importance of resource management and user interaction.

Uploaded by

thunderkinggamer
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/ 30

TechnoScan - Operating System 1

UNIT-I

1.0 Introduction:

– This chapter introduces the concept of the Operating System. i.e. why OS is required,
what is OS, functions of OS, etc.
– This chapter also focus on views of OS i.e. user and system view.
– This chapter mainly focuses on evolution of the OS on the basis of processing, user and
special purpose OS.
– This chapter also introduces the concept of system call, events and their types.
– In the middle of chapter we will focus on the heart of OS i.e. kernel concept and their
types.
– This chapter focuses on Hardware protection, Design and Implementation of the OS on
the basis of different parameters.
– At the end unit will focus on some Question asked in university on system S/W and
justification.

1.1 Background of Operating System


– The earliest computers were mainframes, that lacked any form of operating system.
– Each user had sole use of the machine for a scheduled period of time and would arrive at
the computer with program and data, often stored on punched paper cards and magnetic
or paper tape.
– The program would be loaded into the machine and the machine would be set to work
with the program completed or crashed.
– Symbolic language, assemblers and compilers were developed for programmers to translate
symbolic program code into machine code that previously would have been hand encoded.
– Later machine came with libraries of support code on punched cards or magnetic tape,
which would be linked to the users program to assist in operations such as input and
output (I/P and O/P).
– The true descendant of the early operating system is what is now called the “Kernel”.
– In technical and development circles the old restricted sense of an operating system persist
because of the continued active development of embedded system (OS) for all kind of
[1]
2 Unit - I

devices with a data processing components, from hand held gadgets upto industrial robots
and real-time control system, which do not run user application at the front end as embeded
operating system in a device.

1.2 Requirement of Operating System

Que. Why Operating System is required in Computer System?


– Computer system is a combination of some devices, especially I/P and O/P devices.
– It consists of some processing elements as well thats why computer is called as data processing
unit.
– These all connected devices as useless if there is not any program installed, which can take
responsibility to control operation of such devices.
– In Computer System the devices and users are wanted to communicate with each other to
perform dedicated task.
– It leads to develop Operating System.
– To understand hardware language we need some system software.
– In fact operating system itself is a system software which help to proper working of all such
devices.
– At least every one required (Hardware and User) a easy interaction to computer system.

1.3 Objective of Operating System

Que. What are the objective of Operating System?


The objective of Operating System are:
1. Efficiency to Resource utilization.
2. Ability to evolve like adoption, development of new system.
3. To provide convenience to use to users.
4. To provide pleasant and effective user interface ‘Look at Feel’.
5. To hide details of hardware by creating abstraction of necessary thing and hide all
other details.
6. To allocate resource to process an operating system controls how process (active agent)
may access resource (passive agent).

1.4 Definition of Operating System / Concepts of Operating System

Que. What is Operating System?

Que. Define Operating System Concepts (S/13)


– As we all know that Computer System consists of some devices (i.e. I/P, O/P, processing
elements) which required to interact with each other.
– One of the way is required to interact with them we need system software.
TechnoScan - Operating System 3

– System software is a program which consist of many routines, subroutine, function and
preprocesses which can easily help to run or process some O/P to given I/P.
– In some manner Operating System is a small program which consist of some specific
instruction (also special purpose program).
– So simple and standard definition of Operating System is a intermediatery between Hardware
and Users.
– Computer system may consist some resource (CPU, Memory, I/O) and that need to proper
management produce O/P with synchronized manner in that perspective Operating System
is a resource manager.
– Operating System can act as a “government” because it controls all the resources and their
activity in system.

Fig.: 1.1 Overview of Computer System (OS).

Note: “Mother to Small Kids” Operating System is exact similar to this phrase consider
Fig. 1.1 which consist of number of devices altogether they controlled by the single operating
system.

1.5 Services of Operating System / Component of Operating System


Que.: What are different services provided by Operating System?
(W08/S10/W10/S11)
Que.: What are different Operating System component?
Que.: What is service management?
– Operating System provides many services that usually categories in user and system
perspective. Operating System services may vary system to system.
1.5.1 User Perspective:
a. Program execution b. Input / Output operation
c. File system manipulation d. Process communication
e. User interface f. Error detection
4 Unit - I

a. Program execution:
– Program consists of set of instruction in passive form, that need to be executed by some
resource.
– For execution of any program the content of program should load into main memory is
required after that execution is possible.
– New allocation and deallocation of memory is done by operating system itself.
– The environment is provided by the operating system itself.
b. Input / Output operation:
– While execution of program they may required some I/O devices for further execution.
– That I/O device (I/O burst) is provided by OS itself.
– User need not to control the I/O operation (allocation, release, use).
c. File system manipulation:
– File is a logical structure to stored data on secondary storage where programs content can
resides.
– User can store/save their program contents on file and need not to worry about the content
stored on secondary storage because Operating System keeps track of all such memory
location so that they will not overlap or override with other user data content.
– Hence user get its own copy without modification. Other than this operating system provide
creation, updation, privilege of file.
d. Process communication:
– During the execution of program it required same I/O or some value from other program,
that time (if co-operating process) they need interaction of both process to active or produce
O/P.
– That process communication is provided by operating system through IPC, socket, pipe,
shared memory (will discuss later) as a utility or mechanism which leads to proper
communication among processes.
e. User Interface:
– As a definition of operating system(intermidiatory) it support or provide way to user so
that user can interact with operating system directly for that operating system provides.
– Some way like graphical user interface(GUI), user interface (UI), command line interface
(CLI), and batch processing.
– By using above mechanism user can interact to operating system and get O/P to their I/P.
f. Error detection:
– Every process (during execution) is a sensitive issue because during execution it can possible
to some hazard occurs.
– Operating System resources whether they are doing a normal operation or not.
– Operating system take a corrective action in detection of error and shows the error message
to user so that user can know that error has occurred in system.
TechnoScan - Operating System 5

1.5.2 Service to System Perspective:


a. Resource allocation
b. Accounting
c. Error Detection
a. Resource Allocation/Manager :
– Computer system consist of many resources (CPU, Memory, I/O etc.). In multiprogramming
system many program are executed at time.
– Here they required some resources to perform their task operating system itself allocate
resource to performance of CPU management by Operating System with scheduling and
assigning the processes to the processors.
– Main memory management done with memory management technique to active proper
allocation of memory to program.
– Secondary storage management (HD, Magnetic Tape, CD ROM) is achieved by device
drivers (system S/W) because each devices is of different characteristics so they need proper
synchronization.
b. Accounting :
– In multiuser system more than one user can perform their operation / task on computer
system.
– Each user uses many resources that used resource Track must be taken by the OS to take
proper decision while allocation of resources.
– Operating system keep track of all user who logged in system, their usage of resource, and
their usage time.
– Simply operating system keep track of all users and resource present at system so it can
take a proper decision in future. (like dead lock, memory management).
c. Protection :
– As per as the system perspective the protection is main concern.
– Operating system provide a protection like owner of file, ensure that resource are used
logically and provides authentication, password management, locking mechanism, access
matrix and many more provided by operating system.

1.6 Operating System View / Approaches

Que.: What is user and system view of Operating System (S09, 5m)
– It can be implemented top down or bottom up.
– In a top-down implementation the implementation start with the system call handler and
see what mechanism and data structure are needed to support them.
– These procedures are written and so on until the hardware is reached.
– The problem with this approach is that it is hard to test anything with only the top-down
procedure available.
6 Unit - I

– For this reason many developers find it more practical to actually build the system bottom
up. This approach entails 1st with code that hides the low-level hardware.
– Simply we can define a user view of system / OS is, in user view users uses the services
provided by OS, user get virtual machine to use and it provided by OS itself.
– User need not to bother about how many activity are provided by the Operating System
(i.e. need not to worry about background activity of OS).
– Simply user are happy to see “Look at Feel” i.e. what they see? this approach is also called
top-down approach because user uses the OS services.
– Simply we can define a system view as, we can view OS as a “Resource Allocator”, program
controller, consider the situation in multi processing environment the OS effectively assign
the resource to each process.
– By considering all the system services its manage the all activity. This approach also called
as “bottom-up approach”.

1.7 Evolution of Operating System

Que: What are the different types of Operating System (Imp. Ques.)
– The first computers didnt have OS, and could only run one program at a time.
– The first electronic computing circuits were little more than separate function and didnt
really need even a programming language to be tested in about 1945.
– In 1950, transistor made the computer circuit solid state, which eliminated the need to
constantly patrol the innards of the computer to find burned out tubes and clean bugs out
of the electrical construct.
– By 1965 the 1st OS like program were beginning to show up, like the fortran maintaining
system, which had to deal with loading three types of programs, the fortran program, the
compiler and machine language program.
– Along with the concept came the idea of running the card reader from one partition to
another, then timesharing and many variation of processing real time, clustered OS and
many more evolved we will discuss one by one.
a. Sequential Processing:
– In sequential processing the execution of task perform in serial order i.e. one by one.
– It means at a time only one activity can be possible by processing element.
– Because of sequential operations (single) it leads to time consuming.
– The processing element will have capability to handle one task only.
– The processing occurs in order that is received.
– Programmer interact directly with computer hardware i.e. no operating system.
– Program in machine code are loaded with I/O device like card reader then operation is
performed.
TechnoScan - Operating System 7

Drawbacks
1. Setup time is high because it is hardware dependent we need to do programming on
hardware then it can perform specific task as per system program (driver) processing.
2. Loading time.

b. Batch Processing OS:


Que.: How batch OS evolution works (S06-6M)
– As we observe some drawback of sequential processing to overcome these problem, batch
processing introduces where all processor collected and submitted to the operator.
– Then operator will sort all programs into batches in different categories.
– Actually the data is written on punch card and submitted to computer operator then
operator handle all activity of that task.
– Then operator submit it to processing element and processor will perform all processing.
Advantages:
1. Batches is beneficial for large jobs.
2. User can not to interact with process execution.
3. User can submit their program and take O/P after some time, so it beneficial to large
task.
4. It increases CPU utilization by keeping processor busy.
5. It is also possible to give/provide priority for processor.

Disadvantages:
1. If process is small in size they have to wait for other process.
2. Time consuming to final execution.
e.g. Bill processing, Pay roll system.

c. Multiprogramming:
Que.: What are main advantages and working of Multiprogramming?
(S10-5M, W11-6M)
– In processing mechanism multiprogramming is one of
processing where more than one programs can “Resides
in main memory” at a same time.
– With the help of memory management technique memory
to all processes is allocated without any interleaving.
– When programs resides in main memory users can not
interact with system whatever decision want to take by
system it take at system level (user can not have choice to
select process).
8 Unit - I

– One system module will select proper process and submit it to processor (from main
memory) consider figure actually memory layout is divided into OS and user control.
– The user control space is consist of four task (J1, J2, J3, Jn) that means at a time all 4 task
are present (resides) in main memory.
– Now its a duty of system (scheduler) to select one of process and give it to processor.
– Generally all processes are needed their CPU and I/O burst during their life time they
frequently switches from one burst to another burst.
– The multiprogramming is only possible due to such activity where one process execute
their CPU burst and another can busy with I/O activity to achieve multiprogramming it just
happens because of context switching mechanism.
– Consider general example of word and excell application.
– If we are typing in word application excel just present in main memory.
– Another example is if users write some code in different languages but only one can active
at a time while others are only resides in memory.
d. Multi Tasking:
– Multitasking is ability to do more than one task at a time (but practically it is not possible).
– Earlier system was single tasking (MS-DOS).
– But as research goes on multitasking system invents (Windows and NT).
– Concept of context switching is required to switch from one process to another process.
e.g. if a man is listening songs while browsing the content of web at a same time.
– In order to achieve to multitasking we need to share some shared resource (CPU and
Memory).
– There are two basic types of multitasking i.e. preemptive and co-operative.
– In preemptive multitask, the OS parcels part of CPU time slice to each program and in co-
operative each program can control the CPU for as long as it needs. In multiprogramming
and user can interact with system i.e. it can control the execution of multiple program.
– e.g. Reading news paper and drinking tea.
e. Multiprocessing:
– Multiprocessing is also called multicore programming.
– It works on the principle where large task is divided into smaller sub task and delegating
those task to more than one processors which are connected to computer system (e.g.
parallel processing).
– Simply we can say multiprocessing is a mechanism in which two or more program or
segment of instruction simultaneously run by computer (CPU).
– In multiprocessing the processor can be used to execute a single sequence of instruction in
multiple contents (single instruction multiple data SIMD) often used in vector processing.
– This processing are of two types, one is the multiprocessing involves computer H/W and S/
W architectural where two or more identical processor are connected to a single shared
main memory.
TechnoScan - Operating System 9

– That called highly compiled system and symmetric multiprocessing (SMP) it does not carry
master slave relationship between processor. Also having own set of register and caches
(All processor).
– Where as in a asymmetric multiprocessing the system is loosely coupled in which all CPU
are treated equally.
– For example system might not allow (either at the H/W & OS Level) one CPU to execute
OS code or might not allow one CPU to perform I/O operation and this environment do
exist master slave relationship among processors.
– Server having rights to assign task to same processor but individual processor may perform
task on its own processing element and works and uniprocessor system.

Fig.: Symmetric M-Processing Fig.: Asymmetric M -Processing

f. Single User OS: Operating system evolution also available in how many user are uses a
system at a time (i.e. single user at a time)
– Single user OS is convenient to the single user to perform dedicated task.
– In single user OS other user can not interact with working users.
– The core part of single user OS is only single kernel image will run at a time i.e. there is no
any facility to run more kernel images while booting e.g. DOS, Windows (most of Unix
version are single user mode).
– Nowadays it is not convenient because every one need more user interaction and large
processing.
– Single user OS commonly used for home computer system
– This types of OS typically used in small devices like wireless phone and two way messaging
devices.
– It is not useful for a computer or other device intended to run multiple program at once.
g. Multiuser OS:
– Multiuser OS is a application or S/W that allow access by multiple user to any system.
– Actually multiuser OS concept is supported if any OS having multi kernel image loading
10 Unit - I

(like thin client).


– When user boot their system then single kernel image is loaded for specific user.
– It is good provision to for all users to complete their task by simply remote login or because
login to server system.
– The nature of S/W or application is inbuilt multiuser (most of the time).
– Consider an application as a antivirus which having multiuser functionality i.e. it having
capacity to handle more user at a time.
– Every user will get separate environment for processing.
h. Time Sharing OS:
Que.: Working of Time Sharing and give Advantages and Disadvantages
– Time sharing OS is logical extension of multiprogramming
– It means it is possible to have more than one processors in main memory at a time.
– While execution of any task in Time Sharing OS it get/assigned a predefine time slice. For
execution purpose (i.e. Time Quantum).
– If a process able to complete their execution within a time slice so no problem but if any
process remain to execute their potion so it will get next time quantum for execution
purpose.
– In order to provide more interactiveness and provide less response time it is suitable.
– To accommodate multiple real time user time sharing OS rotates its various job exection.
– In time sharing shuffling of job is possible on time quantum basis it is illusion of several job
executing simultaneously is created.
– The use of scheduling and context switching is needed.
– In time sharing system reources are shared to different jobs.
Advantages:
1. Time sharing system reduces CPU idle time.
2. It leads to quick response.
3. It is convenient to small user.
4. Effective use of resource by sharing to different processor.
Disadvantages:
Time sharing system leads to some drawback due to the nature of interactiveness,
multiprocessing, multiuser operation.
1. Question of Security:
– In time sharing system it arrives because the nature of m-user and interactiveness of time
sharing.
– Here more than one user can run their code at a time on same platform so it is possible to
hack or interleave of data content or the program values.
TechnoScan - Operating System 11

2. Problem of Communication:
– In time sharing system one execution of process switches from one process to another
process as per time quantum.
– So we need to save the current status of process and need to reload their content frequently,
that required process communication (IPC).
– It may cause of interleaving of memory address space and program content.
– Shared memory communication leads to keep more track of each process.
3. Question of Reliability:
– Due to interactiveness of time sharing it may cause to unreliable because of any data
content loss so it leads to system failure.
i. Parallel OS
– Parallel processing is a superset of multi processing system.
– Parallel processing works on the principle where the large task is divided into small sub task
and it assigned to individual core present in computer system and finally all O/P will merge
together.

Fig.: Parallel Processing

– Parallel processing is tightly coupled system in which the resource are shared by all processing
elements (like memory, clock).
– In order to communicate with different process it require IPC inter process communication
it achieved by shared memory.
– Data dependency concept is important if subtask1 is depend on subtask 2 so they have to
wait for each other, to produce O/P.
– Dependency may be of I/P dependency, O/P dependency , flow dependency, etc.
Advantages:
1. Throughput increases
– Presence of multicore architecture it leads to more outcomes.
– The speed up ratio with N processor is not N, rather it is less than N when multiple processor
co-operate on a task a certain amount of overhead is incurred in keeping all the parts
working correctly.
– Simply the availability of more processing elements it lead to process more task within less
time so maximum processes throughput is achieved.
12 Unit - I

2. Economic of Scale
– If we compare a single processing and multiprocessing environment if save lot of resource
(memory).
– Task example if we purchase single system it required all component to produce output
but if we shared those resource it save some money.
– Even if several program operate on the same set of data it is cheaper to store those data
on the disk and to have all the processor shared them than to have many local disk.
3. Increase Reliability
– Because of availability of many replicated resource if lead to fault tolerance if one of
processing element get failed it can not affect other processing.
– So simply user can rely on multiprocessing system.
4. Last advantage of parallel processing it work on divide and conquered rule in which lot of
advantages is possible.
j. Desktop Operating System
– The special use of desktop OS is for personal system.
– Desktop OS is a special purpose operating system.
– While the 1st generation of computer, the CPU in PC’s lacked the feature need to protect
an OS from user programs. Therefore it neither multiuser nor multitasking.
– But goal of this OS changes with time that instead of maximizing CPU and peripheral
utilization if system though of maximizing user convenience and responsiveness.
– Even the cost matter is sufficiently less than other system.
– Adaption is main feature of desktop OS it can support the maximum user level S/W
installation.
– It also possible to run more than one OS and S/W.
k. Network Operating System
– As compare to desktop OS the NOS (Network OS) is having separate system images to
separate user.
– NOS is middleware between local OS of one computer to local OS of another computer.
– The many computer are connected via same connecting device which form a N/W.
– While data transfer from N/W need to travel successfully at receive end NOS will help.
– NOS is a loosely coupled OS where each system having its own components (processing
element).
– While data transfer on N/W the concept of marshaling and unmarshaling is needed i.e.
only conversion of data from local client into same format so that middle user will not read
those data.
– The main (primary) task is resource sharing.
TechnoScan - Operating System 13

– NOS is the extension of traditional OS and it used for


1. Resource sharing
2. Information sharing
– NOS uses high level API, Socket, RPC for process communication.
– NOS is less fault tolerance than distributed OS.

Applications:
1. Remote Login
2. File Transfer
3. N/W Browsing
4. Remote Execution
5. Messaging
l. Distributed OS (DOS)

Que.: Differentiate Distributed OS with NOS (S09-4M)


– Distributed is special purpose OS (Advance OS).
– Distributed OS is a extension of Network OS with higher level of communication.
– DOS is a fault tolerance system.
– DOS is a loosely coupled system where each computer having its own computational
elements/resource (CPU, Memory, etc.)
– Standard definition of DOS is collection of autonomous computer system which capable
of communication and cooperating with each others through high LAN/WAN.
– It also define a collection of independent computer that appears to its user as a single
coherent system.
– Transparency is a key design issues of DOS where each for programming is provided
transparency means hide the details of each one.
– Like replication, Resource, N/W, etc.
– Common user can not predict the execution place (location) on distributed environment.
– Because in distributed environment all workstation/system are geographically separated.
– Why required:
– How to manage resource effectively
– Transparancy issues
– Replication facility
– Large and effective data processing
– DOS is lacking of common shared memory and clock (global) which leads to many problem
like event ordering, synchronization, etc.
14 Unit - I

Advantages:

1. Resource sharing
2. Computational speed up
3. Reliability
4. Scalability
e.g. Mach, Chorus, etc.
m. Real Time OS

– A key characteristic of RTOS (Real Time OS) is the level of its consistency concerning the
amount of time it takes to accept and complete task.
– RTOS is a one type of multiuser.
– RTOS always given O/P in will define time.
– RTOS is specially used for real time (server) application.
– It’s having ability to process data without buffering or delay.
– The time constrain is main in RTOS.
– e.g. Airplane (Landing, takeoff), lift, radar, etc.
Types of RTOS

1. Hard RTOS
– It must produces O/P in well define time
– If O/P not produce within time it lead to huge loss of data.
– It having less delay than soft RTOS.
– It need advance algo for job scheduling
2. Soft RTOS
– It having less time constraints than hard RTOS
– If O/P not produce within time so loss is considerable less than hard RTOS.
– It having greater delay than hard RTOS.
Note:
– Generally the sensors are used to take a data from any place because RTOS believes on
Real data.
– RTOS need to take instance decision for that if required current data.
– It can not tolerate any time delay.
– Job scheduling is needful to achieve real time activity.
TechnoScan - Operating System 15

1.7 Kernel Concept


Que.: What is Kernel?
Que.: Explain different types of Kernel.
– The OS is a complicated piece of S/W. It consist of a number of routines.
– Obviously the size of the OS is very large and it is not very wise to keep the full OS in
memory all time became very little space would be left for other application programs,
due to limited size of the memory.
– Therefore, the OS is divided into two parts. One consist of very essential routines which
are required very often and almost all the time and the user consist of routines which are
required sometimes, but not always.
– In this sense, they are not vital. The important portion called kernel of the OS.
– This is the inner most layer of the OS close to the hardware and controlling the actual
hardware.
– It is the heart of OS. All the other routines are loaded from the disk to the memroy as and
when needed shown in given figure.

Fig.: Kernel of the Operating System


Simple Points:
– Kernel is a part of OS that loads into memory at booting time and remains present into
memory.
– Generally kernel resides into protected area.
– If PC crashed that time kernel crash.
– We can also says the Kernel is central module.
– Kernel is a place where the real work is done.
– Sometimes Kernel is called a Operating System as well.
16 Unit - I

Fig. Kernel Place

1.7.1 Types of Kernel


– There are two types of Kernel is OS
A. Monolithic Kernel
B. Microkernel
A. Monolithic Kernel
– Earlier in monolithic kernel architecture, all the OS services (process, memory management,
interrupt handling, etc.) were packaged into single module in kernel space.
– This leads to some drawback
1. Size of Kernel may become so huge.
2. Poor maintainability, which means bug fixing or addition of new feature requested in
recompilation of the whole kernel which can consume lot of time.
– Now modern day approach for monolithic Kernel architecture the kernel consist of different
modules which can be dynamically loaded and unloaded.
Description:
– As figure shows the memory layout of OS where user space and kernel space are shown.
– The entire OS is loaded into kernel space and it acts as a supervisor.
– All services are provided by the OS that equivalent to monolithic kernel.
– If it fails so entire OS will fail.
– The device drivers are loaded into the running Kernel and it become the part of available
kernel.
TechnoScan - Operating System 17

– The function of OS involved with simple function calls within the Kernel which is one layer
program.
– Simply we can say monolithic kernel image = (kernel core + kernel services)
– Monolithic kernel is nothing but entire OS which provides all services as OS.

Fig.: Monolithic Kernel

B. Micro Kernel:
– As we seen in monolithic kernel it required huge space to load kernel into main memory
and it also leads to another problems.
– Here by remove all nonessential portion of kernel and implementing them as system and
user level program.
– The communication between all components are provided by the message passing (IPC).
– In micro kernel user having flexibility to extend system at any level.
– In microkernel the kernel part is moved into user space.
Advantages:
1. Extension of OS much easier.
2. Kernel become smaller due to separation of services at separate layers.
3. So changing, modification, maintenance and debugging is easy.
4. It is more secure and reliable.
5. It also easy to port.
18 Unit - I

Disadvantages:
1. Poor performance due to increased system message passing, content switching and other.
2. It create more confusion to other users because the code designed by one user may not
be essential for other so they may get confused.
Kernel image = Kernel Core

Fig.: Micro Kernel


– A microkernel can be considered a compact kernel as it perform only the basic function to
universally to all computer.
– By consideration of the above figure the OS services are deployed at user space and only
required code is kept at kernel space.
– Only the special routine required that time it can invoke to kernel space.
Note: There are alsokernel types like Hybrid, Nano and Exo.

1.7.2 Kernel Entry Points


Que.: What are different event in OS.
– Event - In computing environment event is an action or occurrences detected by the
program that may be handled by the program.
– Typically events are handled synchronously with the program execution flow i.e. the program
has one or more dedicated places where event are handled.
– The source of event comes from K/B or there I/O devices or any programming action
TechnoScan - Operating System 19

which generate/focus the attention of CPU (processing element).


– Event can also used instruction set.
– Simple definition of event is action perform by user or program called event.
Types of Event:
1. Interrupt
– Interrupt is an event generated by I/O device to take attention of CPU for execution
purpose.
– When I/O device get of hold of CPU that time the previous process contents save into ISR
(Interrupt / Service Routine) where the exact location presents.
– We know lot of information about interrupt that we have learned in Computer Organization
& Architecture and Microprocessor subject i.e. type of interrupt (maskable, non maskable,
software and hardware interrupt).
2. Trap
– Trap is also one type of event which is generated by the CPU itself.
– CPU analyze the processing instruction whether the instruction is executing is really fruitful
or not if not CPU generated trap and control goes to operating system.
– Divided by zero instruction, there is no sense to execute this instruction that time CPU take
an action (i.e. trap) to avoid unnecessary action and control goes to OS then OS display
proper message to user that error has occurred.
– Because CPU knew that divide by zero instruction is cause to waste of CPU cycle.
– And main points is after trap generated the contain of process need not to save on ISR
because there is no requirement of these process state in future.
3. Signal
– Signal is also one type of event/interrupt send to process, which is type of soft interrupt to
process.
– If user want to stop the activity of any process (foreground) that time by using s/w interrupt
they can control the process execution.
– e.g. while execution of any process the user can apply signal using keyboard like (Ctrl+C,
Ctrl+Z, and other) and can control the process for a while.
– When signal generated that time current activity will interrupted and signal Handler call to
handle the signal event.
In case of signalthe process may takes are three action.
1. It takes default action defined by the O.S.
2. It can ignore signal or take program.
3. or, last it do specific action (programmer).
Note: Generally on background processes signal (soft interrupt) can not perform any
action means It does not affect or stop the execution of process.
20 Unit - I

1.8 System Call


Que. What is system call. [W-2, 4m]
– System call are an interfere provided to communicate with the O.S.
– An OS system manages entire functioning of a computer by its own, but on many occasion
explicit direct or indirect call are required to perform various operations.
– Routines or functions or calls that are used to perform OS functions are called as system
calls. Most of the system call of OS are available is the form of commands.
– System call instruction are normally available is assembly language.
– High level language such as C, C++ and perl also provides facility of system programming.
Why System call Required
• User process must not be given open access to the kernel code.
• The system call interfere layer contains entry point in the Kernel code.
• Any user or application request that involves access to any system resource must be handled
by the kernel code.
• When program needs to access restricted resources.

Fig.
Working: When user program want to take services from OS eg. read, sys, call.
• User program makes a call to a library functions.
• Then Library routine puts appropriate parameter at a well known place (Reg, stack, Table
in mm). It passes library parameter or system call number.
– The trap instruction in executed to charge mode from user to kernel.
– Then control goes to O.S.
– Then OS determine which system call’s is to be carried out (by system call no.).
TechnoScan - Operating System 21

– Then kernel index to dispatch table which contents pointer to service routine for system
call.
– Service routine is executed and return parameter or error code place at well known place
usually a CPU required.
– At last control goes to user process.
– An library function executes the instruction followed by the trap.
1.8.1 Types of System call are what are distant types of system call
– System call can be grouped into some categories.
(A) Process control system call.
– creation of processes, Termination of process
– abort of process, End of process.
– load of process, execution of process
– get process attributes, set process attribute
– wait for time, wait event, signal event.
– Allocation and Deallocation of memory.
(B) File management system call
– Creation of File, deletion of file.
– Open, close, Read, Write, reposition of File.
– Get File attributes, set file attributes.
(C) Device management
– Request to specific device, used of device and Release
– Read, Write, Reposition.
– Get/Set device attribute
– Logical attach or detach devices.
(E) Information maintenance
– Get/Set time or date
– Get/Set system date
– Get/Set process, File or device Attributes
(F) Communication
– Create, delete, communication connections
– Send, receive, messages
– Transfer states information
– Attach or detach remote device.
(G) Protection
– Set file security
– Intialize security descriptor
– Set security, Descriptor Group etc.
22 Unit - I

1.9 H/W protection in OS


1. Dual-mode operation
– Sharing system resource requires os to ensure that an incorrect program cannot cause
other program to execute incorrectly.
In order to support protection two mode of operation are provided.
(i) User mode The program execution is done on behalf of a user.
(ii) System mode It also called supervisor mode, here execution is done on behalf of OS
itself.
– Allow those programs that are not allowed in user mode.
Solution: Mode bit added to computer H/W to indicates the current mode, system=1 or user
mode=0.
– Privileged instruction can be issued only in monitor mode.

Fig.: General Scenario

2. I/O protection
– All I/O instruction are
privileged instruction, must
ensure that a user program
could never gain control of
the computer in monitor
mode (i.e. user program that
apart of its execution. Stores
a new addresses in the
interrupt vector).
IF user want to take
privileged need to switch by
system call.

Fig. Example of I/O protection.


TechnoScan - Operating System 23

(3) Memory protection


– Memory protection should be provided where exact allocation of process can resides.
– Must provide process protection at least for the interrupt vectored and the interrupt service
routine. In order to have many protection add to register to determine range of legal
address space.

Fig. Memory protection example


(i) Base Register: It hold the smallest legal physical address.
(ii) Limit Register: It consist of size of the range (address).
– Memory outside the defined range is protected.
– No process can access outside their address space is allowe.
– It should not less than base register and should not greater than limit register.
(4) CPU protection
– In order to protect CPU timer is provided.
– Timer is decremented at every clock tick.
– When timer reaches to zero an interrupt occurs.
– Fixed clock interval is required to allow the access of CPU to process.
– Again atleast it should ensure that CPU does not assigned infinite time to any process.
– Load timer is a privileged instruction.
Note: All protection issues are uses to ensure that proper, fair and effective use of all
resource to process.
24 Unit - I

1.10 Design and Implementation of OS

Q.: What are the factor should be kept in mind while designing of OS.

[4m, W-08]

Q.: Describe various criteria that lead to developed of an OS [4 M, S–09]


– While design of any operating system many factor are needed to both user and system
prospective.
– The design and Implementation must be careful because if designed fail so it may lead to
produce bad O/P and will become unsatisfied user.
Basic Fundamental Principles:
1. Performance: any product that must have perfect and should able to perform some task
this is big issues while OS designing.
2. Robustness: While any hazards in system OS should be robust because if it collapse it can
not produce O/P and user could not get any satisfication. It should be hard to break.
3. Efficiency: L OS should be efficient to produce the O/P.
4. Scalability: OS should have scalability capability if any user want to increase the operation,
user and may more that time OS should support to user requirement.
5. Predictability: It should not be unpredictable. Every time it should produce the same
result.
6. Exclusive use of Resource: So should provide fair and exclusive use of resource to
each process. So that they can executed their task without interleaving to other.
7. Modularity
8. Extensibility
9. Reliable
10. Simplicity and may more
(A) Design Goal
– While design of OS selecting a best H/W type to system is one of the goal.
– The Nature of system (processing) like Batch, Time sharing, etc.
– The OS design Goal is categorized into two types.
(i) User Goal: As a user perspective OS should be easy to used, it should be reliable, safe,
fast to produce any output, easy to learn any may more as all user requirements.
(ii) System Goal: As a system perspective it also having same goal while design.
– It should be Error free.
– Easy to design, reliable, flexible.
– It should have fair maintenance.
– It should effective to produce results.
TechnoScan - Operating System 25

(B) Mechanism and policy


(i) Mechanism – Mechanism determine how to do something.
– Simply if we want to protect some resources so how that resource can be protected.
– e.g. In order to protect CPU we uses timer mechanism.
– Consider a mechanism for giving priority to certain type of programs over other.
– If mechanism is properly separated from policy. It can be used to support policy
decision.
– Mechanism achieve the fair and protected used of CPU among the processor.
1. Policy – Policy is also one of the important principle of OS design.
– The policy may vary place to place and time to time.
– Policy decision are important for all resource allocation and scheduling policy.
– e.g. How many time allow user to user a resource.
– In simple word policy is nothing but to what to do?
(C) Implementation:
– After design and other criteria are set we need to think how to develop an OS which will
be able to work properly.
– The implementation is a part of developing of OS by using the language paradigm.
– With the help of language construct we can develop any OS.
– In earlier ear the OS were developed in assembly level language but assembly level language
has so many drawbacks.

Drawback of Assembly Language


– Assembly language is difficult to code.
– It need to keep extra information in mind like opcode etc.
– Assembly level language does not support to modularity.
– It also not having convenient to user because of hard to code.

High level language


– Now a days the high level language are used to build a OS (kernel).
– Especially C language is preferred to design of OS.
– High level language is easy to code, easy to understand.
– More compact to maintain.
– Easy to debug and easy to port.
(D) System structure
– Design and implementation system structure is categorized into some parts.
26 Unit - I

– This design issues show how system looks like to internal working.
– How different services can developed to different level.
(1) Simple structure (3) Monolithic kernel
(2) Layered approach (4) Microkernel
(1) Single structure
– Traditional OS like MS-DOS/old unix having simple structure.
– The hardware protection dual mode does not present in simple structure.
– The all block are treat as the simple i.e. either user or system mode. (means there is no
provision to switch the mode).

Fig.: Simple Structure

– The structure of OS is not separated here all services are provided in bulk of module.
– Even it is not possible to modify the structure to any user (constant structure).
– Due to a single system structure all function are dependent on each others.
– If one fail so it affects others and they may lead to total crash.
2. Layered Approach

– In order to overcome the drawback and provide separate function at which level the
layered approach is invented.
– In which the different layers are design to provide separate services.
– Very Ist layer (bottom) is a H/W layered which support to H/W activity and their driver
routines.
– Layered 0 is dedicated to process management
– Layered 1 is allocated to mem-management
– Layered 2 is manage I/O device and buffering the information
Layered n ----- etc
– The fact is every layer are provide services to each above layer.
TechnoScan - Operating System 27

– At last upper layer is user interfere layer that provide user interfere to user for suitable used
of OS. (Any function).
Note: [Micro Kernel and Monolithic Kernel are already explained in kernel part so need
not to repeat here]

Fig.: Layered Approach

Advantages
– Due to separation of layer a services it support to modularity.
– It allow developer to change inner working of each layer.
– It support to design of OS (because user get change to design develop some new thing).
Disadvantages:
– It is user oriented so the changes mode by are user need not required to another user.
– Need careful definition of each layer at time of implementation.
28 Unit - I

Other Questions
Que. What is difference between system program and application program.
[W-11, 4m].

Application S/W System S/W


1. An application S/W which are program that 1. A system S/W is computer S/W which manage
enable the end user to perform specific H/W so that application S/W can perform
productive task. Such as word processing task e.g. OS, Macros, Compiler, etc.
image manipulation etc.
2. Application S/W runs on system S/W 2. System S/W perform task like transferring
mechanism but they perform as per the data from mem to disk (Internal data
design of user programmer. processing).
3. It started and install an secondary storage and 3. System S/W is stored on non-volatile memory
comes in memory while loading and installing. such as IC’S.
4. User written S/W tailors system to meet the 4. System program support to system activity
user specific needs. which required to run user program
5. Application S/W are not backbone of 5. System S/W are backbone of computer
computer system. system.
6. It is not in built family of system. 6. System S/W are the in built family of
computer system.
7. User can design many application S/W as per 7. Only specific H/W and component activity can
their requirement. be carried out by this S/W.
8. Not that much concern. 8. Design of system S/W must big concern.

Que. Which of the following instruction should be privileged. (W-10, 3M/W12,


4m)

The meaning of privileged is the having right to do something to the different activity.

(a) Set mode to kernel mode.


Ans.: Yes
(b) Reboot
Ans.: Yes
(c) Read the program states word
Ans.: No
(d) Disable interrupt
Ans.: Yes
TechnoScan - Operating System 29

(e) Write the instruction register


Ans.: No
(f) Set the value of timer
Ans. : Yes
(g) Read the clock
Ans.: yes
(h) Clear memory
Ans.: yes
(i) Turn off interrupts
Ans.: yes
(j) Switch from user to monitor mode.
Ans.: No.

Que. What are the different categories of system S/W. [S09, 4M]
– There are so many categories of system S/W as per their uses to specific task.
1. Operating system: OS itself is one of the system S/W, which having the ability to control all
computer system with proper control.
2. Boot loader: It is a piece of code that runs before any OS load in memory.
– Boot loaders help to load system S/W and application S/W.
eq. Grub, LILO, etc.
3. Compiler
– Compiler is system S/W that help to transfer/conversion of code to specific language.
– Actually it convert the user High level code into low level (M/C).
4. Device driver
– Each device having its own device driver which help to run that device.
– Driver are H/W dependent and OS specific.
– When calling program invokes a routine in the driver, the driver issues commands to
device.
– The drivers typically communicated with device through system bus.
5. Assembler [And many more]
30 Unit - I

Q. Justify Your Answer:


1. Operating system acts as government.
Ans.: Yes
Justification:
– Because the OS control all activity which also provides all service to user as well as system.
– Specially OS provide resource management like CPU, Memory I/O etc.
– As like government having all control on each component/person O/S also same to
computer system.
– Finally OS is “all in all”.
2. Hard disk is a O/P or O/P device.
Ans.: Hard disk is both I/P and O/P device.
Notification: Hard disk contains date, file, information.
Case I when user want to read some data which is stored on disk that time Hard disk called
I/O device.
Case 2 when user want to stored some data on disk that time Hard disk called O/P device.
Note: Some time hard disk called neither I/P nor O/P device.
3. Time sharing does not support multiprogramming.
Ans.: Yes/True
Notification: Time sharing means at time t1 only one process can be executed by CPU,on
the basis of time quantum.
– In time sharing the CPU allocated to process only if program is in memory.
– whereas multiprogramming means more than one program can available in memory.
– and in multiprogramming the decision of task assigning is done by OS itself.
4. Multiprocessing implies multitasking.
Ans.: Notification:
In multiprocessing environment more than one physical processor are available to perform
task.
– But in multiprocessing environment multiple task can done at a time on some or different
processor (No issues).
– while multitask is a concept which uses the context switching to switch from one task to
another task.
– By above points if, the availability of CPU, So its possible to perform multiple task on the
single processor.


You might also like