Unit-I_Introduction
Unit-I_Introduction
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.
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.
– 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.
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.
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
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”.
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.
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.
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
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.
– 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
Applications:
1. Remote Login
2. File Transfer
3. N/W Browsing
4. Remote Execution
5. Messaging
l. Distributed OS (DOS)
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
– 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.
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.
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
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.
Q.: What are the factor should be kept in mind while designing of OS.
[4m, W-08]
– 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).
– 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]
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].
The meaning of privileged is the having right to do something to the different activity.
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