Os - 2
Os - 2
Operating
2 Systemn Structure
Syllabus
System components : Process managenent, Main memory
management, File nanagement, Input/output systern
management, Secondary storage management, Operating
systen services, System calls : Uses, process control. file
management, Device management, Information maintenance,
communication, Operating system structure, Simple structure,
layered, monolithic, micro kernel, Booting.
Statistical Analysis
execution components like code, data, PC(program (e) A mechanism for deadlock handling: When
counter), registers, OS resources in use etc. multiple processes runs at a time and does wait
Important thing to remember is that a process is not a for each other, a deadlock situation occurs. OS
handles deadlocks.
program. A process is only ONE instant or moment of a
program in execution. For exampBe a formula execution 2.1.2 Main-Memory Management
i.e. calculation in a program could be a process.
Process is unit, which measures the work done What are the different responsibilities af mernory
by the system. rmanagerment ? Explain. S-09
CPU executes the process, so process management 18 There are two types of memories in computer system.
required throughout the execution. Many processes can Primary memory which includes RAM, ROM, PROM
run on the same program. Process management is an and EPROM etc. Secondary memory i3 a mass storage
activity which is handled by operating system. which includes Hard disk, FlTno disk, CD, DVD or
even HVD
The five major activities of an operating system related
RAM memory is a major part of primary memory or
to process management are as follows :
main-Imemory which is a large array of words or bytes.
(a) Creation and deletion of system and user Each word or byte has its own memory address by
processes: This activity creates and deletes the which it is referred.
user's as well as system's processes. CPU mainly deals with main memory to execute
(b) Suspension and resumption of processes: input/output calls given by it lts all instruct ions are
This activity suspends (temporary stops) and executed using main menory. Main nemory provides
continues the process as per situation which storage that can be access directly by the CPU That is
oCCurs in the system to say for a program to be execited, it must be in the
main memory.
Operating System (MSBTE) 2-8 Operating System Structure
The major activities of
Operating System(MSBTE) 2-9 Operating System Struclure
memory management
component of an operating system are: The five key activities of an operating system's file
1 To keep track of part of memory which are management component are:
currently being used and by whom? This 1. The creation and deletion of files.
facilitates to know how much memory is free and 2. The creation and deletion of directories.
occupied by which processes. 3. The support of primitives for manipulating files
2. Decide which process is to be loaded into main and directories.
memory when memory space becomes available. 4. The mapping of files ontosecondary storage.
3. Allocate and de-allocate memory space as per the 5 The back up of files on stable storage media ie. on
requirement. secondary storages.
2.1.3 File Management 2.1.4 Input/output System Management
a. System file management in details. S-10 a. Explain the VO system management component of OS.
A file is defined as collection of related data. A file State different function required in /0 system management.
conld be a program ie. collection of executable W-09
statements. It could be a simple data file which stores /O management is a major function of an operating
data defined by its owner or creator.
system which mange input output system inclusive of
Computer can store files on the disk (secondary hardware, VO devices with device drivers and its
storage), which provide long-term storage. Sone supporting systems.
examples of storage media are magnetic tape, magnetic /O subsystem hides the complexity of hardware
disk and optical disk. devices from the user. Only the device driver knows the
Every media from these Medias has its oWn peculiarities of the specifie device to which it is
characteristics like speed, capacity, and data transfer assigned.
rate and access methods. These devices are basically VO devices must be utilized properly so they will be
categorized on their capacity and even size.
utilized maxinum. So operating systern keeps track of
One of the main function of an operating system is to VO devices to assign jobs to it.
decide where and how to store the data on to the disk. When I/O devices are busy and job is in process then
It is assumed that storage devices stores data in the data are kept in the buffers and even some other
locations called as tracks, sectors and cluster. There is
techniques called spooling are used.
a special system which takes care of files and
directories. 2.1.5 Secondary-Storage Management
Drectoes are memory location which stores or
organizes files into it File systems normally organized Computer systems have difTerent levels ot storage,
intodirectories to ease ther use These dircctories may including primary storage, secondary storage and cache
contain files and other directions storage. Instructions and data must be placed in
Op
Operating System(MSBTE) 2-10 Operating System Structure Operating System(MSBTE) 2-11 Operating System Struct
prirnary storage or cache to be referenced by a running The functions of an operating ystem in case of
program. networking are different than just a stand-alone
Because main memory is too small to accommodate all operating system. Operating system takes care for data
data and programs, and there is a danger of data loss sharing, data sending, data receiving, routing data ete.
when power is lost, the computer system nust provide
secondary storage to back up main memory. 2.1.7 Protection System
Secondary storage consists of tapes, disks, and other If computer system has multiple users and if it is
media designed to hold information that will eventually allowing the Concurrent execution of multiple
be accessed in primary storage is ordinarily divided processes, then the various processes must be protected
into bytes or words consisting of a fixed number of from each other's actívities.
bytes.
Each location in storage has its own address. The set of
Protection is a mechanism for controlling the access of
all addresses is available to a program is called an programs, processes, or users to the resources defined
by the computer systen or machine.
address space.
The three chief tasks of an operating system in the 2.1.8 Command Interpreter System
context of secondary storage management are : A command interpreter is an interface between
(a) Managing free space existing on secondary operating system and the LISer. The User gives
storage devices. commands whích are executed by operating system.
(b) Allotment of storage space when new files have to
be written Or create.
The main function of a command interpreter is to get
(c) and execute the user specified command. It is not the
Setting up or scheduling the requests for memory part of the kernel, since multiple comnmand interpreters
access.
(E.g shell, in UNIX ) nay be supported by an operating
2.1.6 Networking system, and they do not really need to run in kernel
mode.
Networking is technology used to connect ultiple
computers in the network. A distributed system is a 2.2 Operating Systerms Services
collection of processors that do not share the resources
like memory, peripheral devices, or a clock. Write any four services provided by operating system, S-09
The processors communicate with one another through Operating system Sets an environment which is
Comimunication lines called network The suitable to execute the programs. Operating systen
communication network design must consider routing provides many services for smooth tunctioning of
and connection strategies. and the problems of overall systen.
contetion and seCuritv.
Cperating System(MSBTE)
212 Operating Syslem Structure Operating Systern (MSBTE) 2-13 Operating Systen Structure
Following are the major services provided by operating directs the input/ output operations with the help
systems for convenience of the users. of graphical control like menu ete.
User Interface
2.2.2 Program Execution
2. Program Execution
3. Input/output Operations The purpose of computer systems is to allow the user to
execute programs. So the operating systems provide an
4. Fille System Manipulation environment where the user can conveniently run
5 Communications programs. The user does not have to worry about the
6. Error Detection nemory allocation or multitasking or anything. These
7. Resource Allocation things are taken care of by the operating systems.
8. Accounting Running a program involves the allocating and de
allocating of memory and CPU scheduling in case of
Protection and security multi-process. These functions cannot be given to the
user level programs. So user's programs cannot be run
2.2.1 User Interface
independently without the help from the operating
systems.
User interface is a medium through which user 2.2.3 Input/output Operations
actually interacts with the computer system via
op ating system. Almo all operating systems have a Each program requires an input and produces output.
uset interface (UI. This involves the use of VO device or files. The
Usér interfaces are calégorz into three types as operating system hides the details of underlying
hardware of an VO from the user. User can run their
fws programs conveniently because they are not aware
(a) CLI : Conmand line interface, provides an about the VO system of OS.
environment where ser can Write their
For better efficiency and protection, the users are not
commands in text fornat on command prompts. allowed to direetiy interact with LO devices. So
(b) Batch interface: Batch interface allows a operating system here becomes the bridge between LO
cummand environment which gets execute one by devices and user
one or sequentially_User creates a batch file OS makes VO devices available to user in a user
which contains multiple executable commands in friendly manner whenever required by users
a sequence. This hatch file is executed to execute
the set of comrnands included in it 2.2.4 File System Manipulation
(e) GU: Graphical user interface Most of the The output of a progran may need to be written inte
operating systens provide graphucal interfaces new files or an be given as input to other files. The
which have tools like ponting devices which operating systems provide this service. The user does
Ope
Sting Syen seTE Cyerating System Stchure SOperating Systen (MSBTE) 2-18 Operating Systen Structure
bave worry about secondary storage
emet This service cannot be controlled by user programs
Uset gves a eemand or reading or writig to a fle because it involves monitoring and in cases altering
can see h§s task accomplished. Thus operatingg area of memory or de-allocation of memory for a faulty
sstes make t easier for user pregrams to aceomplish process, It can be even relinquishing the CPU of a
their task process that goes into an infinite loop.
Operating system even handles the issues related to These tasks are too critical to be handed over to the
the dàerent ermissions hke read, write, execute, and user programs. A user program may interfere with the
even acoess Geny depending on the ownership of the normal operation of the operating systems if they are
Sle
allowed to control errors..
t also inveves ereatìng, deleting er even searching of
the files bs its name ltis done by operating system. 2.2.7 Resource Allocation
22.5 Communications When multiple users Or multiple jobs running
concurrently, resources must be al located to each cf
There are instances where processes need to
them.
cmunicate with each other to exehange information. Many types of resources such as CPU cycles, main
may be between processes running on the same
eomputer or running on he different computers. memory, and file storage etc may have special
By providing this service the operating system relieves allocation code, others (such as V0 devices) may have
the user from the worry of passing messages between general request and release code.
pirocesses In case where the messages need to be 2.2.8 Accounting
passed to processes on the other computers through a
network it can be done by the user programs. To keep track of which users use how much and what
The user prgram may be anre developed as per the kinds of computer resources. It also helps in finding out
speafios of she hardware through which the message the usage statistics.
transits and provides the service interface to the It is even useful for the researchers to find out the
eperating system. usage and the requirements to reconfigure the system.
2.2.6 ErrorDetection 2.2.9 Protection and security
An error is one part of the system may Cause
The owners of information stored in a multi-user or
maltunctioning of the complete system. To avoid such a
networked computer system may want to control use of
situaton the operating system constantly monitors the that information. i.e access to data and other related
sYsten for detecting the errors, OS ensures that the privileges like reading, writing, executing etc
user should not be worried of errors propagating to
various part of the system and causing malfunctioning.
Operating System(MSBTE) 2-16
Operating Systen(MS8TE) 2-17
Operating System Strcure
Operating System Structure
System prograns provide basic funetioning to users so
Even the concurrent processes should not interfere that they do not need to write their own envirunment
with each other which may cause damage to the for program development Eg. editors, compilers ete.
information.
and program execution e.g. shells In some sense, they
Protection : This involves ensuring that all access to are bundles of use ful system calls.
system resources is controlled.
Figure for system call describes an example where cne
Security of the system from unwanted users requires file is copied on other fle. Consider two files one is
user authentication. The defending of external VO source and other is destination.
devices from invalid access is important. It is
If data is to be copied from one file to other then the ile
important to protect the system and keep it secured. names should be known. Either it should be initialized
The precautions must be instituted throughout the in the program or input should be taken interactively
system. from the user wvhen prompted.
2.3 System Calls When file names are inputted, system checks whether
file exists or do it require access permission if yes then
a. What is System call? W-08, WN-10 contents are read from the respective files. Just observe
a. What is the purpose of system calls? W-09 the above all actions where every tine system call is to
What is system call? S-09 be made by operating system to do each an every
action.
System calls provide an interface between the process After confirming details about a ile either error
and the operating system. System calls allow user-level
processes to reuest some services rom the operating messages are prompted an the file or further reading
and writing actions are made. In this example system
systen which process itself is not allowed to do. calls are needed for taking input from one ile and
In handling the trap, the operating system will enter in putting into another file.
the kernel mode, where it has access to privileged In short systen calls are:
instructions, and can perform the desired service on
the behalf of user-level process. Kernel is a main part
1. Programtning interface to the services provided
by the 0S. (system calls are medator between
or component of an operating system. OS and process)
It is because of the critical nature of operations that 2. Typically witten in a high-level language EgC
the operating system itself does then every time they or C+
are needed. 3. Mostly aecessed by programs via a high-level
For example, for VO a process involves a system call Application Program Interface APD rathber
telling the operating system to read or write particular than direet system call use
area and thi request is satisfied by the operating Three most conmon APIs are Win32 API for
system. Windows, POSIX API for POSIX based svstems
KOperating Systenm (aSBTE) 218
Operating System Structure
(lt incudes virtually all versions of UNIX, Operating System (MSBTE) 2-19 Operating System Structure
and Mac 0S X, and Java APE for the Java Linux, Most of the details of OS interface are hidden from
machine JVMD
virtual
Example of System call programmer by API. It is managed by run-time support.
library. Compiler includes set of functions built into
libraries.
Souoe e
Destination ile
Example Syste Cal Secuenoe User application
Acguire input Ble name Open( )
Wrhe promet to soreen system
Apcept input User call
Acgulre output Sle name mode
Wite prompt to soreen
Aocept input System call interface
Open tha input le kernel
itSle doesnl exist. abort mode
Create oubut le
if le exists, abort
Loop
Read trom input tile
Wrile to output tile open ()
Until ead fals implementation
Close output tile of open()
Wite oompletion messaga to screen system call
Terminate noally
return
Fig. 2.2:Example of system call
Fig. 2.3 :System call
implementation
2.3.1 System Call Implementation 2.3.2 System Call Parameter
Passing
Generally a number is associated with each system Frequently more information is required than simply
call. It is used to number the system calls. System-call identifying of desired system call. Exact type and
interface maintains a table indexed according to these amount of information vary according to OS and call
numbers There are two general methods used to
parameters to the OS. pass
The system call interface invokes intended system call
in 0S kernel and returns status of the system call and 1
Simplest : pass the parameters in
registers. In
ny return values. sOme cases, may be more parameters than
Thecaller needs toknow nothing about how the system registers. In such a case parameters are stored in
call is implemented. Just needs to use APl(application a block, or table, in memory. Then the
address of
interface) and understand what OS will do as a result block passed as a parameter in a register. This
call approach is used by Linux and Solaris.
Parameters are placed, or pushed, onto the stack
by the program and popped off the stack by the
ECprting Syem serE) 220 Operating Systerm Strutune Operatng System(MSaTE) 221 Operating Srtem Dructure
operating y t e Block and stack methods do not L Process control (Mainly used for process)
i i t the nunber or length f parameters being end, abort
pessed load. eKecute
Parameter passing via table create process, terrninate process
get proceas attributes, set process attributes
wait for time
wait eent, signal evert
allocate and free memory
Lsd adss
Uia parameters Code ior Describe fle managerment Enist the systerm calls for fle
cal 13 cal 1234 management. W-10
2 Pile management (Used for manipulation of files)
create file, delete file
open, ciose
Operatig system
read. write, reposition
Fic 24: Parameter pavsing via table get file attributes, set file attributes.
Device management (Used for managing devices)
24 Types of System Calis Request device, release device
Exçiain types of syste call W-08 Read. write, reposition
get device attributes, set device attributes
Enst any four system calls related to fles S-09
ts funcions
Logically attach or detach devices
Dtate t Systems cals with V-09
Lst aerent types of system calls merion their uses S-10
Information maintenance (To do information
maintenance)
Enfst ay our system cals lated wth process get tirne or date, set tirne ur date
management V-10
et sytem data, set sy stern data
There are diflerent systen calls made by an operating get process, file, or device attributes
ystem Dlerent Lypes are categozed as per their set process, file, or device attribute
ge Communications (Por communicatirng
calls)
Process contro 2. Flemanagement
ereate, delete communication connection
3. Device managemert 4 Information mainitenance send. receive messages
5. Commurications transfer status information
Most of the syste calls suypert, or are supperted by Attach or detach remote devices.
coepts and functns
Operating System (MSBTE) 2-22 Operating System Structure Operating System(MSBTE) 2-23 Operating System Structure
2.4.1 Process Control In case if the running program discovers an error in its
input and if it wants to stop abnormally, it may need to
Enlist any four system calts tor process management. W-10 define an error level.
When operating system runs a program it is necessary If the program does not run properly and if there are
to either halt program execution normally or many errors a high level error can be defined.
abnormally ie. abort operation has to be performed by Sometimes the program runs successfully means there
OS. are no errors, still the 0 level errors can be defined.
If a system call is made to terminate or stop the This is useful for command interpreter to understand
currently running program abnormally or if the next action.
program runs into a problemn and causes an error trap, Command executor executes the program given by a
a dump of nmemory is taken and an error processor. Generally multiple prograns can run at a
message
generated. time. So command interpreter executes the
process
Then memory dump is written to disk and may be assigned by operating system.
checked by a debugger. A debugger is a program which It is very important to understand that where the
is designed to aid the programmer in hnding and b e a o e t econtrol should return
when the process execution gets
correcting bugs to determine the cause of the problem. It is
necessary to find out the status of the
In normal or abnormal circumstances, the operating programn whether it is loaded, lost, saved, completely
executed ete.
system must transfer control to the invoking command
interpreter. The executing programn should be saved if
If use. writes commands then command interpreter returns to the existing program when the new control
executes it and reads the next command. It operating terminates. Memory image of the existing program
program
system is an interactive system, the command should be saved.
interpreter contìnues with the next command. Thus mechanism of calling one
program by another
program is etfectively created. If both programs
It is assumed that the user will issue an appropriate
command to respond to any error. In a GUIsystem, pop executes concurrently, we have created a new job or
up window might alert the user to the error and ask for process which can be multi programmed. Gienerally
guidance there is a system call specifically for this purpose.
In case of multitasking
The behavior of command interpreter is different in a environment, If ve
new job or process, or perhaps even a set ofcreate
a
batch system. Batch file usually terminates the entire jobs or
process, its execution has to be controlled. This control
job and continues with next job.
requires the ability to determiie and reset the
Some operating system allows control cards to show attributes of a job or process. It comprises the jobs
special recovery actions in case an error occurs. Control prioritv, its maximum allowable execution time and so
card is a command which manages the process On.
execution.
Operating System (MSBTE) 2-24 Operating Systen Structure Operating System(MSBTE) 2-25 Operating System Structure
We may even wish to terminate a job or process that Time related to a program when it gets execute is an
we have already created incase if we find that it is important factor. Many operating systems provide a
incorrect or is no longer needed. time profile of a program to indicate the amount of the
Sometimes we have to signal the processes or jobs that time that the program executes at a particular location
it has to stop at the particular event. After creating or at the set of locations. A time profile requires either
new jobs or processes, we may need to wait for them to a tracing facility or regular timer interrupts.
finish their execution.
When program gets execute at each an every
User nay want to wait for a certain amount of time to occurrence of the timer interrupt, the value of the
be passed or more probably we may wish want to wait program counter is recorded for the further use,
With
for a specific event to occur. The jobs or process should sufficiently frequent timer interrupts, a statistical
then signal when the event has occurred. The system
calls help here.
picture (i.e time recording and its analysis) of the time
There is a set of system call which is helpful in
spent on various parts of the program can be obtained.
debugging a program. It fnd outs errors. Many There are some of many facets of variations in process
systems provide system calls to dump memory (i.e. to and job control. Let us see examples one involving a
put in the memory). This provision is specially kept
for single-tasking system and the other invoking
multitasking system to clarify these concepts
debugging.
A program traces or searches
fromn lists each The MS-DOS operating system is single tasking
instruction as it is executed. Few systems provided this system. DOS has command interpreter that gets
facility invoked when the computer is start or boot. As
known as MS-DOS is single tasking it uses a simple method to
Even microprocessor provide a CPU mode
single step in which a trap is executed by the CPUto run a program and it does not create a new process.
alert every instruction. The trap is usually caught by a
MS DO loads the program into memory, writing over
debugger. most of itself to give the program as much memory as
Free mernory possible. After that it sets the instruction pointer to
section
the first instruction of the program. The program then
Free memory executes, and either an error cause a trap or program
SENCIOn
Procoss executes a system call to terminate.
In somne cases, the error code is saved in the system
memory for further use. After this the small portion of
Command Command
interpreter interpreter
program program command interpreter that was not overwritten restart
Kernel Kernel execution.
The first task is to reload the rest of the command
(a) At system starts (b) running a program
Fig. 2.5: Process control
interpreter from disk. Then the command interpreter
Operating System (MSBTE) 2-26
Operating System Structure Operating System(MSBTE) 2-27 Operating Systern Structure
makes the previous error code available to the
to the next user or running process, to change that program's priority and
program. SO On.
Example of multitasking is Free BSD which is derived
from Berkeley UNIX. When user logs Exit) system call gets run when the process is done.
the shell is given as per into this system, This system call returns status code of 0 or nonzero
the user's
shell concept is similar to the
MS-DOS. requirement. This error code to the invoking process .This status or error
As FreeBSD is a code is then available to the shell or other prograns.
interpreter may multitasking
continue
system, the command
running while another 2.4.2 File Management
program is executed. If there is
new process, the shell requirement to start a
executes fork ) system call.
An exec ) system call is
a Q. Describe file management. Enlist the system calls for file
load a
and executes. Again to start a program from memory management. W-10
executes a fork ) system cal. new process, the shell File creation and deletion are regular operations which
Exec (0 system call is used when user performs on the files. Here system call
requires
loaded into memory and after this selected isprogram is the name of the file and even file's attributes. Once the
program executed. file is created it has to be opened to use it.
Depending on the way the command was issued, the
shell then either waits for the There are multiple operation which could be
process to finish or runs the file. It could be done on
the process "in the background."
reading, wiring Or even
When a process is running in the repositioning. Finally we need to close the file, which
background it cannot
receive input directly from the keyboard indicates that user does not need it at that instance.
shell issuing this resource. Input / output because the
is therefore Directories are also used by users to organize their files
done through files or through a GUI interface. in a proper order. Even same sets of
directories are required. operations for
Process D For fles or directories some
times it is necessary to be
Free memory able to deternmine the values of
various attributes of
them may be reset them if
Process C necessary.
File attributes could be file nane, a file
Interpreter type. protection
codes, accounting information, and so on. For
Process B
and setting getting
KomelE
attributes at least two system calls are
required. Some operating systems provide more
calls such as calls for moving and copying files. systen
Fig. 2.6 : Free BSD running multiple programs
2.4.3 Device Management
While process runs the user is free to ask the shell to
execute other programs, to monitor the progress of the Describe device managenent ot operating system. S-09
Operating Systern Structure Operating System (MSBTE) 229 Operating System Sthucture
Operating Systerm (MSBTE) 2-28
2.4.4 Information Maintenance
Device management is one of the tedious functions
performned by an operating system. The devices which Information maintenance is a term used for the system
OS manages could be physical devices, abstract or may calls which maintains the information. There are many
be virtual device. system calls exist which are used for transferrìng
It is necessary to assign the different resources as per information between the user progran and the
will not
the requirement of the process so that itthere. operating system. Best example of this type of systen
unnecessarily wait and thus delays won't be calls is the system calls which return the curret time
to execute. E.g.
A process may require some resources and so on. In
and date.
main memory, disk drives, access to files, There are other types of system calls which may return
are available, they can be granted, information about the system like the number of
ease if the resBOurces user process
and control can be returned to the current users, the version number of the operating
gets free.
otherwise process has to wait until devices systemn, the amount of free memory or disk space, ete
which are
Operating system controls various resources, The operating system keeps information about all its
thought of as devices. processes and system calls are used to aceess this
necessary for
In case if OS is multi-users systet, it is users. Some information. Systems calls are also used to reset the
requested devices to the
OS to provide the process information i.e getting process attributes and
high priorities or
users may be exclusive (i.e. havingavailable. setting the process attributes.
privileges)where devices should be
the devices are
After user finished with the device, 2.4.5 Communication
and
released. These functions are similar to the open Communication is a main aspect of operating system.
system calls use for files. Some operating systems
close It results Communication takes place between the processes that
permit for unmanaged access to the devices. and is known as inter process communication
hazard like potential for device conflict
in
deadlocks. Two common nodels of inter process communication
When the device has been requested by operating
are
the device,
system, user can read, write and reposition Message passing model
similar to the way user does it with files. Shared memory model.
just
system each
In some special cases like UNIX operating In the message-passing model. the conmunicating
folder are treated as a
an every deVice, files as well as processes exchange message with one another tu
files and
file. In this case a set of system calls used on transfer the information
identified
devices are same, Sometines I/Odevices are There could be direct or indireet communication
by special file names, directory
placement or file
exchanging messages through n common mailbox The
attributes name of the process should be known to another
and
User interface can also make appearance of files process on the same system or at process on anothe
devices same, though the fundamental system calls are computer connected by a communicaton Thetwork
Tot same.
2.5
One more exanple of limited structuring is the original functionality in the least space.
UNIX operating system. UNIX was also linited by 2. It is not divided into modules.
hardware functionality. It has mainly two separable
parts called the kernel and the system programs.
Operating System (MSBTE) 2-34 Operating System Structure Operaling System (MSBTE) Operating System Structrs
2-35
3
Although MS-DOS has Some structure, its In top to down approach the functions and features are
interfaces and levels of functionality are not well of OS are determined and they are divided into
separated. different components.
2.5.2 (b) MS-D0S Layer Structure and One of the methods to make OS modular is a Layered
Approach Layered
approach. In layered approach the operating system is
Q. Explain Layered OS structure S-09, S-10 broken up into a number of layers or levels. It forms a
Q. Describe layered approach less complicated structure of OS
to system design also write its
advantage and disadvantage. S-09 The bottom layer i.e. layer 0 is hardware and the
Operating systems can be broken into pieces with the highest (layer N) is the user interface layer. This
support or help of hardware. These parts will be layering structure is portrayed in Fig. 2.9.
smaller and more appropriate than those
the allowed by Layer N
original MS-DOS or UNIX Systems. user interface
Layer O
Resident system program hardware
Operating System(MSBTE) 2-38 Operating System Structure operating Systern (MSBTE) 2-39 Operating System Structure
interaction happens indirectly by exchanging messages Benefits of Microkernel model are:
with the microkernel. 1, Easier to extend a microkernel
Extending an operating system is one of the benefits of 2 Easier to port the operating systern to new
the microkernel approach. In this approach all new architectures.
services are added to user space which does not need 3 More. reliable (less code is running in kernel
mode)
modification of the kernel. IF kernel needs to modify, 4 More secured.
the changes are fewer, as the microkernel is a smaller
5 Very less Detrinents.
kernel. This results into operating system which can
be port from one hardware design to another
Since most of the services are running as a user process Guest apps Gues apps
rather than kernel processes, the microkernel is able to
GuestOS Guest 0S
provide more security and reliability. Incase if any
Virtual machine 0
service fails, the rest of the operating system remains Virtual machine N
parameters and results. Each procedure is free to call In this model for each system call there is one service
any other one. procedure that takes care of it. The utility procedures
In the construction of actual object program of the do things that are needed by several service
operating system when this approach is used, first procedures. E.g fetching data from user programs. The
compilers compile all the individual procedures, or files division of the procedure is shown in the figure.
containing the procedures. After this it binds them all 2.5.5 System boot
together into a single object fle using the file linker.
In terms of information hiding, there is essentially Q. Explain system booting in detail explain. S-09, S-10
none-every procedure is visible to every other Q. What are the steps involved in booting W-08
procedure or packages, in which much of the
information is hidden away inside modules, and only The procedure of starting a computer by loading the
the officially designed entry points can be called from kernel is known as booting the system. Bootstrap is a
outside the modules. smaller piece of code which finds outs where kernél is
Monolithic systems can even have a small structure. and locates it in main memory and starts its execution.
The system calls provided by the operating system are When the system is rebooted or powered up, the
requested by arranging parameters in well defined instruction registers are loaded in predefined memory
places such as in registers or on the stack and then
executing a special trap instruction known as a kernel locations, and then execution st arts. There exists a
call or supervisor call. program bootstrap loader. This program is stored in..
the read only memory. Read only data exists in ROM
Main Procedure
memory which is permanent.
Bootstrap is stored in ROM inst ead of RAM as RAM
Servio Prooedures memory is unknown in the initial stage when machine
(for system calls) starts or boots. But on the other hand ROM memory
does not require initialization and can not infect by
Utility routines virus problems.
(tor oomnon ta sks) The bootstrap program is very powerful which
Fig. 2.11: Monolithic structure of operating system. performs many activities. One of the activities is to
The monolithic organization propose a basic structure execute the diagnostic test This diagno stic test checks
for the operating system: whether all devices are in proper state to continue the
1 The main program which invokes the requested system program or not. It also initializes the CPU
Service procelure registers, device controllers etf After doirng these
2 The set of service procedures which carry out the activities it starts operating sy'stem in main nenory
systemn calls
The operating system software is actually stred tn the
3. A set of utility procedures that help the service disk of computer. But when bootstrap prograrn starta
procedures
Operating Systerm (MSBTE) 2-42 Operating System Structure Operating System (MSBTE) 2-43 Operating System Structure
the operating systen gets load in
main
RAMS memory. The reason behind thismemory is
or Switeh Protctad
Mede
mernory is small size due to which OS cannot be storedM
in main memory. CPU Rel Mode CPU in Protctod Mec
Draw and explain monolithic structure of O.S. Q. 21 Explain the l/O systern management component of OS State
different function required in /O system management.
Q. 2
(4 Marks)
(Section 2.5.4) (Section 2.1.4) (6 Marks)
Q. 3 What is System call ?Explain types of system calls Summer 2010 : Total Marks 24
(6 Marks)
(Sections 2.3 and 2.4)
Q.4 What are the steps involved in booting ? (4 Marks) Q. 22 Draw neat diagram and explain operating systern structure
(Section 2.5.5) (4 Marks)
(Section 2.1)
Summer 2009 : Total Marks 24 Q. 23 List different types of system calls mention their uses