0% found this document useful (0 votes)
36 views53 pages

OS Ch1

The document provides an overview of operating systems (OS), defining them as software that serves as an interface between computer hardware and users, and detailing their essential functions and components. It discusses the structure of computer systems, various types of operating systems, and the roles of the kernel, system calls, and OS services. Additionally, it covers the design goals, mechanisms, and implementation of operating systems, emphasizing their complexity and the need for efficient resource management.

Uploaded by

akdhore2207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views53 pages

OS Ch1

The document provides an overview of operating systems (OS), defining them as software that serves as an interface between computer hardware and users, and detailing their essential functions and components. It discusses the structure of computer systems, various types of operating systems, and the roles of the kernel, system calls, and OS services. Additionally, it covers the design goals, mechanisms, and implementation of operating systems, emphasizing their complexity and the need for efficient resource management.

Uploaded by

akdhore2207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

Operating System

Unit 1
Introduction to Operating System

Presented By
Prof. K.R. Ghule
Introduction
• What is an Operating System?
• An Operating System (OS) is a software that
acts as an interface between computer
hardware components and the user.
• Every computer system must have at least one
operating system to run other programs.
• Applications like Browsers, MS Office, Notepad
Games, etc., need some environment to run
and perform its tasks.
• Computer System = Hardware + Software
• Software = Application Software + System Software(OS)
• An Operating System is a system Software that acts as an
intermediary/interface between a user of a computer and the computer
hardware.
• Operating system goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient manner
The Structure of Computer Systems
 Accessing computer resources is divided into layers.
 Each layer is isolated and only interacts directly with the layer below or
above it.
 If we install a new hardware device
 No need to change anything about the user/applications.
 However, you do need to make changes to the operating system.
 You need to install the device drivers that the operating system will
use to control the new device.
 If we install a new software application
 No need to make any changes to your hardware.
 But we need to make sure the application is supported by the
operating system
 user will need to learn how to use the new application.
 If we change the operating system
 Need to make sure that both applications and hardware will
compatible with the new operating system.
Operating System Mode

 The User Mode is concerned with the


actual interface between the user and the
system.
 It controls things like running applications
and accessing files.

 The Kernel Mode is concerned with


everything running in the background.
 It controls things like accessing system
resources, controlling hardware functions and
processing program instructions.
 System calls are used to change
mode from User to Kernel.
Kernel
 Kernel is a software code that reside in central core of OS. It has
complete control over system.
 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 does not interact directly with user, but it interacts using
SHELL and other programs and hardware.
Kernel cont…
 Kernel includes:-
1. Scheduler: It allocates the Kernel’s processing time to various
processes.
2. Supervisor: It grants permission to use computer system
resources to each process.
3. Interrupt handler : It 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 provides services for process management, file
management, I/O management, memory management.
 System calls are
System Call
 System call is the programmatic way in which a computer program/user
application requests a service from the kernel of the operating system on
which it is executed.
 Application program is just a user-process. Due to security reasons , user
applications are not given access to privileged resources(the ones
controlled by OS).
 When they need to do any I/O or have some more memory or spawn a
process or wait for signal/interrupt, it requests operating system to
facilitate all these. This request is made through System Call.
 System calls are also called software-interrupts.
System Calls
System Calls
• System calls provide the interface between a running program and
the operating system.
• In general, system calls are available as assembly language
instructions.
• System calls are usually made when a process in user mode
requires access to a resource.
• Then it requests the kernel to provide the resource via a system
call.
Types of Operating System (OS)

• Batch Operating System


• Multitasking/Time Sharing OS
• Multiprocessing OS
• Real Time OS
• Distributed OS
• Network OS
• Mobile OS
• Batch Operating System
Some computer processes are very lengthy
and time-consuming. To speed the same
process, a job with a similar type of needs are
batched together and run as a group.
• Multi-Tasking/Time-sharing Operating
systems
Time-sharing operating system enables people
located at a different terminal(shell) to use a
single computer system at the same time.
• Real time OS
A real time operating system time interval to
process and respond to inputs is very small.
Examples: Military Software Systems, Space
Software Systems are the Real time OS
example.
• Distributed Operating System
Distributed systems use many processors
located in different machines to provide very
fast computation to its users.
• Network Operating System
Network Operating System runs on a server. It
provides the capability to serve to manage
data, user, groups, security, application, and
other networking functions.
• Mobile OS
Mobile operating systems are those OS which
is especially that are designed to power
smartphones, tablets, and wearables devices.
What are OS Components?

• What are OS Components?


An operating system is a large and complex
system that can only be created by
partitioning into small pieces.
Common Operating-System Components

• Process Management
• Main Memory Management
• File Management
• I/O System Management
• Secondary Management
• Protection System
Process Management
 A process is a program in execution.
 A process needs certain resources, including CPU time,
memory, files, and I/O devices, to accomplish its task.
 The operating system is responsible for the following
activities in connection with process management.
 Process creation and deletion.
 process suspension and resumption.
 Provision of mechanisms for:
 • process synchronization
 • process communication
.
Main Memory Management
• Memory is a large array of words or bytes, each with its own
address.
• It is a repository of quickly accessible data shared by the CPU and
I/O devices.
• Main memory is a volatile storage device. It loses its contents in
the case of system failure.
• The operating system is responsible for the following activities in
connections with memory management:
 Keep track of which parts of memory are currently being used and
by whom.
 Decide which processes to load when memory space becomes
available.
 Allocate and deallocate memory space as needed
File Management
• A file is a collection of related information defined by its
creator.
• Commonly, files represent programs (both source and
object forms) and data.
• The operating system is responsible for the following
activities in connections with file management:
 File creation and deletion.
 Directory creation and deletion.
 Support of primitives for manipulating files and directories.
 Mapping files onto secondary storage.
 File backup on stable (nonvolatile) storage media.
I/O Device Management

• The I/O system consists of:


 A buffer-caching system
 A general device-driver interface
 Drivers for specific hardware devices
Secondary-Storage Management
• Since main memory (primary storage) is volatile and too
small to accommodate all data and programs permanently,
the computer system must provide secondary storage to
back up main memory.
• Most modern computer systems use disks as the principle
on-line storage medium, for both programs and data.
• The operating system is responsible for the following
activities in connection with disk management:
 Free space management
 Storage allocation
 Disk scheduling
Protection System
• Protection refers to a mechanism for controlling
access by programs, processes, or users to both
system and user resources.
• The various processes in an operating system need to
be secured from each other's activities.
• For that purpose, various mechanisms can be used to
ensure that those processes which want to operate
files, memory CPU, and other hardware resources
should have proper authorization from the operating
system.
Operating System Services
• Program execution – system capability to load a program into
memory and to run it.
• I/O operations – since user programs cannot execute I/O
operations directly, the operating system must provide some
means to perform I/O.
• File-system manipulation – program capability to read, write,
create, and delete files.
• Communications – exchange of information between processes
executing either on the same computer or on different systems
tied together by a network.
• Implemented via shared memory or message passing.
• Error detection – ensure correct computing by detecting errors
in the CPU and memory hardware, in I/O devices, or in user
programs.
Additional Operating System Functions
• Additional functions exist not for helping the user,
but rather for ensuring efficient system operations.
 Resource allocation – allocating resources to multiple
users or multiple jobs running at the same time.
 Accounting – keep track of and record which users
use how much and what kinds of computer resources
for account billing or for accumulating usage
statistics.
 Protection – ensuring that all access to system
resources is controlled.
System Program
• System Program provides a convenient
environment for program development and
program execution.
• Some of them are simply user interface to
system calls.
• Other are considerably more complex
• System programs can be divided into following
categories
File Management
 Create
 Delete
 Copy
 Rename
 Print
 list
Status information
 Date, time
 Amount of available memory or disc space
 Number of users
 Detailed performance
 Logging and debugging information
• Programming language support
 Compiler
 Assembler
 Debugger
 Interpreter
• Program loading and execution- once program
is assembled or compiled , it must be loaded
into memory to be execution
 Absolute loader
 Relocatable loader
 Linkage editor
 Overlay loader
• Communication- these programs provide the
mechanism for
 Creating virtual connections among
processes, users and computer system
 Allowing users to send messege to another
screen
 To browse webpage
 To send electronic mail messege
System Structure
• An operating system is construct that allows
the user application programs to interact with
the system hardware.
• Since the operating system is such a complex
structure, it should be created with atmost
care so it can be used and modified easily.
• Simple Structure
• Layered Structure
• Microkernel Structure
• Modular structure
Simple Structure
• Such operating system do not have well defined
structure and are small,simple and limited system.
• The interface and levels of functionality are not
well seperated.
• Ex. MS-DOS
• In MS-DOS application programs are able to
access the basic I/O routines.
• These type of OS cause the entire system to crash
if one of the user program fails.
Layered Structure
• The OS is broken into number of layers
• Bottom layer (layer 0) is the hardware and topmost
(layer n) is the user interface
• Each layer uses the function of lower level layer only.
• This simplifies the debugging process
• The main disadvantage is that at each layer the data
needs to be modified and passed on which adds
overhead to the system.
• Careful planning is necessary as the layer can use
only lower level layers.
• Ex. Unix
Kernel Structure
• A kernel structure is the control module of an
operating system.
• it loads first and remains in the memory.
• it lies netween system programs and hardware.
• it is also known as command line interpreters.
• main function of Kernel are
 it provide mechanism for creation and deletion of
processes
 it provide CPU scheduling, memory management
and I/o management.
 it provides mechanism for inter process
communication.
Virtual Machine
• A virtual machine is an execution of a computer
system within our physical personal computer.
• A virtual machine allows users to install and run
multiple operating systems in a single PC there by
making an illusion that each separate execution
environment is running its own private computer.
• Resources of computer system are shared to each
OS running by virtual machine.
Advantages:
• There are no protection problems because
each virtual machine is completely isolated
from all other virtual machines.
• Virtual machine can provide an instruction set
architecture that differs from real computers.
• Easy maintenance, availability and convenient
recovery.
Disadvantages:
• When multiple virtual machines are
simultaneously running on a host computer,
one virtual machine can be affected by other
running virtual machines, depending on the
workload.
• Virtual machines are not as efficient as a real
one when accessing the hardware.
System Design & Implementation
• An operating system is a construct that allows the
user application programs to interact with the
system hardware.
• Operating system by itself does not provide any
function but it provides an atmosphere in which
different applications and programs can do useful
work.
• There are many problems that can occur while
designing and implementing an operating system.
Operating System Design Goals

• It is quite complicated to define all the goals


and specifications of the operating system
while designing it.
• The design changes depending on the type of
the operating system i.e. if it is batch system,
time shared system
Types of goals while designing an operating
System

• User Goals-The operating system should be


convenient, easy to use, reliable, safe and fast
according to the users.
• System Goals-The operating system should be
easy to design, implement and maintain.
These are specifications required by those
who create, maintain and operate the
operating system.
Operating System Mechanisms and Policies
• There is no specific way to design an operating
system as it is a highly creative task.
• There are general software principles that are
applicable to all operating systems.
• mechanism shows how to do something
• policy shows what to do.
• Policies may change over time and this would
lead to changes in mechanism.
• So, it is better to have a general mechanism
that would require few changes even when a
policy change occurs.
Operating System Implementation
• The operating system needs to implemented after it
is designed.
• At first, operating systems were written in assembly,
but now C/C++ is the language commonly used
• Small blocks of assembly code are still needed,
especially related to some low level I/O functions in
device drivers, turning interrupts on and off and etc.
• Using higher level languages allows the code to be
written faster.
• It also makes the OS much easier to port to
different hardware platforms.
Thank You

You might also like