SlideShare a Scribd company logo
Operating Systems
(R1631055)
by
Mrs. T.Satya Kumari
Assistant Professor
Department of CSE
Aditya College of Engineering
Approved by AICTE, Accredited by NAAC
and Permanently affiliated to JNTUK, Kakinada
1
Department of CSE, Aditya College of Engineering, Surampalem
UNIT-I
Introduction to Operating System Concept
 Types of operating system
 Operating system concepts
 Operating system services
 Introduction to system call
 System call types
Department of CSE, Aditya College of Engineering, Surampalem 2
What is an Operating System?
 An operating system is a program that manages the
computer hardware.
 A program that acts as an intermediary 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
Department of CSE, Aditya College of Engineering, Surampalem 3
Operating System Definition
 OS is a resource allocator
 Manages all resources
 Decides between conflicting requests for efficient and fair
resource use
 OS is a control program
 Controls execution of programs to prevent errors and improper
use of the computer
 No universally accepted definition
 “The one program running at all times on the computer” is the
kernel. Everything else is either a system program (ships with the
operating system) or an application program
Department of CSE, Aditya College of Engineering, Surampalem
4
Computer System Structure
 Computer system can be divided into four components
 Hardware – provides basic computing resources
 CPU, memory, I/O devices
 Operating system
 Controls and coordinates use of hardware among various
applications and users
 Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
 Word processors, compilers, web browsers, database systems,
video games
 Users
 People, machines, other computers
Department of CSE, Aditya College of Engineering, Surampalem 5
Four Components of a Computer System
Department of CSE, Aditya College of Engineering, Surampalem 6
Computer System Organization
 Computer-system operation
 I/O Structure
 Storage structure
Department of CSE, Aditya College of Engineering, Surampalem 7
Computer System Organization
 Computer-system operation
 One or more CPUs, device controllers connect through common bus providing access to
shared memory
 Concurrent execution of CPUs and device controllers competing for memory cycles
Department of CSE, Aditya College of Engineering, Surampalem 8
Computer Startup
 bootstrap program is loaded at power-up or reboot
 Typically stored in ROM or EEPROM, generally known as
firmware
 Initializes all aspects of system
 Loads operating system kernel and starts execution
 The operating system then starts executing the first process,
such as "init," and waits for some event to occur.
Department of CSE, Aditya College of Engineering, Surampalem 9
Computer-system operation (cont.)
 occurrence of an event is signaled by an interrupt
from either the hardware or the software.
 Hardware may trigger an interrupt at any time by
sending a signal to the CPU, usually by way of the
system bus.
 Software may trigger an interrupt by executing a
special operation called a system call (also called a
monitor call).
Department of CSE, Aditya College of Engineering, Surampalem 10
Common Functions of Interrupts
 When the CPU is interrupted, it stops what it is doing
and immediately transfers execution to a fixed
location.
 The fixed location usually contains the starting
address where the service routine for the interrupt is
located.
 The interrupt service routine executes;
 on completion, the CPU resumes the interrupted
computation.
Department of CSE, Aditya College of Engineering, Surampalem 11
Common Functions of Interrupts
 Interrupt transfers control to the interrupt service routine
generally, through the interrupt vector, which contains the
addresses of all the service routines.
 Interrupt architecture must save the address of the interrupted
instruction.
 Incoming interrupts are disabled while another interrupt is being
processed to prevent a lost interrupt.
 A trap is a software-generated interrupt caused either by an error
or a user request.
 An operating system is interrupt driven.
Department of CSE, Aditya College of Engineering, Surampalem 12
Interrupt Handling
 The os preserves the state of the CPU by storing
registers and the program counter.
 After the interrupt is serviced, the saved return
address is loaded into the program counter
 And the interrupted computation resumes as
though the interrupt had not occurred.
Department of CSE, Aditya College of Engineering, Surampalem 13
Department of CSE, Aditya College of Engineering, Surampalem 14
Interrupt Timeline
Department of CSE, Aditya College of Engineering, Surampalem 15
I/O Structure
 A general-purpose computer system consists of CPUs and
multiple device controllers that are connected through a
common bus.
 Each device controller is in charge of a specific type of
device.
 Depending on the controller, there may be more than
one attached device.
For instance, seven or more devices can be attached
to the small computer-systems interface (SCSI) controller.
Department of CSE, Aditya College of Engineering, Surampalem 16
I/O Structure
 Device controller maintains some local buffer storage
and a set of special-purpose registers.
 Device controller is responsible for moving the data
between the peripheral devices that it controls and its
local buffer storage.
 Typically, operating systems have a device driver for
each device controller.
 Device driver understands the device controller and
presents a uniform interface to the device to the rest of
the operating system.
Department of CSE, Aditya College of Engineering, Surampalem 17
I/O Structure
 To start an I/O operation, device driver loads appropriate registers
within device controller.
 Device controller examines contents of the registers to determine
what action to take (such as "read a character from the keyboard").
 The controller starts transfer of data from device to its local buffer.
 Once transfer of data is complete, device controller informs the
device driver via an interrupt.
 Then device driver returns control to the operating system, possibly
returning the data or a pointer to the data if the operation was a
read.
 For other operations, the device driver returns status information.
Department of CSE, Aditya College of Engineering, Surampalem 18
Device-Status Table
Department of CSE, Aditya College of Engineering, Surampalem 19
Direct Memory Access Structure
 Used for high-speed I/O devices able to transmit information at
close to memory speeds
 Device controller transfers blocks of data from buffer storage
directly to main memory without CPU intervention
 Only one interrupt is generated per block, rather than the one
interrupt per byte
Department of CSE, Aditya College of Engineering, Surampalem 20
Department of CSE, Aditya College of Engineering, Surampalem 21
Storage Structure
 Main memory – only large storage media that the CPU can access directly
 Secondary storage – extension of main memory that provides large
nonvolatile storage capacity
 Magnetic disks – rigid metal or glass platters covered with magnetic
recording material
 Disk surface is logically divided into tracks, which are subdivided into sectors
 The disk controller determines the logical interaction between the device and
the computer
Department of CSE, Aditya College of Engineering, Surampalem 22
Storage Hierarchy
 Storage systems organized in hierarchy
 Speed
 Cost
 Volatility
 Caching – copying information into faster storage system; main memory
can be viewed as a last cache for secondary storage
Department of CSE, Aditya College of Engineering, Surampalem 23
Caching
 Important principle, performed at many levels in a computer
(in hardware, operating system, software)
 Information in use copied from slower to faster storage
temporarily
 Faster storage (cache) checked first to determine if
information is there
 If it is, information used directly from the cache (fast)
 If not, data copied to cache and used there
 Cache smaller than storage being cached
 Cache management important design problem
 Cache size and replacement policy
Department of CSE, Aditya College of Engineering, Surampalem 24
Performance of Various Levels of Storage
 Movement between levels of storage hierarchy can be explicit or
implicit
Department of CSE, Aditya College of Engineering, Surampalem 25
Operating System Structure
 Multi Programmed Systems
 Time Sharing Systems
Multiprogramming needed for efficiency
 Single user cannot keep CPU and I/O devices busy at all
times
 Multiprogramming organizes jobs (code and data) so CPU
always has one to execute
 A subset of total jobs in system is kept in memory
 One job selected and run via job scheduling
 When it has to wait (for I/O for example), OS switches to
another job
Department of CSE, Aditya College of Engineering, Surampalem 26
Memory Layout for Multiprogrammed System
Department of CSE, Aditya College of Engineering, Surampalem 27
Operating System Structure
 Timesharing (multitasking) is logical extension in which CPU
switches jobs so frequently that users can interact with each
job while it is running, creating interactive computing
 Response time should be < 1 second
 Each user has at least one program executing in memory
process
 If several jobs ready to run at the same time  CPU
scheduling
 If processes don’t fit in memory, swapping moves them in
and out to run
 Virtual memory allows execution of processes not
completely in memory
Department of CSE, Aditya College of Engineering, Surampalem 28
Operating System Structure
 Timesharing (multitasking)
Department of CSE, Aditya College of Engineering, Surampalem 29
Operating-System Operations
 Interrupt driven by hardware
 Software error or request creates exception or trap
 Division by zero, request for operating system service
 Other process problems include infinite loop, processes
modifying each other or the operating system
Department of CSE, Aditya College of Engineering, Surampalem 30
Operating-System Operations
 Dual-mode operation allows OS to protect itself and other system
components
 User mode and kernel mode
 Mode bit provided by hardware
Provides ability to distinguish when system is running user
code or kernel code
Some instructions designated as privileged, only executable
in kernel mode
System call changes mode to kernel, return from call resets it
to user
Department of CSE, Aditya College of Engineering, Surampalem 31
Transition from User to Kernel Mode
 Timer to prevent infinite loop / process hogging resources
 Set interrupt after specific period
 Operating system decrements counter
 When counter zero generate an interrupt
 Set up before scheduling process to regain control or terminate program that
exceeds allotted time
Department of CSE, Aditya College of Engineering, Surampalem 32
Functions of operating system
 Process Management
 Memory Management
 Storage Management
 Protection and Security
Department of CSE, Aditya College of Engineering, Surampalem 33
Process Management
A process is a program in execution. It is a unit of work within the
system. Program is a passive entity, process is an active entity.
 Process needs resources to accomplish its task
 CPU, memory, I/O, files
 Initialization data
 Process termination requires reclaim of any reusable resources
Department of CSE, Aditya College of Engineering, Surampalem 34
Process Management
 Single-threaded process has one program counter specifying
location of next instruction to execute
 Process executes instructions sequentially, one at a time,
until completion
 Multi-threaded process has one program counter per thread
 Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
 Concurrency by multiplexing the CPUs among the processes /
threads
Department of CSE, Aditya College of Engineering, Surampalem 35
Process Management Activities
The operating system is responsible for the following
activities in connection with process management:
 Creating and deleting both user and system processes
 Suspending and resuming processes
 Providing mechanisms for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling
Department of CSE, Aditya College of Engineering, Surampalem 36
Memory Management
 All data in memory before and after processing
 All instructions in memory in order to execute
 Memory management determines what is in memory
 Optimizing CPU utilization and computer response to users
 Memory management activities
 Keeping track of which parts of memory are currently being
used and by whom
 Deciding which processes (or parts thereof) and data to
move into and out of memory
 Allocating and deallocating memory space as needed
Department of CSE, Aditya College of Engineering, Surampalem 37
Storage Management
 OS provides uniform, logical view of information storage
 Abstracts physical properties to logical storage unit - file
 Each medium is controlled by device (i.e., disk drive, tape drive)
Varying properties include access speed, capacity, data-
transfer rate, access method (sequential or random)
 File-System management
 Files usually organized into directories
 Access control on most systems to determine who can access
what
 OS activities include
 Creating and deleting files and directories
 Primitives to manipulate files and dirs
 Mapping files onto secondary storage
 Backup files onto stable (non-volatile) storage media
Department of CSE, Aditya College of Engineering, Surampalem 38
Mass-Storage Management
 Usually disks used to store data that does not fit in main memory or data
that must be kept for a “long” period of time
 Proper management is of central importance
 Entire speed of computer operation hinges on disk subsystem and its
algorithms
 OS activities
 Free-space management
 Storage allocation
 Disk scheduling
 Some storage need not be fast
 Tertiary storage includes optical storage, magnetic tape
 Still must be managed
 Varies between WORM (write-once, read-many-times) and RW (read-
write)
Department of CSE, Aditya College of Engineering, Surampalem 39
Performance of Various Levels of Storage
 Movement between levels of storage hierarchy can be explicit or implicit
Department of CSE, Aditya College of Engineering, Surampalem 40
Storage Management
 Caching
 I/O systems
Department of CSE, Aditya College of Engineering, Surampalem 41
Protection and Security
 Protection – any mechanism for controlling
access of processes or users to resources
defined by the OS
 Security – defense of the system against
internal and external attacks
Huge range, including denial-of-service,
worms, viruses, identity theft, theft of
service
Department of CSE, Aditya College of Engineering, Surampalem 42
Protection and Security
 Systems generally first distinguish among users, to
determine who can do what
User identities (user IDs, security IDs) include
name and associated number, one per user
User ID then associated with all files, processes of
that user to determine access control
Group identifier (group ID) allows set of users to
be defined and controls managed, then also
associated with each process, file
Privilege escalation allows user to change to
effective ID with more rights
Department of CSE, Aditya College of Engineering, Surampalem 43
Types of Operating Systems
 Simple Batch Systems(Batch operating system)
 Time-Sharing Operating Systems(Multi-tasking)
 Distributed Systems
Network Operating Systems
 Special-Purpose Systems
Real-Time Embedded Systems
Multimedia Systems
Handheld Systems
Department of CSE, Aditya College of Engineering, Surampalem 44
Types of Operating Systems
 Simple Batch Systems(Batch operating system)
 In this type of system, there is no direct interaction
between user and the computer.
 The user has to submit a job (written on cards or tape)
to a computer operator.
 Then computer operator places a batch of several jobs
on an input device.
 Jobs are batched together by type of languages and
requirement.
 Then a special program, the monitor, manages the
execution of each program in the batch.
 The monitor is always in the main memory and
available for execution.
Department of CSE, Aditya College of Engineering, Surampalem 45
Simple Batch Systems(Batch operating system)
(cond.)
Department of CSE, Aditya College of Engineering, Surampalem 46
The disadvantages with Batch Systems are as
follows −
 Lack of interaction between the user and
the job.
 CPU is often idle, because the speed of the
mechanical I/O devices is slower than the
CPU.
 Difficult to provide the desired priority.
Time-Sharing Operating Systems(Multi-tasking)
 Each task is given some time to execute, so that all the tasks
work smoothly.
 Each user gets time of CPU as they use single system.
 These systems are also known as Multitasking Systems.
 The task can be from single user or from different users also.
 The time that each task gets to execute is called quantum.
 After this time interval is over OS switches over to next task.
Advantages of Time-Sharing OS:
 Each task gets an equal opportunity
 Less chances of duplication of software
 CPU idle time can be reduced
Department of CSE, Aditya College of Engineering, Surampalem 47
Distributed Systems
 A distributed system is a collection of physically
separate, possibly heterogeneous computer
systems that are networked to provide the users
with access to the various resources that the
system maintains.
 Access to a shared resource increases
computation speed, functionality, data
availability, and reliability.
Department of CSE, Aditya College of Engineering, Surampalem 48
Distributed Systems
Advantages of Distributed Operating System:
 Failure of one will not affect the other network
communication, as all systems are independent
from each other.
 Electronic mail increases the data exchange
speed
 Since resources are being shared, computation is
highly fast and durable.
 Load on host computer reduces
 These systems are easily scalable as many
systems can be easily added to the network.
Delay in data processing reduces.
Department of CSE, Aditya College of Engineering, Surampalem 49
Network operating system
 An operating system that provides features such as file
sharing across the network and includes a communication
scheme that allows different processes on different
computers to exchange messages.
 A computer running a network operating system acts
autonomously from all other computers on the network.
Advantages:
 Centralized servers are highly stable.
 Security is server managed.
 Upgrades to new technologies and hardware can be easily
integrated into the system.
 Remote access to servers is possible from different
locations and types of systems.
Department of CSE, Aditya College of Engineering, Surampalem 50
Special-Purpose Systems
 Real-Time Embedded Systems
Embedded computers are the most prevalent form of
computers in existence. These devices are found
everywhere, from car engines and manufacturing robots
to VCRs and microwave ovens. They tend to have very
specific tasks.
Embedded systems almost always run real-time
operating systems. A real time operating system time
interval to process and respond to inputs is very small.
Examples: Military Software Systems, Space Software
Systems.
Department of CSE, Aditya College of Engineering, Surampalem 51
Real-Time Embedded Systems
 A real-time system has well-defined, fixed time
constraints. Processing must be done within the
defined constraints, or the system will fail.
 For instance, it would not do for a robot arm to
be instructed to halt after it had smashed into
the car it was building.
 A real-time system functions correctly only if it
returns the correct result within its time
constraints.
 Two types
Hard real time and soft real time
Department of CSE, Aditya College of Engineering, Surampalem 52
Multimedia Systems
 Multimedia data consist of audio and video files
as well as conventional files. These data differ
from conventional data in that multimedia data—
such as frames of video—must be delivered
(streamed) according to certain time restrictions
 Multimedia describes a wide range of
applications that are in popular use today. These
include audio files such as MP3 DVD movies, video
conferencing, and short video clips of movie
previews or news stories downloaded over the
Internet.
Department of CSE, Aditya College of Engineering, Surampalem 53
Handheld systems
 Handheld systems include personal digital
assistants (PDAs), such as Palm and Pocket-PCs,
and cellular telephones, many of which use
special-purpose embedded operating systems.
 Many handheld devices have between 512
KB and 8 MB of memory. As a result, the
operating system and applications must manage
memory efficiently. This includes returning all
allocated memory back to the memory manager
once the memory is no longer being used.
Department of CSE, Aditya College of Engineering, Surampalem 54
Handheld systems
 Currently, many handheld devices do not use virtual
memory techniques, thus forcing program developers to
work within the confines of limited physical memory.
 Processors for most handheld devices often run at a fraction
of the speed of a processor in a PC. Faster processors
require more power. To include a faster processor in a
handheld device would require a larger battery that would
have to be replaced more frequently.
 The last issue confronting program designers for handheld
devices is the small display screens typically available. One
approach for displaying the content in web pages is web
clipping, where only a small subset of a web page is
delivered and displayed on the handheld device.
Department of CSE, Aditya College of Engineering, Surampalem 55
Operating System Services
 One set of operating-system services provides functions that
are helpful to the user:
 User interface - Almost all operating systems have a user
interface (UI)
 Varies between Command-Line (CLI), Graphics User Interface (GUI),
Batch
 Program execution - The system must be able to load a
program into memory and to run that program, end
execution, either normally or abnormally (indicating error)
Department of CSE, Aditya College of Engineering, Surampalem 56
Operating System Services
 I/O operations - A running program may require I/O, which
may involve a file or an I/O device
 File-system manipulation - The file system is of particular
interest. Obviously, programs need to read and write files
and directories, create and delete them, search them, list
file Information, permission management.
Department of CSE, Aditya College of Engineering, Surampalem 57
Operating System Services
 One set of operating-system services provides functions that are
helpful to the user (Cont):
 Communications – Processes may exchange information, on the
same computer or between computers over a network
 Communications may be via shared memory or through message
passing (packets moved by the OS)
 Error detection – OS needs to be constantly aware of possible
errors
 May occur in the CPU and memory hardware, in I/O devices, in
user program
 For each type of error, OS should take the appropriate action to
ensure correct and consistent computing
 Debugging facilities can greatly enhance the user’s and
programmer’s abilities to efficiently use the system
Department of CSE, Aditya College of Engineering, Surampalem 58
A View of Operating System Services
Department of CSE, Aditya College of Engineering, Surampalem 59
Operating System Services
 Another set of OS functions exists for ensuring the
efficient operation of the system itself via resource
sharing
 Resource allocation - When multiple users or
multiple jobs running concurrently, resources
must be allocated to each of them
Many types of resources - Some (such as CPU
cycles, main memory, and file storage) may
have special allocation code, others (such as
I/O devices) may have general request and
release code
 Accounting - To keep track of which users use
how much and what kinds of computer resources
Department of CSE, Aditya College of Engineering, Surampalem 60
Operating System Services
 Protection and security - The owners of
information stored in a multiuser or networked
computer system may want to control use of that
information, concurrent processes should not
interfere with each other
Protection involves ensuring that all access to
system resources is controlled
Security of the system from outsiders requires
user authentication, extends to defending
external I/O devices from invalid access attempts
If a system is to be protected and secure,
precautions must be instituted throughout it. A
chain is only as strong as its weakest link.
Department of CSE, Aditya College of Engineering, Surampalem 61
System Calls
 Programming interface to the services provided by the OS
 Typically written in a high-level language (C or C++)
 Mostly accessed by programs via a high-level Application Program
Interface (API) rather than direct system call use
 Three most common APIs are Win32 API for Windows, POSIX API for
POSIX-based systems (including virtually all versions of UNIX,
Linux, and Mac OS X), and Java API for the Java virtual machine
(JVM)
 Why use APIs rather than system calls?
(Note that the system-call names used throughout this text are
generic)
Department of CSE, Aditya College of Engineering, Surampalem 62
Example of System Calls
 System call sequence to copy the contents of one file to another file
Department of CSE, Aditya College of Engineering, Surampalem 63
Example of Standard API
 Consider the ReadFile() function in the
 Win32 API—a function for reading from a file
A description of the parameters passed to ReadFile()
 HANDLE file—the file to be read
 LPVOID buffer—a buffer where the data will be read into and written from
 DWORD bytesToRead—the number of bytes to be read into the buffer
 LPDWORD bytesRead—the number of bytes read during the last read
 LPOVERLAPPED ovl—indicates if overlapped I/O is being used
Department of CSE, Aditya College of Engineering, Surampalem 64
System Call Implementation
 Typically, a number associated with each system call
 System-call interface maintains a table indexed according to
these numbers
 The system call interface invokes intended system call in OS kernel
and returns status of the system call and any return values
 The caller need know nothing about how the system call is
implemented
 Just needs to obey API and understand what OS will do as a
result call
 Most details of OS interface hidden from programmer by API
Managed by run-time support library (set of functions built
into libraries included with compiler)
Department of CSE, Aditya College of Engineering, Surampalem 65
API – System Call – OS Relationship
Department of CSE, Aditya College of Engineering, Surampalem 66
Standard C Library Example
 C program invoking printf() library call, which calls write() system call
Department of CSE, Aditya College of Engineering, Surampalem 67
System Call Parameter Passing
 Often, more information is required than simply identity of desired
system call
 Exact type and amount of information vary according to OS and
call
 Three general methods used to pass parameters to the OS
 Simplest: pass the parameters in registers
 In some cases, may be more parameters than registers
 Parameters stored in a block, or table, in memory, and address
of block passed as a parameter in a register
This approach taken by Linux and Solaris
 Parameters placed, or pushed, onto the stack by the program
and popped off the stack by the operating system
 Block and stack methods do not limit the number or length of
parameters being passed
Department of CSE, Aditya College of Engineering, Surampalem 68
Parameter Passing via Table
Department of CSE, Aditya College of Engineering, Surampalem 69
Types of System Calls
 Process control
 File management
 Device management
 Information maintenance
 Communications
 Protection
Department of CSE, Aditya College of Engineering, Surampalem 70
Examples of Windows and Unix System Calls
Department of CSE, Aditya College of Engineering, Surampalem 71

More Related Content

Similar to OS UNIT-I Introdution to Operating systems.ppt

operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
JyoReddy9
 
Operating system
Operating systemOperating system
Operating system
mak120
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
Kathirvel Ayyaswamy
 
LM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system callsLM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system calls
manideepakc
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
Mukesh Chinta
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTES
KopinathMURUGESAN
 
Module1
Module1Module1
Module1
dilshad begum
 
os mod1 notes
 os mod1 notes os mod1 notes
os mod1 notes
SRINIVASUNIVERSITYEN
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
Ajit Nayak
 
Lecture_01 Operating System Course Introduction
Lecture_01 Operating System Course IntroductionLecture_01 Operating System Course Introduction
Lecture_01 Operating System Course Introduction
ArnoyKhan
 
OSLec1&2.ppt
OSLec1&2.pptOSLec1&2.ppt
OSLec1&2.ppt
ssusere16bd9
 
Mca ii os u-1 introduction to os
Mca  ii  os u-1 introduction to osMca  ii  os u-1 introduction to os
Mca ii os u-1 introduction to os
Rai University
 
CH01.pdf
CH01.pdfCH01.pdf
CH01.pdf
ImranKhan880955
 
OS Intro.ppt
OS Intro.pptOS Intro.ppt
OS Intro.ppt
ssuserd97416
 
SYCS OS PPT INTRODUCTION LECTURE-01.pdf
SYCS OS PPT INTRODUCTION LECTURE-01.pdfSYCS OS PPT INTRODUCTION LECTURE-01.pdf
SYCS OS PPT INTRODUCTION LECTURE-01.pdf
Abhinov Shukla
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
Sohaib Danish
 
Real Time Operating System ,Structures of Operating System (Monolithic, Micro...
Real Time Operating System ,Structures of Operating System(Monolithic, Micro...Real Time Operating System ,Structures of Operating System(Monolithic, Micro...
Real Time Operating System ,Structures of Operating System (Monolithic, Micro...
VIJETHAK2
 
ch1.ppt
ch1.pptch1.ppt
Ch1
Ch1Ch1
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
Dr Sandeep Kumar Poonia
 

Similar to OS UNIT-I Introdution to Operating systems.ppt (20)

operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
 
Operating system
Operating systemOperating system
Operating system
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
 
LM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system callsLM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system calls
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTES
 
Module1
Module1Module1
Module1
 
os mod1 notes
 os mod1 notes os mod1 notes
os mod1 notes
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
 
Lecture_01 Operating System Course Introduction
Lecture_01 Operating System Course IntroductionLecture_01 Operating System Course Introduction
Lecture_01 Operating System Course Introduction
 
OSLec1&2.ppt
OSLec1&2.pptOSLec1&2.ppt
OSLec1&2.ppt
 
Mca ii os u-1 introduction to os
Mca  ii  os u-1 introduction to osMca  ii  os u-1 introduction to os
Mca ii os u-1 introduction to os
 
CH01.pdf
CH01.pdfCH01.pdf
CH01.pdf
 
OS Intro.ppt
OS Intro.pptOS Intro.ppt
OS Intro.ppt
 
SYCS OS PPT INTRODUCTION LECTURE-01.pdf
SYCS OS PPT INTRODUCTION LECTURE-01.pdfSYCS OS PPT INTRODUCTION LECTURE-01.pdf
SYCS OS PPT INTRODUCTION LECTURE-01.pdf
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
 
Real Time Operating System ,Structures of Operating System (Monolithic, Micro...
Real Time Operating System ,Structures of Operating System(Monolithic, Micro...Real Time Operating System ,Structures of Operating System(Monolithic, Micro...
Real Time Operating System ,Structures of Operating System (Monolithic, Micro...
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Ch1
Ch1Ch1
Ch1
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 

Recently uploaded

An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
ramrag33
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 

Recently uploaded (20)

An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 

OS UNIT-I Introdution to Operating systems.ppt

  • 1. Operating Systems (R1631055) by Mrs. T.Satya Kumari Assistant Professor Department of CSE Aditya College of Engineering Approved by AICTE, Accredited by NAAC and Permanently affiliated to JNTUK, Kakinada 1 Department of CSE, Aditya College of Engineering, Surampalem
  • 2. UNIT-I Introduction to Operating System Concept  Types of operating system  Operating system concepts  Operating system services  Introduction to system call  System call types Department of CSE, Aditya College of Engineering, Surampalem 2
  • 3. What is an Operating System?  An operating system is a program that manages the computer hardware.  A program that acts as an intermediary 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 Department of CSE, Aditya College of Engineering, Surampalem 3
  • 4. Operating System Definition  OS is a resource allocator  Manages all resources  Decides between conflicting requests for efficient and fair resource use  OS is a control program  Controls execution of programs to prevent errors and improper use of the computer  No universally accepted definition  “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program Department of CSE, Aditya College of Engineering, Surampalem 4
  • 5. Computer System Structure  Computer system can be divided into four components  Hardware – provides basic computing resources  CPU, memory, I/O devices  Operating system  Controls and coordinates use of hardware among various applications and users  Application programs – define the ways in which the system resources are used to solve the computing problems of the users  Word processors, compilers, web browsers, database systems, video games  Users  People, machines, other computers Department of CSE, Aditya College of Engineering, Surampalem 5
  • 6. Four Components of a Computer System Department of CSE, Aditya College of Engineering, Surampalem 6
  • 7. Computer System Organization  Computer-system operation  I/O Structure  Storage structure Department of CSE, Aditya College of Engineering, Surampalem 7
  • 8. Computer System Organization  Computer-system operation  One or more CPUs, device controllers connect through common bus providing access to shared memory  Concurrent execution of CPUs and device controllers competing for memory cycles Department of CSE, Aditya College of Engineering, Surampalem 8
  • 9. Computer Startup  bootstrap program is loaded at power-up or reboot  Typically stored in ROM or EEPROM, generally known as firmware  Initializes all aspects of system  Loads operating system kernel and starts execution  The operating system then starts executing the first process, such as "init," and waits for some event to occur. Department of CSE, Aditya College of Engineering, Surampalem 9
  • 10. Computer-system operation (cont.)  occurrence of an event is signaled by an interrupt from either the hardware or the software.  Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.  Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call). Department of CSE, Aditya College of Engineering, Surampalem 10
  • 11. Common Functions of Interrupts  When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location.  The fixed location usually contains the starting address where the service routine for the interrupt is located.  The interrupt service routine executes;  on completion, the CPU resumes the interrupted computation. Department of CSE, Aditya College of Engineering, Surampalem 11
  • 12. Common Functions of Interrupts  Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines.  Interrupt architecture must save the address of the interrupted instruction.  Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt.  A trap is a software-generated interrupt caused either by an error or a user request.  An operating system is interrupt driven. Department of CSE, Aditya College of Engineering, Surampalem 12
  • 13. Interrupt Handling  The os preserves the state of the CPU by storing registers and the program counter.  After the interrupt is serviced, the saved return address is loaded into the program counter  And the interrupted computation resumes as though the interrupt had not occurred. Department of CSE, Aditya College of Engineering, Surampalem 13
  • 14. Department of CSE, Aditya College of Engineering, Surampalem 14
  • 15. Interrupt Timeline Department of CSE, Aditya College of Engineering, Surampalem 15
  • 16. I/O Structure  A general-purpose computer system consists of CPUs and multiple device controllers that are connected through a common bus.  Each device controller is in charge of a specific type of device.  Depending on the controller, there may be more than one attached device. For instance, seven or more devices can be attached to the small computer-systems interface (SCSI) controller. Department of CSE, Aditya College of Engineering, Surampalem 16
  • 17. I/O Structure  Device controller maintains some local buffer storage and a set of special-purpose registers.  Device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.  Typically, operating systems have a device driver for each device controller.  Device driver understands the device controller and presents a uniform interface to the device to the rest of the operating system. Department of CSE, Aditya College of Engineering, Surampalem 17
  • 18. I/O Structure  To start an I/O operation, device driver loads appropriate registers within device controller.  Device controller examines contents of the registers to determine what action to take (such as "read a character from the keyboard").  The controller starts transfer of data from device to its local buffer.  Once transfer of data is complete, device controller informs the device driver via an interrupt.  Then device driver returns control to the operating system, possibly returning the data or a pointer to the data if the operation was a read.  For other operations, the device driver returns status information. Department of CSE, Aditya College of Engineering, Surampalem 18
  • 19. Device-Status Table Department of CSE, Aditya College of Engineering, Surampalem 19
  • 20. Direct Memory Access Structure  Used for high-speed I/O devices able to transmit information at close to memory speeds  Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention  Only one interrupt is generated per block, rather than the one interrupt per byte Department of CSE, Aditya College of Engineering, Surampalem 20
  • 21. Department of CSE, Aditya College of Engineering, Surampalem 21
  • 22. Storage Structure  Main memory – only large storage media that the CPU can access directly  Secondary storage – extension of main memory that provides large nonvolatile storage capacity  Magnetic disks – rigid metal or glass platters covered with magnetic recording material  Disk surface is logically divided into tracks, which are subdivided into sectors  The disk controller determines the logical interaction between the device and the computer Department of CSE, Aditya College of Engineering, Surampalem 22
  • 23. Storage Hierarchy  Storage systems organized in hierarchy  Speed  Cost  Volatility  Caching – copying information into faster storage system; main memory can be viewed as a last cache for secondary storage Department of CSE, Aditya College of Engineering, Surampalem 23
  • 24. Caching  Important principle, performed at many levels in a computer (in hardware, operating system, software)  Information in use copied from slower to faster storage temporarily  Faster storage (cache) checked first to determine if information is there  If it is, information used directly from the cache (fast)  If not, data copied to cache and used there  Cache smaller than storage being cached  Cache management important design problem  Cache size and replacement policy Department of CSE, Aditya College of Engineering, Surampalem 24
  • 25. Performance of Various Levels of Storage  Movement between levels of storage hierarchy can be explicit or implicit Department of CSE, Aditya College of Engineering, Surampalem 25
  • 26. Operating System Structure  Multi Programmed Systems  Time Sharing Systems Multiprogramming needed for efficiency  Single user cannot keep CPU and I/O devices busy at all times  Multiprogramming organizes jobs (code and data) so CPU always has one to execute  A subset of total jobs in system is kept in memory  One job selected and run via job scheduling  When it has to wait (for I/O for example), OS switches to another job Department of CSE, Aditya College of Engineering, Surampalem 26
  • 27. Memory Layout for Multiprogrammed System Department of CSE, Aditya College of Engineering, Surampalem 27
  • 28. Operating System Structure  Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing  Response time should be < 1 second  Each user has at least one program executing in memory process  If several jobs ready to run at the same time  CPU scheduling  If processes don’t fit in memory, swapping moves them in and out to run  Virtual memory allows execution of processes not completely in memory Department of CSE, Aditya College of Engineering, Surampalem 28
  • 29. Operating System Structure  Timesharing (multitasking) Department of CSE, Aditya College of Engineering, Surampalem 29
  • 30. Operating-System Operations  Interrupt driven by hardware  Software error or request creates exception or trap  Division by zero, request for operating system service  Other process problems include infinite loop, processes modifying each other or the operating system Department of CSE, Aditya College of Engineering, Surampalem 30
  • 31. Operating-System Operations  Dual-mode operation allows OS to protect itself and other system components  User mode and kernel mode  Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user Department of CSE, Aditya College of Engineering, Surampalem 31
  • 32. Transition from User to Kernel Mode  Timer to prevent infinite loop / process hogging resources  Set interrupt after specific period  Operating system decrements counter  When counter zero generate an interrupt  Set up before scheduling process to regain control or terminate program that exceeds allotted time Department of CSE, Aditya College of Engineering, Surampalem 32
  • 33. Functions of operating system  Process Management  Memory Management  Storage Management  Protection and Security Department of CSE, Aditya College of Engineering, Surampalem 33
  • 34. Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.  Process needs resources to accomplish its task  CPU, memory, I/O, files  Initialization data  Process termination requires reclaim of any reusable resources Department of CSE, Aditya College of Engineering, Surampalem 34
  • 35. Process Management  Single-threaded process has one program counter specifying location of next instruction to execute  Process executes instructions sequentially, one at a time, until completion  Multi-threaded process has one program counter per thread  Typically system has many processes, some user, some operating system running concurrently on one or more CPUs  Concurrency by multiplexing the CPUs among the processes / threads Department of CSE, Aditya College of Engineering, Surampalem 35
  • 36. Process Management Activities The operating system is responsible for the following activities in connection with process management:  Creating and deleting both user and system processes  Suspending and resuming processes  Providing mechanisms for process synchronization  Providing mechanisms for process communication  Providing mechanisms for deadlock handling Department of CSE, Aditya College of Engineering, Surampalem 36
  • 37. Memory Management  All data in memory before and after processing  All instructions in memory in order to execute  Memory management determines what is in memory  Optimizing CPU utilization and computer response to users  Memory management activities  Keeping track of which parts of memory are currently being used and by whom  Deciding which processes (or parts thereof) and data to move into and out of memory  Allocating and deallocating memory space as needed Department of CSE, Aditya College of Engineering, Surampalem 37
  • 38. Storage Management  OS provides uniform, logical view of information storage  Abstracts physical properties to logical storage unit - file  Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, data- transfer rate, access method (sequential or random)  File-System management  Files usually organized into directories  Access control on most systems to determine who can access what  OS activities include  Creating and deleting files and directories  Primitives to manipulate files and dirs  Mapping files onto secondary storage  Backup files onto stable (non-volatile) storage media Department of CSE, Aditya College of Engineering, Surampalem 38
  • 39. Mass-Storage Management  Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time  Proper management is of central importance  Entire speed of computer operation hinges on disk subsystem and its algorithms  OS activities  Free-space management  Storage allocation  Disk scheduling  Some storage need not be fast  Tertiary storage includes optical storage, magnetic tape  Still must be managed  Varies between WORM (write-once, read-many-times) and RW (read- write) Department of CSE, Aditya College of Engineering, Surampalem 39
  • 40. Performance of Various Levels of Storage  Movement between levels of storage hierarchy can be explicit or implicit Department of CSE, Aditya College of Engineering, Surampalem 40
  • 41. Storage Management  Caching  I/O systems Department of CSE, Aditya College of Engineering, Surampalem 41
  • 42. Protection and Security  Protection – any mechanism for controlling access of processes or users to resources defined by the OS  Security – defense of the system against internal and external attacks Huge range, including denial-of-service, worms, viruses, identity theft, theft of service Department of CSE, Aditya College of Engineering, Surampalem 42
  • 43. Protection and Security  Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file Privilege escalation allows user to change to effective ID with more rights Department of CSE, Aditya College of Engineering, Surampalem 43
  • 44. Types of Operating Systems  Simple Batch Systems(Batch operating system)  Time-Sharing Operating Systems(Multi-tasking)  Distributed Systems Network Operating Systems  Special-Purpose Systems Real-Time Embedded Systems Multimedia Systems Handheld Systems Department of CSE, Aditya College of Engineering, Surampalem 44
  • 45. Types of Operating Systems  Simple Batch Systems(Batch operating system)  In this type of system, there is no direct interaction between user and the computer.  The user has to submit a job (written on cards or tape) to a computer operator.  Then computer operator places a batch of several jobs on an input device.  Jobs are batched together by type of languages and requirement.  Then a special program, the monitor, manages the execution of each program in the batch.  The monitor is always in the main memory and available for execution. Department of CSE, Aditya College of Engineering, Surampalem 45
  • 46. Simple Batch Systems(Batch operating system) (cond.) Department of CSE, Aditya College of Engineering, Surampalem 46 The disadvantages with Batch Systems are as follows −  Lack of interaction between the user and the job.  CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU.  Difficult to provide the desired priority.
  • 47. Time-Sharing Operating Systems(Multi-tasking)  Each task is given some time to execute, so that all the tasks work smoothly.  Each user gets time of CPU as they use single system.  These systems are also known as Multitasking Systems.  The task can be from single user or from different users also.  The time that each task gets to execute is called quantum.  After this time interval is over OS switches over to next task. Advantages of Time-Sharing OS:  Each task gets an equal opportunity  Less chances of duplication of software  CPU idle time can be reduced Department of CSE, Aditya College of Engineering, Surampalem 47
  • 48. Distributed Systems  A distributed system is a collection of physically separate, possibly heterogeneous computer systems that are networked to provide the users with access to the various resources that the system maintains.  Access to a shared resource increases computation speed, functionality, data availability, and reliability. Department of CSE, Aditya College of Engineering, Surampalem 48
  • 49. Distributed Systems Advantages of Distributed Operating System:  Failure of one will not affect the other network communication, as all systems are independent from each other.  Electronic mail increases the data exchange speed  Since resources are being shared, computation is highly fast and durable.  Load on host computer reduces  These systems are easily scalable as many systems can be easily added to the network. Delay in data processing reduces. Department of CSE, Aditya College of Engineering, Surampalem 49
  • 50. Network operating system  An operating system that provides features such as file sharing across the network and includes a communication scheme that allows different processes on different computers to exchange messages.  A computer running a network operating system acts autonomously from all other computers on the network. Advantages:  Centralized servers are highly stable.  Security is server managed.  Upgrades to new technologies and hardware can be easily integrated into the system.  Remote access to servers is possible from different locations and types of systems. Department of CSE, Aditya College of Engineering, Surampalem 50
  • 51. Special-Purpose Systems  Real-Time Embedded Systems Embedded computers are the most prevalent form of computers in existence. These devices are found everywhere, from car engines and manufacturing robots to VCRs and microwave ovens. They tend to have very specific tasks. Embedded systems almost always run real-time operating systems. A real time operating system time interval to process and respond to inputs is very small. Examples: Military Software Systems, Space Software Systems. Department of CSE, Aditya College of Engineering, Surampalem 51
  • 52. Real-Time Embedded Systems  A real-time system has well-defined, fixed time constraints. Processing must be done within the defined constraints, or the system will fail.  For instance, it would not do for a robot arm to be instructed to halt after it had smashed into the car it was building.  A real-time system functions correctly only if it returns the correct result within its time constraints.  Two types Hard real time and soft real time Department of CSE, Aditya College of Engineering, Surampalem 52
  • 53. Multimedia Systems  Multimedia data consist of audio and video files as well as conventional files. These data differ from conventional data in that multimedia data— such as frames of video—must be delivered (streamed) according to certain time restrictions  Multimedia describes a wide range of applications that are in popular use today. These include audio files such as MP3 DVD movies, video conferencing, and short video clips of movie previews or news stories downloaded over the Internet. Department of CSE, Aditya College of Engineering, Surampalem 53
  • 54. Handheld systems  Handheld systems include personal digital assistants (PDAs), such as Palm and Pocket-PCs, and cellular telephones, many of which use special-purpose embedded operating systems.  Many handheld devices have between 512 KB and 8 MB of memory. As a result, the operating system and applications must manage memory efficiently. This includes returning all allocated memory back to the memory manager once the memory is no longer being used. Department of CSE, Aditya College of Engineering, Surampalem 54
  • 55. Handheld systems  Currently, many handheld devices do not use virtual memory techniques, thus forcing program developers to work within the confines of limited physical memory.  Processors for most handheld devices often run at a fraction of the speed of a processor in a PC. Faster processors require more power. To include a faster processor in a handheld device would require a larger battery that would have to be replaced more frequently.  The last issue confronting program designers for handheld devices is the small display screens typically available. One approach for displaying the content in web pages is web clipping, where only a small subset of a web page is delivered and displayed on the handheld device. Department of CSE, Aditya College of Engineering, Surampalem 55
  • 56. Operating System Services  One set of operating-system services provides functions that are helpful to the user:  User interface - Almost all operating systems have a user interface (UI)  Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch  Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error) Department of CSE, Aditya College of Engineering, Surampalem 56
  • 57. Operating System Services  I/O operations - A running program may require I/O, which may involve a file or an I/O device  File-system manipulation - The file system is of particular interest. Obviously, programs need to read and write files and directories, create and delete them, search them, list file Information, permission management. Department of CSE, Aditya College of Engineering, Surampalem 57
  • 58. Operating System Services  One set of operating-system services provides functions that are helpful to the user (Cont):  Communications – Processes may exchange information, on the same computer or between computers over a network  Communications may be via shared memory or through message passing (packets moved by the OS)  Error detection – OS needs to be constantly aware of possible errors  May occur in the CPU and memory hardware, in I/O devices, in user program  For each type of error, OS should take the appropriate action to ensure correct and consistent computing  Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system Department of CSE, Aditya College of Engineering, Surampalem 58
  • 59. A View of Operating System Services Department of CSE, Aditya College of Engineering, Surampalem 59
  • 60. Operating System Services  Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing  Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them Many types of resources - Some (such as CPU cycles, main memory, and file storage) may have special allocation code, others (such as I/O devices) may have general request and release code  Accounting - To keep track of which users use how much and what kinds of computer resources Department of CSE, Aditya College of Engineering, Surampalem 60
  • 61. Operating System Services  Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other Protection involves ensuring that all access to system resources is controlled Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts If a system is to be protected and secure, precautions must be instituted throughout it. A chain is only as strong as its weakest link. Department of CSE, Aditya College of Engineering, Surampalem 61
  • 62. System Calls  Programming interface to the services provided by the OS  Typically written in a high-level language (C or C++)  Mostly accessed by programs via a high-level Application Program Interface (API) rather than direct system call use  Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)  Why use APIs rather than system calls? (Note that the system-call names used throughout this text are generic) Department of CSE, Aditya College of Engineering, Surampalem 62
  • 63. Example of System Calls  System call sequence to copy the contents of one file to another file Department of CSE, Aditya College of Engineering, Surampalem 63
  • 64. Example of Standard API  Consider the ReadFile() function in the  Win32 API—a function for reading from a file A description of the parameters passed to ReadFile()  HANDLE file—the file to be read  LPVOID buffer—a buffer where the data will be read into and written from  DWORD bytesToRead—the number of bytes to be read into the buffer  LPDWORD bytesRead—the number of bytes read during the last read  LPOVERLAPPED ovl—indicates if overlapped I/O is being used Department of CSE, Aditya College of Engineering, Surampalem 64
  • 65. System Call Implementation  Typically, a number associated with each system call  System-call interface maintains a table indexed according to these numbers  The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values  The caller need know nothing about how the system call is implemented  Just needs to obey API and understand what OS will do as a result call  Most details of OS interface hidden from programmer by API Managed by run-time support library (set of functions built into libraries included with compiler) Department of CSE, Aditya College of Engineering, Surampalem 65
  • 66. API – System Call – OS Relationship Department of CSE, Aditya College of Engineering, Surampalem 66
  • 67. Standard C Library Example  C program invoking printf() library call, which calls write() system call Department of CSE, Aditya College of Engineering, Surampalem 67
  • 68. System Call Parameter Passing  Often, more information is required than simply identity of desired system call  Exact type and amount of information vary according to OS and call  Three general methods used to pass parameters to the OS  Simplest: pass the parameters in registers  In some cases, may be more parameters than registers  Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register This approach taken by Linux and Solaris  Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system  Block and stack methods do not limit the number or length of parameters being passed Department of CSE, Aditya College of Engineering, Surampalem 68
  • 69. Parameter Passing via Table Department of CSE, Aditya College of Engineering, Surampalem 69
  • 70. Types of System Calls  Process control  File management  Device management  Information maintenance  Communications  Protection Department of CSE, Aditya College of Engineering, Surampalem 70
  • 71. Examples of Windows and Unix System Calls Department of CSE, Aditya College of Engineering, Surampalem 71