Professional Documents
Culture Documents
Fundamentals of Operating System
Fundamentals of Operating System
INTRODUCTION : BASICS
OF OPERATING SYSTEM
GTU Weightage : 10 marks
Prepared By:
Jayesh Chauhan
INTRODUCTION
When we need to work with computer we
first switch on the power supply and wait till
our system becomes ready to login
from figure it is clearly visible that there are five users, out
of these all user 5 is active but user 1, user 2, user. 3 and user
4 are in waiting for their turn and user 6 is in ready status.
After user 5 utilizes it’s quantum period, the control moves
on to the next ready user as in case user 6. For next stage
user 2,user 3, user 4 and user 5 are in waiting state and user
1 is in ready state
3. Time Sharing Operating
System
ADVANTAGES
Provides quick response
Bring down CPU’s idle time.
DISADVANTAGES
System has to rely totally on other executing processes.
Must need to take about security and integrity of user
programs and data
Problem related to data communication must be resolved.
4. MULTIPROCESSOR SYSTEM
Multiprocessor systems with more than on CPU in close
communication.
Tightly coupled system – processors share memory, bus,
peripheral devices and a clock; communication usually takes
place through the shared memory.
I. FEATURES OF MULTIPROCESSOR SYSTEM
It supports large physical address space and larger virtual
address space.
II. If one processor fails then other processor should retrieve
the interrupted process state so execution of process can
continue.
III. Inter-processes communication mechanism is provided and
implemented in hardware
IV. Multiprocessor systems are of two types.
a. Symmetric Multiprocessing b. Asymmetric multiprocessing
4. MULTIPROCESSOR SYSTEM
Symmetric multiprocessing (SMP)
✦ Each processor runs and identical copy of the operating
system.
✦ Each processor uses different data and program but sharing
some common resources like I/o Devices.
✦ Many processes can run at once without performance
deterioration.
✦ Most modern operating systems support SMP
4. MULTIPROCESSOR SYSTEM
Asymmetric multiprocessing (AMP)
✦All CPUS are not equal. There is one master processor and
remaining are slave processor. Each processor have it’s own
memory space.
Each processor is assigned a specific task; master processor
schedules and allocated work to slave processors.
✦ More common in extremely large systems
DIFFERENCE BETWEEN SYMMETRIC AND ASYMMETRIC
MULTIPROCESSING.
Symmetric system treats all processors are equals, I/O can
processed on any CPU.
Asymmetric multiprocessing has one master CPU and the
remaining CPUs are slaves. The master distributes tasks
among the slaves. and I/O is usually done by master.
4. MULTIPROCESSOR SYSTEM
ADVANTAGES OF MULTIPROCESSOR SYSTEM
i. Throughput : Increases because number of processor is
increases
ii. Cost : Multiprocessor System is cheaper than the multiple
single processor system.
iii. Reliability : If one processor fails , there is no effect on
whole system operation.
iv. Response time : less because number of processor are
increased.
5. CLUSTERED SYSTEM
Clustered system is a group of computer
system connected with a high speed
communication link (LAN).
Independent systems, with shared common
storage and connected by a high-speed LAN,
working together.
Clustering systems are integrated
with hardware cluster (supports
sharing of high performance disks)
and software cluster(In form of
unified control of computer system
in a cluster work as a server) Fig-General structure of
a clustered system
Cluster node(server) contains layer
of cluster software and run it on the
node. Each node(server) monitors
the network whether cluster work
properly or not
5. CLUSTERED SYSTEM
If monitored computer fails than monitoring computer takes control
and ownership of it’s storage and other resources and restart
application of failed computer
It is divided in to two parts
1. Asymmetric Clustering : Here one machine is always in stand by
mode while other machines running it’s applications.
The stand by machine only monitor the active server. When active
server fails the host standby machines takes control and became
active server.
2. Symmetric Clustering : More than one servers run the application
and uses all available hard disks for operation
6. Distributed System
• Distributed Systems consist of multiple, possibly
heterogeneous, computers connected together via a network
and cooperating in some way, form, or fashion.
• Networks may range from small tight LANs to broad reaching
WANs.
• WAN = Wide Area Network, such as an international corporation
• MAN =Metropolitan Area Network, covering a region the size of a city
for example.
• LAN =Local Area Network, typical of a home, business, single-site
corporation, or university campus.
• PAN = Personal Area Network, such as the bluetooth connection
between your PC, phone, headset, car, etc.
6. Distributed System
• OS view of the network may range from just a special form of
file access to complex well-coordinated network operating
systems.
• Shared resources may include files, CPU cycles, RAM, printers,
and other resources.
6. Distributed System
• Advantages
• 1. Resource sharing : sharing of software resources like
databases, libraries and hardware resources like CPU cycles,
hard disks, RAM, CDROM, printers.
• 2. Higher reliability : Reliability refers to degree of tolerance
against errors and component failure. Availability is important
aspect of reliability. Availability refers to fraction of time
resources available for use. we can increase availability of
hard disk by having multiple hard disks so if one hard disk fails
or un available , program can use some other hard disks
• 3. Shorter response time and higher throughput.
• 4. Incremental growth : to extend power and functionality of
system by simply adding additional resources to system.
7. Network Operating System
An operating system oriented to computer networking, to
allow shared file and printer access among multiple
computers in a network, to enable the sharing of data, users,
groups, security, applications, and other networking
functions. Typically over a local area network (LAN),
or private network.
3. It have little laxity and generally 3.It is more flexible and have greater
provides full deadline compliance laxity and can tolerate certain
amount of deadline misses
4. Safety critical systems are 4. Linux is an example of softRTOS
typically hard real system.
BASIC SERVICES PROVIDED BY OS
EXPLAIN BASIC SERVICES PROVIDED BY OS ON BARE HARDWARE
MACHINE……. GTU, DEC 2014…….7 marks
OS provides different kinds of services to different user
programs like load data from memory, allocating disk for
storage, file or directory for open and read..
Services provided by OS are:
Program Error
Executtion Input Output
Operation detection
Accounting
User
File and Interface
Directory Communica
operation -tion
BASIC SERVICES PROVIDED BY OS
1. Program Execution : before executing the program it is
loaded to main memory by OS. Once program loads in main
memory it’s execution will be start.
Program may finishes execution with or without error.
2. Input output Operation : program is combination of input,
output statements.
while executing programs it requires input , output devices.
OS provides input, output devices to program.
KERNEL SPACE
CLASSIFICATION OF SYSTEM CALL
1. File management : File management system calls are to
create file, close file, read file, write file, get and set file
attributes
examples : read(), write(), open(), close(), etc.
Every file has some attributes like name of file, type of file,
accounting information, etc.
1. simple structure
Microsoft-Disk Operating system(MS-DOS) is example of simple
structure OS.
Most of commercial systems do not have well defined
structure. DOS is small and simple in size, when new versions
are introduced, size goes increasing.
There is no CPU execution mode (user and kernel) and so
error in application can cause whole system to crash.
MS-DOS consists following layers
1. Application program layer
2.System program layer for resident program
OS STRUCTURE
3. Device driver layer
4. ROM BIOS device driver layer
In DOS, application program directly interact with BIOS driver.
If user makes any changes in the BIOS device driver, it creates
the problem and affect all system. Here memory size is also
limited so after use memory must be made free for other
users.
Another example of layered operating system is UNIX
operating system.
initially it’s provides limited hardware functionality. UNIX is
divided in to two parts : kernel and system programs.
Kernel provides system call for CPU scheduling, file
management and memory management. System call uses
application program interface in UNIX. API defines set of user
interface with set of system programs Kernel supports API and
user interface.
LAYERED STRUCTURE
Second type of operating system is layered approach. OS is
divided in to number of layers. such layer boundary is
properly defined. Bottom layer is called layer 0 and top layer
is called layer N. Layer N provides user interface.
A function of layer is also fixed. each layer consists of data
structure and set of routines. layer provides services to upper
and lower layer.
LAYERED STRUCTURE
First layer (layer 0) contains only basic hardware to
implement function. so only first layer is debugged for
checking whole system. If error not found then the system will
work properly. If error encounters while debugging second
layer, then error is related to second layer only.
Care should be taken while designing the layers. which
functions are added to which layer must be designing
properly. some of the functions included only in lower level.
Device driver, memory management and input output
operation function must be included in lower level.
Secondary storage will required for all operations, when CPU
changes the process as per scheduling method, currently
executing process is stored o secondary storage. DISK space is
required for this purpose. So CPU scheduling is includes in the
above layer of the secondary storage.
LAYERED STRUCTURE
Advantages of Layered Approach:
1. Modularization makes debugging much easier.
2. Simple to design and implement
3. Provides transparency between layers
DISADVANTAGES OF LAYERED APPROACH
1. less efficient because system call takes longer time
2. Interaction between layers and parameter passing is
difficult.
Kernel
Kernel is a software code that reside in central core of OS.
It has complete control over system.
Kernel does not interact directly
with user, But it interacts
using SHELL and other programs
and hardware.
When operation system boots, kernel is first part of OS to
load in main memory. Kernel remains in main memory for
entire duration of computer session. The kernel code is
usually loaded in to protected area of memory.
Kernel performs it’s task like executing processes and
handling interrupts in kernel space. User performs it’s task
in user area of memory. This memory separation is made in
order to prevent user data and kernel data from interfering
with each other.
Kernel
When computer crashes, it actually means kernel has crashed.
Single program crash is not a kernel crash. kernel provides
services for process management, file management, i/O
management, memory management. System calls are used to
provide this type of services.
Kernel includes
a. Scheduler : allocates the kernel’s processing time to
various processes.
b. Supervisor : it grants permission to use computer system
resources to each process.
3. Interrupt handler : handles all requests from the various
hardware devices which compete for kernel services.
4.Memory manager : allocates space in memory for all users
of kernel service.
Kernel
Types of kernel
1. Monolithic kernel
2. Micro kernel
3. Hybrid kernel
4. Exo-kernel
Monolithic Kernel
Traditional UNIX OS uses monolithic kernel. The entire OS runs
as a single program in kernel mode. Program contains
operating system core function and device driver.
In this approach, most of operations performed by kernel via
system call. LINUX OS uses modern monolithic kernel
architecture. It loads the modules at run time.
USER APPLICATIONS
FILE Memory
I/O Process
Mgmt
COMPUTER HARDWARES
Monolithic Kernel
Advantages :
1. simple to design and implement
2. It provides speed on hardware
Dis-advantages:
1. If code size increases, difficult to maintain.
2. Fault tolerance is low.
Micro Kernel
Microkernel provides minimal services like defining
memory address space, IPC and process management.
It is small operating
code. Hardware
resource management
is implemented
whenever process
is executing.
The function of microkernel is to provide a communication
facility between the client programmers. For
communication it uses message passing method.
Microkernel runs in kernel mode and rest run in normal
user processes. It is also provides more security and
reliability. Most of services are running as user rather than
kernel processes.
Micro Kernel
here device driver and file system running as separate user
processes, a error in one can crash only single component.
Advantages:
1. allows addition of new services
2. Supports objects oriented OS
3.Modular design helps to enhance reliability.
4.It lends it self to distributed system support
5. microkernel architecture support flexibility. User can add
or subtract services according to requirement.
Comparison between monolithic and microkernel
Monolithic Kernel Micro kernel
4. All the operating system services 4. Kernel provides only IPC and low
are included in kernel level device management services.
1…1000.
…