SlideShare uma empresa Scribd logo
1 de 124
What is Operating System?
• Operating system is a program that controls the
execution of application programs.
•It is an interface between applications and
hardware
SYSTEM PROGRAMS
 Support the operation of a computer
system and help the programmer to
simplify programming process and
create an environment to run
application software efficiently.
 Software types :
- Application s/w
- System s/w
System s/w types:
- To create program development
environment ( TE,Compiler,
Assembler, Debugger)
- To create run time environment
(Loader, Libraries, OS)
Application Software
Application software is a program
or a collection of programs written by
the users to solve a particular
problem.
COMPUTER SYSTEM
OVERVIEW
Basic Elements
 Processor - Controls the operation of the
computer and performs its data processing
functions.
 Main memory - Stores data and programs.
 I/O Module - Move data between the computer
and its external environment.
 System bus - Provides for communication
among processors, main memory and I/O modules.
 H/W and S/W
 Bus – To communicate between
devices
 Booting (init)
 Interrupt – To send signal to CPU
(s/w interrupt – system call)
Storage structure
Instruction Execution
 A program consists of a set of
instructions stored in memory .
 Instruction execution takes place in CPU
registers
• processor reads (fetches)
instructions from memory
• processor executes each
instruction
Two steps:
Basic Instruction Cycle
 The processor fetches the instruction
from memory
 Program counter (PC) holds address of
the instruction to be fetched next
PC is incremented after each fetch
Instruction Register (IR)
Fetched instruction is
loaded into Instruction
Register (IR)
 Processor interprets
the instruction and
performs required
action:
 Processor-memory
 Processor-I/O
 Data processing
 Control
Characteristics of a
Hypothetical Machine
INSTRUCTION EXECUTION
FULL CYCLE
Interrupts
• It is an event external to the currently executing
process that cause a change in the normal flow of
instruction execution.
• They tell the CPU to stop its current activities and
execute the appropriate part of the OS
 Interrupt the normal sequencing of the processor
 Provided to improve processor utilization
 most I/O devices are slower than the processor
 processor must pause to wait for device
 wasteful use of the processor
• 3 Types
1.Hardware- generated by h/w
2.Software- generated by
Programs
3.Trap- generated by CPU
COMMON CLASSES
OF INTERRUPTS
TRANSFER OF CONTROL VIA INTERRUPTS
Instruction Cycle With Interrupts
SIMPLE
INTERRUPT
PROCESSING
Multiple Interrupts
An interrupt occurs
while another interrupt
is being processed
• e.g. receiving data
from a
communications line
and printing results at
the same time
Two approaches:
• disable interrupts
while an interrupt is
being processed
• use a priority scheme
 Cache memory is smaller, faster memory
and it contains a portion of main memory.
 When processor attempts to determine if
the byte or word is in the cache.
 If so, the byte or word is delivered to the
processor.
 If not, a block of main memory, contains
data, is read into the cache and then the
byte or word is read into the cache and then
the byte is delivered to the processor.
CACHE
AND
MAIN
MEMORY
Cache/Main-Memory Structure
CACHE DESIGN
 KEY ELEMENTS:
1. Cache size
2. Block size
3. Mapping function
4. Replacement algorithm
5. Write policy
6. Number of cache levels
DIRECT MEMORY ACCESS
Three techniques are possible for I/O
operations:
Programme
d I/O
Interrupt-
Driven I/O
Direct Memory
Access (DMA)
∗ I/O TECHNIQUES
Programmed I/O
 The I/O module performs the requested
action then sets the appropriate bits in the
I/O status register
 The processor periodically checks the
status of the I/O module until it determines
the instruction is complete
 With programmed I/O the performance level
of the entire system is severely degraded
Interrupt-Driven I/O
 External asynchronous input is used
to tell the processor that I/O device
needs its service and hence
processor does not have to check
whether I/O device needs its service
or not
Direct Memory Access
(DMA)
When the processor wishes to read or
write data it issues a command to the
DMA module containing:
• whether a read or write is requested
• the address of the I/O device involved
• the starting location in memory to
read/write
• the number of words to be read/written
 Transfers the entire block of data
directly to and from memory without
going through the processor
 processor is involved only at the beginning
and end of the transfer
 processor executes more slowly during a
transfer when processor access to the bus is
required
 More efficient than interrupt-driven or
programmed I/O
MULTIPROCESSOR AND
MULTICORE
ORGANIZATION
Symmetric Multiprocessors
(SMP)
 A stand-alone computer system
with the following characteristics:
◦ two or more similar processors of comparable
capability
◦ processors share the same main memory and are
interconnected by a bus or other internal connection
scheme
◦ processors share access to I/O devices
◦ all processors can perform the same functions
◦ the system is controlled by an integrated operating
system that provides interaction between
processors and their programs at the job, task, file,
Performance
• a system with multiple
processors will yield
greater performance if work
can be done in parallel
Availability
• the failure of a single
processor does not halt the
machine
Incremental Growth
• an additional processor can
be added to enhance
performance
Scaling
• vendors can offer a range
of products with different
price and performance
characteristics
SMP Organization
Figure 1.19 Symmetric Multiprocessor Organization
Multicore Computer
 Also known as a chip multiprocessor
 Combines two or more processors
(cores) on a single piece of silicon (die)
 each core consists of all of the
components of an independent processor
 In addition, multicore chips also include
L2 cache and in some cases L3 cache
Intel Core i7
Supports two forms of external communications to other
chips:
DDR3 Memory Controller
• brings the memory controller for the DDR (double data rate)
main memory onto the chip
• with the memory controller on the chip the Front Side Bus is
eliminated
QuickPath Interconnect (QPI)
• enables high-speed communications among
connected processor chips
Intel
Core
i7
Figure 1.20 Intel Corei7 Block Diagram
OPERATING SYSTEM
OBJECTIVES AND FUNCTONS
•Operating system is a program that
controls the execution of application
programs.
•It is an interface between
applications and hardware
OPERATING SYSTEM
OBJECTIVES AND FUNCTONS
•Convenience – To users
•Efficiency – Resources usage
•Ability to evolve – permit effective
development, testing
OPERATING SYSTEM AS A
USER/COMPUTER INTERFACE
End user’s view – Applications through
application programs
Libraries – Assist in program creation,
management of files, control of I/O devices.
OS – Masks the details of hardware from
programmer
OS as Resource manager
• A computer is a set of resources for the
movement, storage, and processing of
data and for the control of these functions
• The OS functions in the same way as
ordinary computer software; that is, it is a
program or suite of programs executed by
the processor.
• The OS frequently relinquishes control
and must depend on the processor to
allow it to regain control.
OS services
1.Program development – provides facilities
such as editors in creating programs
2.Program execution – loading program into
memory, I/O devices and files initialization
3. Access to I/O devices – using reads and
writes
4.Controlled access to files – protection
mechanisms in accessing in multiuser
system
OS services
6.Error detection and response – Hardware
errors - such as a memory error, or a device
failure or malfunction;
Software errors - division by zero, attempt to
access forbidden memory location.
OS provides a response that clears the error
condition
7.Accounting:
A good OS will collect usage statistics for
various resources and monitor performance
parameters such as response time.
-> To improve performance in future
-> Billing in multiuser system
OS services
OS services
8.Instruction set architecture
This interface is the boundary between
hardware and software. Both
application programs and utilities may
access the ISA directly.
OS services
9.Application Binary interface
The ABI defines the system call interface to the
operating system and the hardware resources
and services available in a system through the
user ISA.
10.Application programming interface
The API gives a program access to the
hardware resources and services available in a
Ease of Evolution of Operating
Systems
 Hardware upgrades plus new types of
hardware – paging hardware
 New services – For user demands
 Fixes
Evolution of Operating
Systems
1.Serial processing(1940 – 1950)
◦ No operating system
◦ Machines run from a console with display
lights, toggle switches, input device, and
printer
 Programs in machine code were loaded
via the input device (e.g., a card reader).
 If an error halted the program, the error
condition was indicated by the lights.
 If the program proceeded to a normal
completion, the output appeared on the
printer.
 Problems:
1.scheduling:
If the user not finish in the allotted time, and be
forced to stop before resolving the problem.
2. Set up time:
A single program, called a job could involve
loading the compiler plus the high-level
language program (source program) into
memory,
saving the compiled program (object program)
and then
loading and linking together the object program
and common functions.
If an error occurred, the user typically had to go
back to the beginning of the setup sequence.
2.Simple batch system
◦ Monitor -Software that controls the sequence of
events
 the user no longer has direct access to the
processor.
 the user submits the job on cards or tape
to a
computer operator.
 He batches the jobs together sequentially
and places the entire batch on an input
device, for use by the monitor.
 Each program is constructed to branch
back to the monitor when it completes
processing, at which point the monitor
automatically begins loading the next
program.
Job Control Language
 Special type of programming language
 Provides instruction to the monitor
◦ What compiler to use
◦ What data to use
Requirements:
1.Memory protection:
 While the user program is executing, it
must not alter the memory area
containing the monitor.
 If such an attempt is made, the
processor
hardware should detect an error and
transfer control to the monitor.
 monitor would then abort the job, print
out an error message, and load in the
next job.
2.Timer:
 A timer is used to prevent a single job
from monopolizing the system.
 The timer is set at the beginning of
each job.
 If the timer expires, the user program
is stopped, and control returns to the
monitor.
3. Privileged instructions
Certain machine level instructions are
designated privileged and can be
executed only by the monitor.
If the processor encounters such an
instruction while executing a user
program, an error occurs causing control
to be transferred to the monitor.
4. Interrupts:
Early computer models did not have this
capability. This feature gives the OS
more flexibility in relinquishing control to
and regaining control from user
programs.
MULTIPROGRAMMING
 Two or more programs in the memory
at the same time and sharing
processor
 OS keeps number of programs in
memory.
 It selects and executes one program.
 All other programs are in job pool
which is in disk.
 Memory management is required to
manage the memory for processes.
 CPU scheduling is applied for
selecting process from memory.
 Function of MP is combination of I/O
Management, CPU scheduling and
memory management.
Uniprogramming
 Processor must wait for I/O instruction
to complete before proceeding
Multiprogramming
 When one job needs to wait for I/O,
the processor can switch to the other
job
Multiprogramming
Time Sharing Systems
 Time sharing-Multi Tasking
 Logical extension of multiprogramming
 User interaction is possible
 Multi users share computer system
simultaneously.
 Concept of virtual machine used
 First time-sharing operating systems -
Compatible Time-Sharing System
(CTSS) , developed at MIT by a group
known as Project MAC (Machine-
Aided Cognition, or Multiple-Access
Computers).
Batch Multiprogramming versus
Time Sharing
Computer System
Organization
1. Computer-System Operation
2. Storage Structure
3. I/O Structure
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 devices competing for
memory cycles
Computer-System Operation
Booting :
1. Bootstrap program is stored in ROM or EEPROM.
2. It initializes all the system components, from CPU
registers to device controllers.
3. The bootstrap program knows how to load operating
system and how to start executing that system.
4. To accomplish this goal, the bootstrap program must
locate the operating-system kernel and load it into
memory.
5. Once the kernel is loaded and executing, it can start
Computer-System Operation
 On UNIX, the first system process is “init,” and it
starts many other daemons.
 Once this phase is complete, the system is fully
booted, and the system waits for some event to
occur.
 The occurrence of an event is usually signalled 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).
 A table of pointers to interrupt routines can be used
instead to provide the necessary speed.
 The interrupt routine is called indirectly through the
table
 The table of pointers is stored in low memory (the first
hundred or so locations).
 These locations hold the addresses of the interrupt
service routines for the various devices.
 This array, or interrupt vector, of addresses is then
indexed by a unique device number, given with
the interrupt request, to provide the address of the
interrupt service routine for the interrupting device.
 EX: Windows and UNIX dispatch interrupts in this
manner.
Storage Definitions and Notation Review
Computer storage, along with most computer
throughput, is generally measured and manipulated
in bytes and collections of bytes.
A kilobyte, or KB, is 1,024 bytes
a megabyte, or MB, is 1,0242 bytes
a gigabyte, or GB, is 1,0243 bytes
a terabyte, or TB, is 1,0244 bytes
a petabyte, or PB, is 1,0245 bytes
Storage Structure
 Main memory – only large storage media that the CPU
can access directly
◦ Random access
◦ Typically volatile
 Secondary storage – extension of main memory that
provides large nonvolatile storage capacity
 Hard 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
 Solid-state disks – faster than hard disks, nonvolatile
◦ Becoming more popular
Storage Hierarchy
 Storage systems organized in hierarchy
◦ Speed
◦ Cost
◦ Volatility
 Caching – copying information into faster
storage system; main memory can be viewed as
a cache for secondary storage
 Device Driver for each device controller to
manage I/O
◦ Provides uniform interface between controller
and kernel
Storage-Device Hierarchy
Caching
 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
I/O Structure
 I/O devices and the CPU can execute
concurrently
 Each device controller is in charge of a
particular device type
 Each device controller has a local buffer
 I/O is from the device to local buffer of
controller
 Device controller informs CPU that it has
finished its operation by causing an interrupt
 After I/O starts, control returns to user program only
upon I/O completion
◦ Wait instruction idles the CPU until the next interrupt
◦ Wait loop (contention for memory access)
◦ At most one I/O request is outstanding at a time, no
simultaneous I/O processing
 After I/O starts, control returns to user program without
waiting for I/O completion
◦ System call – request to the OS to allow user to
wait for I/O completion
◦ Device-status table contains entry for each I/O
device indicating its type, address, and state
◦ OS indexes into I/O device table to determine
device status and to modify table entry to include
interrupt
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
Operating System Structure
 General-purpose OS is very large
program
 Various structure
◦ Simple structure – MS-DOS
◦ More complex -- UNIX
◦ Layered – an abstraction
◦ Microkernel -Mach
Simple Structure -- MS-DOS
 Small and simple
in size
 In new versions –
size increased
 Application
programs directly
interact with BIOS
driver(DA)
Non Simple Structure --
UNIX
UNIX – limited by hardware functionality,
The UNIX OS consists of two parts
◦ Systems programs
◦ The kernel
- Provides system calls for the file
system, CPU scheduling, memory
management
Traditional UNIX System Structure
Layered Approach
 The operating system is
divided into a number of
layers (levels),
 The bottom layer (layer 0), is
the hardware;
 the highest (layer N) is the
user interface.
 Functionality of each layer is
fixed.
 Each layer consist of data
structure and set of routines
 With modularity, layers are
selected such that each
uses functions (operations)
and services of only lower-
level layers
 Each layer is using system
calls for performing their
Kernel
 Kernel is a sw code that resides in the central
core of a operating system.
 Shell is outer part of OS and it interacts with user
commands.
 Kernel does not directly interact with user. It
interacts with shell.
 Kernel is the first part of OS loaded into memory
and remains entire computer session.
 Kernel code is in protected area in memory.
 Kernel works in kernel space.
 User performs in user space.
 Memory – two areas
1. System area 2. User area
 Kernel content includes
- Scheduler(Alloc time to proc)
- Supervisor (Grants permission to
process to use resources)
- Interrupt handler (Handles all
requests from devices for service)
- Memory manager(Alloc mem
space)
Types
 Monolithic kernel
 Micro kernel
 Hybrid kernel
 Exo kernel
Monolithic kernel
 Traditional UNIX uses
 OS runs as a single program in kernel
mode
 Operations done via system call
 LINUX and Free BSD uses modern
ML
Micro kernel
 Provides minimal services such as
defining memory address space, IPC
and process management.
 Provides communication facility
between client programs
 Communication takes place using
message passing
 Microkernel runs in kernel mode and
rest run in user mode
 Ex:
- Mach OS
- Windows NT
- QNX real time OS
Microkernel System Structure
Application
Program
File
System
Device
Driver
Interprocess
Communication
memory
managment
CPU
scheduling
messagesmessages
microkernel
hardware
user
mode
kernel
mode
Modules
 Many modern operating systems implement
loadable kernel modules
 the kernel has a set of core components and
links in additional services via modules
 This type of design is common in modern
implementations of UNIX, such as Solaris,
Linux, and Mac OS X, as well as Windows
 The Solaris operating system structure,
is organized around a core kernel with
seven types of loadable kernel modules:
1. Scheduling classes
2. File systems
3. Loadable system calls
4. Executable formats
5. STREAMS modules
6. Miscellaneous
7. Device and bus drivers
Solaris Modular Approach
Hybrid Systems
 Most modern operating systems are actually
not one pure model
◦ Hybrid combines multiple approaches to
address performance, security, usability
needs
◦ Linux and Solaris kernels in kernel address
space, so monolithic, plus modular for
dynamic loading of functionality
◦ Windows mostly monolithic, plus microkernel
for different subsystem personalities
 Apple Mac OS X hybrid, layered, Aqua UI plus
Cocoa programming environment
System Calls
 System calls provide an interface between
running program and an operating system.
 OS provides services and system call provides
interface to these services
 Typically written in a high-level language (C or
C++)
 A system call is an explicit request to kernel
mode via software interrupt.
 It is like procedure call but system call enters
kernel.
 All system call return an integer value.
 In the kernel positive or 0 denote successful
termination and negative value denotes error
 Mostly accessed by programs via a high-
level Application Programming Interface
(API) rather than direct system call use
 Application developers design programs
according to an application programming
interface (API).
 Three most common APIs are
- Win32 API for Windows,
- POSIX API for POSIX-based systems and
- Java API for the Java virtual machine
(JVM)
 Three general methods are used to pass
parameters to the operating system.
1. The simplest approach is to pass the
parameters in registers. This is the
approach taken by Linux and Solaris.
2. Parameters also can be placed, or
pushed, onto the stack by the program
and popped off the stack by the
operating system.
3. The parameters are generally stored in a
block, or table in memory, and the
address of the block is passed as a
parameter in a register
API – System Call – OS
Relationship
Parameter Passing via Table
Types of System Calls
System calls can be grouped roughly
into six major categories:
 file management,
 process management,
 I/O device management,
 information processing and
maintenance,
 Inter process communications
 protection
File management
◦ create file, delete file
◦ open, close file
◦ read, write, reposition
◦ get and set file attributes
Process management
◦ create process, terminate process
◦ end, abort
◦ load, execute
◦ get process attributes, set process attributes
◦ wait for time
◦ wait event, signal event
◦ allocate and free memory
◦ Dump memory if error
◦ Debugger for determining bugs, single step
execution
◦ Locks for managing access to shared data between
processes
Inter process communications
Pipe, socket, message passing and shared
memory are used foe IPC.
System calls:
◦ Send message, receive messages
◦ create, delete connection
◦ attach and detach remote devices
I/O Device management
◦ request device, release device
◦ read, write, reposition
◦ get device attributes, set device attributes
◦ logically attach or detach devices
Information processing and
maintenance
◦ get time or date, set time or
date
◦ get system data, set system
data
◦ get and set process, file, or
device attributes
Protection
 Protection provides a mechanism for
controlling access to the resources
provided by a computer system.
 Historically, protection was a concern
only on multi programmed computer
systems with several users.
◦ Control access to resources
◦ Get and set permissions
◦ Allow and deny user access
Examples of Windows and Unix System Calls
System Programs
 Modern OS is a collection of system
programs.
 Provide application programming environment
on hardware for program development and
execution
◦ Some of them are simply user interfaces to
system calls; others are considerably more
complex
Categories of system calls:
 File management - Create, delete, copy,
rename, print, dump, list, and generally
 Status information
◦ Some ask the system for info - date, time,
amount of available memory, disk space,
number of users
◦ Others provide detailed performance,
logging, and debugging information
◦ Typically, these programs format and print
the output to the terminal or other output
devices
◦ Some systems implement a registry -
used to store and retrieve configuration
information
 File modification
◦ Text editors to create and modify files
◦ Special commands to search contents of
files or perform transformations of the text
 Programming-language support -
Compilers, assemblers, debuggers and
interpreters sometimes provided
 Program loading and execution- Absolute
loaders, relocatable loaders, linkage
editors, and overlay-loaders, debugging
systems for higher-level and machine
language
 Communications - Provide the mechanism
for creating virtual connections among
processes, users, and computer systems
◦ Allow users to send messages to one
another’s screens, browse web pages,
send electronic-mail messages, log in
remotely, transfer files from one machine
to another
 Background Services
◦ Launch at boot time
 Some for system startup, then terminate
 Some from system boot to shutdown
◦ Provide facilities like disk checking, process
scheduling, error logging, printing
◦ Run in user context not kernel context
◦ Known as services, subsystems,
daemons
 Application programs
◦ Don’t pertain to system
◦ Run by users
◦ Not typically considered part of OS
◦ Launched by command line, mouse click,
Operating System Generation
n Operating systems are designed to run on any of a
class of machines;
 The system must then be configured or generated for
each specific computer site, a process sometimes
known as system generation SYSGEN.
 The operating system is normally distributed on disk,
on CD-ROM or
DVD-ROM.
 To generate a system, we use a special program.
 This SYSGEN program reads from a given file, or
asks the operator of the system for information
concerning the specific configuration of the hardware
system, or probes the hardware directly to determine
what components are there
System Boot
 Boot strap program is stored in ROM
 Boot strap program loads and
executes boot program
 Boot program is stored in disk in
predetermined address called boot
sector
 Boot program loads OS into
memory(Boot strapping)
Operating-System Operations
 Interrupt driven (hardware and software)
◦ Hardware interrupt by one of the devices
◦ Software interrupt (exception or trap):
 Software error (e.g., division by zero)
 Request for operating system service
 Other process problems include infinite
loop, processes modifying each other or
the operating system
Operating-System Operations
 Dual-mode operation allows OS to protect
itself and other system components
◦ User mode and kernel mode(Monitor
mode)
◦ Mode bit provided by hardware
◦ Mode bit – 0 for monitor mode and 1- user
mode
 Provides ability to distinguish when system
is running user code or kernel code
 Booting – monitor mode
 Some instructions designated as
privileged, only executable in kernel
mode
 When interrupt occurs mode changes from
Clustered system
 Group of computer system connected
with high speed communication link
 Each computer has own memory
 Integrated with H/W Cluster and S/W
cluster
 H/W cluster - sharing disks, S/W –
control
 Two types:
1.Symmetric
2.Asymmetric
 Asymmetric:
- One machine is in standby mode
and monitors server while others run
applications. If server fails this
machine acts as server.
 Symmetric:
Each host monitors other host
Distributed system
 Computers connected via N/W
 Distributed OS needed.
 Resource sharing across computers and
users feel like using single machine
Adv:
1.Resource sharing
2.High reliability
3.Better price performance ratio
4.Response time and throughput
5.Incremental growth
Ex: Amoeba, chrous, mach and v-system
Network Operating system
 User can login to remote resources
and access
 Machines connected via
communication link
 File transfer possible
 Supports multiple user accounts
Ex: Telnet
Real time OS
 Time constraints is the key parameter
 Used in robotics, satellites
 Types:
1.Hard real time system – Highly
restricted
2.Soft real time system – Relaxed time
bound
Handheld systems
 Physical size is handheld
 Ex: Mobile phone
 Slow processor, small display, less
memory
 OS Ex: Blackberry, Android, Windows
 Uses wireless technology(BT, Wi-Fi)

Mais conteúdo relacionado

Mais procurados

Operating system Concepts
Operating system Concepts Operating system Concepts
Operating system Concepts RANVIJAY GAUR
 
Operating Systems
Operating SystemsOperating Systems
Operating Systemsvampugani
 
Operating systems
Operating systemsOperating systems
Operating systemsJoshuaIgo
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating systemArpana shree
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1sphs
 
Operating system notes
Operating system notesOperating system notes
Operating system notesSANTOSH RATH
 
ITFT_Introduction to Operating system
ITFT_Introduction to Operating systemITFT_Introduction to Operating system
ITFT_Introduction to Operating systemSneh Prabha
 
operating system
operating systemoperating system
operating systemKadianAman
 
Lecture 1 introduction to Operating System
Lecture 1 introduction to Operating SystemLecture 1 introduction to Operating System
Lecture 1 introduction to Operating SystemDr. Amitava Nag
 
OS - Operating System
OS - Operating System OS - Operating System
OS - Operating System MaqdamYasir
 
Operating system 02 os as an extended machine
Operating system 02 os as an extended machineOperating system 02 os as an extended machine
Operating system 02 os as an extended machineVaibhav Khanna
 
Operating system || Chapter 3: Process
Operating system || Chapter 3: ProcessOperating system || Chapter 3: Process
Operating system || Chapter 3: ProcessAnkonGopalBanik
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESsuthi
 
Bba i-introduction to computer-u-3-functions operating systems
Bba  i-introduction to computer-u-3-functions operating systemsBba  i-introduction to computer-u-3-functions operating systems
Bba i-introduction to computer-u-3-functions operating systemsRai University
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating SystemDivya S
 

Mais procurados (20)

Operating system Concepts
Operating system Concepts Operating system Concepts
Operating system Concepts
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating systems
Operating systemsOperating systems
Operating systems
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating system
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1
 
Operating system notes
Operating system notesOperating system notes
Operating system notes
 
ITFT_Introduction to Operating system
ITFT_Introduction to Operating systemITFT_Introduction to Operating system
ITFT_Introduction to Operating system
 
Chapter02 new
Chapter02 newChapter02 new
Chapter02 new
 
operating system
operating systemoperating system
operating system
 
Lecture 1 introduction to Operating System
Lecture 1 introduction to Operating SystemLecture 1 introduction to Operating System
Lecture 1 introduction to Operating System
 
OS - Operating System
OS - Operating System OS - Operating System
OS - Operating System
 
operating system
operating systemoperating system
operating system
 
Operating system 02 os as an extended machine
Operating system 02 os as an extended machineOperating system 02 os as an extended machine
Operating system 02 os as an extended machine
 
Operating system || Chapter 3: Process
Operating system || Chapter 3: ProcessOperating system || Chapter 3: Process
Operating system || Chapter 3: Process
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Bba i-introduction to computer-u-3-functions operating systems
Bba  i-introduction to computer-u-3-functions operating systemsBba  i-introduction to computer-u-3-functions operating systems
Bba i-introduction to computer-u-3-functions operating systems
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 

Semelhante a What is operating system

Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating SystemSoumit Ghosh
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)Sohaib Danish
 
OSLecture1.ppt
OSLecture1.pptOSLecture1.ppt
OSLecture1.pptAkkiiDerp
 
Operating System-Introduction
Operating System-IntroductionOperating System-Introduction
Operating System-IntroductionShipra Swati
 
LM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system callsLM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system callsmanideepakc
 
Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Ismail Mukiibi
 
operating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSgoperating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSgDashrath5
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.pptshreesha16
 
Nt introduction(os)
Nt introduction(os)Nt introduction(os)
Nt introduction(os)NehaTadam
 
Introduction to Operating Systems.pdf
Introduction to Operating Systems.pdfIntroduction to Operating Systems.pdf
Introduction to Operating Systems.pdfHarika Pudugosula
 
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 sysyemsJyoReddy9
 

Semelhante a What is operating system (20)

OS UNIT1.pptx
OS UNIT1.pptxOS UNIT1.pptx
OS UNIT1.pptx
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
 
OSLecture1.ppt
OSLecture1.pptOSLecture1.ppt
OSLecture1.ppt
 
Ch1
Ch1Ch1
Ch1
 
Ch1 - OS.pdf
Ch1 - OS.pdfCh1 - OS.pdf
Ch1 - OS.pdf
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
 
Operating System-Introduction
Operating System-IntroductionOperating System-Introduction
Operating System-Introduction
 
LM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system callsLM1 - Computer System Overview, system calls
LM1 - Computer System Overview, system calls
 
Spr ch-01
Spr ch-01Spr ch-01
Spr ch-01
 
Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2
 
Ch1
Ch1Ch1
Ch1
 
operating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSgoperating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSg
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
 
Nt introduction(os)
Nt introduction(os)Nt introduction(os)
Nt introduction(os)
 
Introduction to Operating Systems.pdf
Introduction to Operating Systems.pdfIntroduction to Operating Systems.pdf
Introduction to Operating Systems.pdf
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Unit I OS CS.ppt
Unit I OS CS.pptUnit I OS CS.ppt
Unit I OS CS.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
 

Último

"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptbibisarnayak0
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentBharaniDharan195623
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 

Último (20)

"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.ppt
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managament
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 

What is operating system

  • 1. What is Operating System? • Operating system is a program that controls the execution of application programs. •It is an interface between applications and hardware
  • 2. SYSTEM PROGRAMS  Support the operation of a computer system and help the programmer to simplify programming process and create an environment to run application software efficiently.
  • 3.  Software types : - Application s/w - System s/w System s/w types: - To create program development environment ( TE,Compiler, Assembler, Debugger) - To create run time environment (Loader, Libraries, OS)
  • 4. Application Software Application software is a program or a collection of programs written by the users to solve a particular problem.
  • 6. Basic Elements  Processor - Controls the operation of the computer and performs its data processing functions.  Main memory - Stores data and programs.  I/O Module - Move data between the computer and its external environment.  System bus - Provides for communication among processors, main memory and I/O modules.
  • 7.
  • 8.  H/W and S/W  Bus – To communicate between devices  Booting (init)  Interrupt – To send signal to CPU (s/w interrupt – system call)
  • 10. Instruction Execution  A program consists of a set of instructions stored in memory .  Instruction execution takes place in CPU registers • processor reads (fetches) instructions from memory • processor executes each instruction Two steps:
  • 12.  The processor fetches the instruction from memory  Program counter (PC) holds address of the instruction to be fetched next PC is incremented after each fetch
  • 13. Instruction Register (IR) Fetched instruction is loaded into Instruction Register (IR)  Processor interprets the instruction and performs required action:  Processor-memory  Processor-I/O  Data processing  Control
  • 16. Interrupts • It is an event external to the currently executing process that cause a change in the normal flow of instruction execution. • They tell the CPU to stop its current activities and execute the appropriate part of the OS  Interrupt the normal sequencing of the processor  Provided to improve processor utilization  most I/O devices are slower than the processor  processor must pause to wait for device  wasteful use of the processor
  • 17. • 3 Types 1.Hardware- generated by h/w 2.Software- generated by Programs 3.Trap- generated by CPU
  • 19. TRANSFER OF CONTROL VIA INTERRUPTS
  • 22. Multiple Interrupts An interrupt occurs while another interrupt is being processed • e.g. receiving data from a communications line and printing results at the same time Two approaches: • disable interrupts while an interrupt is being processed • use a priority scheme
  • 23.
  • 24.
  • 25.  Cache memory is smaller, faster memory and it contains a portion of main memory.  When processor attempts to determine if the byte or word is in the cache.  If so, the byte or word is delivered to the processor.  If not, a block of main memory, contains data, is read into the cache and then the byte or word is read into the cache and then the byte is delivered to the processor.
  • 28. CACHE DESIGN  KEY ELEMENTS: 1. Cache size 2. Block size 3. Mapping function 4. Replacement algorithm 5. Write policy 6. Number of cache levels
  • 29. DIRECT MEMORY ACCESS Three techniques are possible for I/O operations: Programme d I/O Interrupt- Driven I/O Direct Memory Access (DMA) ∗ I/O TECHNIQUES
  • 30. Programmed I/O  The I/O module performs the requested action then sets the appropriate bits in the I/O status register  The processor periodically checks the status of the I/O module until it determines the instruction is complete  With programmed I/O the performance level of the entire system is severely degraded
  • 31. Interrupt-Driven I/O  External asynchronous input is used to tell the processor that I/O device needs its service and hence processor does not have to check whether I/O device needs its service or not
  • 32. Direct Memory Access (DMA) When the processor wishes to read or write data it issues a command to the DMA module containing: • whether a read or write is requested • the address of the I/O device involved • the starting location in memory to read/write • the number of words to be read/written
  • 33.  Transfers the entire block of data directly to and from memory without going through the processor  processor is involved only at the beginning and end of the transfer  processor executes more slowly during a transfer when processor access to the bus is required  More efficient than interrupt-driven or programmed I/O
  • 35. Symmetric Multiprocessors (SMP)  A stand-alone computer system with the following characteristics: ◦ two or more similar processors of comparable capability ◦ processors share the same main memory and are interconnected by a bus or other internal connection scheme ◦ processors share access to I/O devices ◦ all processors can perform the same functions ◦ the system is controlled by an integrated operating system that provides interaction between processors and their programs at the job, task, file,
  • 36. Performance • a system with multiple processors will yield greater performance if work can be done in parallel Availability • the failure of a single processor does not halt the machine Incremental Growth • an additional processor can be added to enhance performance Scaling • vendors can offer a range of products with different price and performance characteristics
  • 37. SMP Organization Figure 1.19 Symmetric Multiprocessor Organization
  • 38. Multicore Computer  Also known as a chip multiprocessor  Combines two or more processors (cores) on a single piece of silicon (die)  each core consists of all of the components of an independent processor  In addition, multicore chips also include L2 cache and in some cases L3 cache
  • 39. Intel Core i7 Supports two forms of external communications to other chips: DDR3 Memory Controller • brings the memory controller for the DDR (double data rate) main memory onto the chip • with the memory controller on the chip the Front Side Bus is eliminated QuickPath Interconnect (QPI) • enables high-speed communications among connected processor chips
  • 40. Intel Core i7 Figure 1.20 Intel Corei7 Block Diagram
  • 41. OPERATING SYSTEM OBJECTIVES AND FUNCTONS •Operating system is a program that controls the execution of application programs. •It is an interface between applications and hardware
  • 42. OPERATING SYSTEM OBJECTIVES AND FUNCTONS •Convenience – To users •Efficiency – Resources usage •Ability to evolve – permit effective development, testing
  • 43. OPERATING SYSTEM AS A USER/COMPUTER INTERFACE
  • 44. End user’s view – Applications through application programs Libraries – Assist in program creation, management of files, control of I/O devices. OS – Masks the details of hardware from programmer
  • 45. OS as Resource manager • A computer is a set of resources for the movement, storage, and processing of data and for the control of these functions • The OS functions in the same way as ordinary computer software; that is, it is a program or suite of programs executed by the processor. • The OS frequently relinquishes control and must depend on the processor to allow it to regain control.
  • 46.
  • 47. OS services 1.Program development – provides facilities such as editors in creating programs 2.Program execution – loading program into memory, I/O devices and files initialization 3. Access to I/O devices – using reads and writes 4.Controlled access to files – protection mechanisms in accessing in multiuser system
  • 48. OS services 6.Error detection and response – Hardware errors - such as a memory error, or a device failure or malfunction; Software errors - division by zero, attempt to access forbidden memory location. OS provides a response that clears the error condition 7.Accounting: A good OS will collect usage statistics for various resources and monitor performance parameters such as response time. -> To improve performance in future -> Billing in multiuser system
  • 50. OS services 8.Instruction set architecture This interface is the boundary between hardware and software. Both application programs and utilities may access the ISA directly.
  • 51. OS services 9.Application Binary interface The ABI defines the system call interface to the operating system and the hardware resources and services available in a system through the user ISA. 10.Application programming interface The API gives a program access to the hardware resources and services available in a
  • 52. Ease of Evolution of Operating Systems  Hardware upgrades plus new types of hardware – paging hardware  New services – For user demands  Fixes
  • 53. Evolution of Operating Systems 1.Serial processing(1940 – 1950) ◦ No operating system ◦ Machines run from a console with display lights, toggle switches, input device, and printer  Programs in machine code were loaded via the input device (e.g., a card reader).  If an error halted the program, the error condition was indicated by the lights.  If the program proceeded to a normal completion, the output appeared on the printer.
  • 54.  Problems: 1.scheduling: If the user not finish in the allotted time, and be forced to stop before resolving the problem. 2. Set up time: A single program, called a job could involve loading the compiler plus the high-level language program (source program) into memory, saving the compiled program (object program) and then loading and linking together the object program and common functions. If an error occurred, the user typically had to go back to the beginning of the setup sequence.
  • 55. 2.Simple batch system ◦ Monitor -Software that controls the sequence of events  the user no longer has direct access to the processor.  the user submits the job on cards or tape to a computer operator.  He batches the jobs together sequentially and places the entire batch on an input device, for use by the monitor.  Each program is constructed to branch back to the monitor when it completes processing, at which point the monitor automatically begins loading the next program.
  • 56. Job Control Language  Special type of programming language  Provides instruction to the monitor ◦ What compiler to use ◦ What data to use
  • 57. Requirements: 1.Memory protection:  While the user program is executing, it must not alter the memory area containing the monitor.  If such an attempt is made, the processor hardware should detect an error and transfer control to the monitor.  monitor would then abort the job, print out an error message, and load in the next job.
  • 58. 2.Timer:  A timer is used to prevent a single job from monopolizing the system.  The timer is set at the beginning of each job.  If the timer expires, the user program is stopped, and control returns to the monitor.
  • 59. 3. Privileged instructions Certain machine level instructions are designated privileged and can be executed only by the monitor. If the processor encounters such an instruction while executing a user program, an error occurs causing control to be transferred to the monitor. 4. Interrupts: Early computer models did not have this capability. This feature gives the OS more flexibility in relinquishing control to and regaining control from user programs.
  • 60. MULTIPROGRAMMING  Two or more programs in the memory at the same time and sharing processor  OS keeps number of programs in memory.  It selects and executes one program.  All other programs are in job pool which is in disk.
  • 61.  Memory management is required to manage the memory for processes.  CPU scheduling is applied for selecting process from memory.  Function of MP is combination of I/O Management, CPU scheduling and memory management.
  • 62. Uniprogramming  Processor must wait for I/O instruction to complete before proceeding
  • 63. Multiprogramming  When one job needs to wait for I/O, the processor can switch to the other job
  • 65. Time Sharing Systems  Time sharing-Multi Tasking  Logical extension of multiprogramming  User interaction is possible  Multi users share computer system simultaneously.  Concept of virtual machine used
  • 66.  First time-sharing operating systems - Compatible Time-Sharing System (CTSS) , developed at MIT by a group known as Project MAC (Machine- Aided Cognition, or Multiple-Access Computers).
  • 68. Computer System Organization 1. Computer-System Operation 2. Storage Structure 3. I/O Structure
  • 69. 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 devices competing for memory cycles
  • 70. Computer-System Operation Booting : 1. Bootstrap program is stored in ROM or EEPROM. 2. It initializes all the system components, from CPU registers to device controllers. 3. The bootstrap program knows how to load operating system and how to start executing that system. 4. To accomplish this goal, the bootstrap program must locate the operating-system kernel and load it into memory. 5. Once the kernel is loaded and executing, it can start
  • 71. Computer-System Operation  On UNIX, the first system process is “init,” and it starts many other daemons.  Once this phase is complete, the system is fully booted, and the system waits for some event to occur.  The occurrence of an event is usually signalled 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).
  • 72.  A table of pointers to interrupt routines can be used instead to provide the necessary speed.  The interrupt routine is called indirectly through the table  The table of pointers is stored in low memory (the first hundred or so locations).  These locations hold the addresses of the interrupt service routines for the various devices.  This array, or interrupt vector, of addresses is then indexed by a unique device number, given with the interrupt request, to provide the address of the interrupt service routine for the interrupting device.  EX: Windows and UNIX dispatch interrupts in this manner.
  • 73. Storage Definitions and Notation Review Computer storage, along with most computer throughput, is generally measured and manipulated in bytes and collections of bytes. A kilobyte, or KB, is 1,024 bytes a megabyte, or MB, is 1,0242 bytes a gigabyte, or GB, is 1,0243 bytes a terabyte, or TB, is 1,0244 bytes a petabyte, or PB, is 1,0245 bytes
  • 74. Storage Structure  Main memory – only large storage media that the CPU can access directly ◦ Random access ◦ Typically volatile  Secondary storage – extension of main memory that provides large nonvolatile storage capacity  Hard 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  Solid-state disks – faster than hard disks, nonvolatile ◦ Becoming more popular
  • 75. Storage Hierarchy  Storage systems organized in hierarchy ◦ Speed ◦ Cost ◦ Volatility  Caching – copying information into faster storage system; main memory can be viewed as a cache for secondary storage  Device Driver for each device controller to manage I/O ◦ Provides uniform interface between controller and kernel
  • 77. Caching  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
  • 78. I/O Structure  I/O devices and the CPU can execute concurrently  Each device controller is in charge of a particular device type  Each device controller has a local buffer  I/O is from the device to local buffer of controller  Device controller informs CPU that it has finished its operation by causing an interrupt
  • 79.  After I/O starts, control returns to user program only upon I/O completion ◦ Wait instruction idles the CPU until the next interrupt ◦ Wait loop (contention for memory access) ◦ At most one I/O request is outstanding at a time, no simultaneous I/O processing  After I/O starts, control returns to user program without waiting for I/O completion ◦ System call – request to the OS to allow user to wait for I/O completion ◦ Device-status table contains entry for each I/O device indicating its type, address, and state ◦ OS indexes into I/O device table to determine device status and to modify table entry to include interrupt
  • 80. 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
  • 81. Operating System Structure  General-purpose OS is very large program  Various structure ◦ Simple structure – MS-DOS ◦ More complex -- UNIX ◦ Layered – an abstraction ◦ Microkernel -Mach
  • 82. Simple Structure -- MS-DOS  Small and simple in size  In new versions – size increased  Application programs directly interact with BIOS driver(DA)
  • 83. Non Simple Structure -- UNIX UNIX – limited by hardware functionality, The UNIX OS consists of two parts ◦ Systems programs ◦ The kernel - Provides system calls for the file system, CPU scheduling, memory management
  • 85. Layered Approach  The operating system is divided into a number of layers (levels),  The bottom layer (layer 0), is the hardware;  the highest (layer N) is the user interface.  Functionality of each layer is fixed.  Each layer consist of data structure and set of routines  With modularity, layers are selected such that each uses functions (operations) and services of only lower- level layers  Each layer is using system calls for performing their
  • 86. Kernel  Kernel is a sw code that resides in the central core of a operating system.  Shell is outer part of OS and it interacts with user commands.  Kernel does not directly interact with user. It interacts with shell.  Kernel is the first part of OS loaded into memory and remains entire computer session.  Kernel code is in protected area in memory.  Kernel works in kernel space.  User performs in user space.  Memory – two areas 1. System area 2. User area
  • 87.  Kernel content includes - Scheduler(Alloc time to proc) - Supervisor (Grants permission to process to use resources) - Interrupt handler (Handles all requests from devices for service) - Memory manager(Alloc mem space)
  • 88. Types  Monolithic kernel  Micro kernel  Hybrid kernel  Exo kernel
  • 89. Monolithic kernel  Traditional UNIX uses  OS runs as a single program in kernel mode  Operations done via system call  LINUX and Free BSD uses modern ML
  • 90. Micro kernel  Provides minimal services such as defining memory address space, IPC and process management.  Provides communication facility between client programs  Communication takes place using message passing  Microkernel runs in kernel mode and rest run in user mode
  • 91.  Ex: - Mach OS - Windows NT - QNX real time OS
  • 93. Modules  Many modern operating systems implement loadable kernel modules  the kernel has a set of core components and links in additional services via modules  This type of design is common in modern implementations of UNIX, such as Solaris, Linux, and Mac OS X, as well as Windows
  • 94.  The Solaris operating system structure, is organized around a core kernel with seven types of loadable kernel modules: 1. Scheduling classes 2. File systems 3. Loadable system calls 4. Executable formats 5. STREAMS modules 6. Miscellaneous 7. Device and bus drivers
  • 96. Hybrid Systems  Most modern operating systems are actually not one pure model ◦ Hybrid combines multiple approaches to address performance, security, usability needs ◦ Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality ◦ Windows mostly monolithic, plus microkernel for different subsystem personalities  Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa programming environment
  • 97. System Calls  System calls provide an interface between running program and an operating system.  OS provides services and system call provides interface to these services  Typically written in a high-level language (C or C++)  A system call is an explicit request to kernel mode via software interrupt.  It is like procedure call but system call enters kernel.  All system call return an integer value.  In the kernel positive or 0 denote successful termination and negative value denotes error
  • 98.  Mostly accessed by programs via a high- level Application Programming Interface (API) rather than direct system call use  Application developers design programs according to an application programming interface (API).  Three most common APIs are - Win32 API for Windows, - POSIX API for POSIX-based systems and - Java API for the Java virtual machine (JVM)
  • 99.  Three general methods are used to pass parameters to the operating system. 1. The simplest approach is to pass the parameters in registers. This is the approach taken by Linux and Solaris. 2. Parameters also can be placed, or pushed, onto the stack by the program and popped off the stack by the operating system. 3. The parameters are generally stored in a block, or table in memory, and the address of the block is passed as a parameter in a register
  • 100. API – System Call – OS Relationship
  • 102. Types of System Calls System calls can be grouped roughly into six major categories:  file management,  process management,  I/O device management,  information processing and maintenance,  Inter process communications  protection
  • 103. File management ◦ create file, delete file ◦ open, close file ◦ read, write, reposition ◦ get and set file attributes
  • 104. Process management ◦ create process, terminate process ◦ end, abort ◦ load, execute ◦ get process attributes, set process attributes ◦ wait for time ◦ wait event, signal event ◦ allocate and free memory ◦ Dump memory if error ◦ Debugger for determining bugs, single step execution ◦ Locks for managing access to shared data between processes
  • 105. Inter process communications Pipe, socket, message passing and shared memory are used foe IPC. System calls: ◦ Send message, receive messages ◦ create, delete connection ◦ attach and detach remote devices
  • 106. I/O Device management ◦ request device, release device ◦ read, write, reposition ◦ get device attributes, set device attributes ◦ logically attach or detach devices
  • 107. Information processing and maintenance ◦ get time or date, set time or date ◦ get system data, set system data ◦ get and set process, file, or device attributes
  • 108. Protection  Protection provides a mechanism for controlling access to the resources provided by a computer system.  Historically, protection was a concern only on multi programmed computer systems with several users. ◦ Control access to resources ◦ Get and set permissions ◦ Allow and deny user access
  • 109. Examples of Windows and Unix System Calls
  • 110. System Programs  Modern OS is a collection of system programs.  Provide application programming environment on hardware for program development and execution ◦ Some of them are simply user interfaces to system calls; others are considerably more complex Categories of system calls:  File management - Create, delete, copy, rename, print, dump, list, and generally
  • 111.  Status information ◦ Some ask the system for info - date, time, amount of available memory, disk space, number of users ◦ Others provide detailed performance, logging, and debugging information ◦ Typically, these programs format and print the output to the terminal or other output devices ◦ Some systems implement a registry - used to store and retrieve configuration information
  • 112.  File modification ◦ Text editors to create and modify files ◦ Special commands to search contents of files or perform transformations of the text  Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided
  • 113.  Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language  Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems ◦ Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another
  • 114.  Background Services ◦ Launch at boot time  Some for system startup, then terminate  Some from system boot to shutdown ◦ Provide facilities like disk checking, process scheduling, error logging, printing ◦ Run in user context not kernel context ◦ Known as services, subsystems, daemons  Application programs ◦ Don’t pertain to system ◦ Run by users ◦ Not typically considered part of OS ◦ Launched by command line, mouse click,
  • 115. Operating System Generation n Operating systems are designed to run on any of a class of machines;  The system must then be configured or generated for each specific computer site, a process sometimes known as system generation SYSGEN.  The operating system is normally distributed on disk, on CD-ROM or DVD-ROM.  To generate a system, we use a special program.  This SYSGEN program reads from a given file, or asks the operator of the system for information concerning the specific configuration of the hardware system, or probes the hardware directly to determine what components are there
  • 116. System Boot  Boot strap program is stored in ROM  Boot strap program loads and executes boot program  Boot program is stored in disk in predetermined address called boot sector  Boot program loads OS into memory(Boot strapping)
  • 117. Operating-System Operations  Interrupt driven (hardware and software) ◦ Hardware interrupt by one of the devices ◦ Software interrupt (exception or trap):  Software error (e.g., division by zero)  Request for operating system service  Other process problems include infinite loop, processes modifying each other or the operating system
  • 118. Operating-System Operations  Dual-mode operation allows OS to protect itself and other system components ◦ User mode and kernel mode(Monitor mode) ◦ Mode bit provided by hardware ◦ Mode bit – 0 for monitor mode and 1- user mode  Provides ability to distinguish when system is running user code or kernel code  Booting – monitor mode  Some instructions designated as privileged, only executable in kernel mode  When interrupt occurs mode changes from
  • 119. Clustered system  Group of computer system connected with high speed communication link  Each computer has own memory  Integrated with H/W Cluster and S/W cluster  H/W cluster - sharing disks, S/W – control  Two types: 1.Symmetric 2.Asymmetric
  • 120.  Asymmetric: - One machine is in standby mode and monitors server while others run applications. If server fails this machine acts as server.  Symmetric: Each host monitors other host
  • 121. Distributed system  Computers connected via N/W  Distributed OS needed.  Resource sharing across computers and users feel like using single machine Adv: 1.Resource sharing 2.High reliability 3.Better price performance ratio 4.Response time and throughput 5.Incremental growth Ex: Amoeba, chrous, mach and v-system
  • 122. Network Operating system  User can login to remote resources and access  Machines connected via communication link  File transfer possible  Supports multiple user accounts Ex: Telnet
  • 123. Real time OS  Time constraints is the key parameter  Used in robotics, satellites  Types: 1.Hard real time system – Highly restricted 2.Soft real time system – Relaxed time bound
  • 124. Handheld systems  Physical size is handheld  Ex: Mobile phone  Slow processor, small display, less memory  OS Ex: Blackberry, Android, Windows  Uses wireless technology(BT, Wi-Fi)