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

Unit 1

Uploaded by

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

Unit 1

Uploaded by

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

Operating Systems – Unit 1

Learning Objectives
• Definition of OS
• Goals of OS
• Various Computing systems
• Components of OS
• Services offered by OS
• System calls
• System programs
Components of a Computer
System
• Hardware
• System programs
• Application programs
• Operating system
• Users
Use Use Use Use
r1 r1 r1 … r1

CompilerAssemblerText Editor…Database System

System and Application Programs


Operating System
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.
Definition of Operating System
• Resource allocator – manages and allocates
resources.
• Control program – controls the execution of
user programs and operations of I/O devices
.
• Kernel – the one program running at all
times (all else being application programs).
Types of Computers
• Mainframe Systems
• Desktop Systems
• Multiprocessor Systems
• Distributed Systems
• Clustered System
• Real -Time Systems
• Handheld Systems
Mainframe Systems
• Reduce setup time by batching similar jobs
• Automatic job sequencing – automatically
transfers control from one job to another. First
rudimentary operating system.
• Resident monitor
– initial control in monitor
– control transfers to job
– when job completes control transfers pack to monitor
Types of Mainframe systems
• Batch systems
• Multi-programming systems
• Time-shared systems
Simple Batch System
• Only one program run at a time.
• These are called as jobs
• Simple operating system
• No user interface
• The major task of the operating system was
transferring control from one job to another
automatically.
• The operating system stayed in the memory.
Memory Layout for a Simple Batch
System
Multi-programmed Batch System

• More number of jobs will be given or


execution.
• The jobs that are ready for system attention
pooled and is called as job pool.
• A program, which is selected for running
and stored in main memory, is called as a
process.
Various aspects of Multi-
programmed Batch System
• Selecting a subset of jobs from the set of
jobs that are ready is called as Job
scheduling.
• Managing the allocation of main memory is
called as Memory management.
• Finding the sequencing of jobs (forming a
queue) to get executed by CPU is called as
CPU Scheduling
The decisions taken by operating
system
• Selecting the subset of jobs from the pool of
jobs.
• Sequencing all jobs for execution.
• Among all ready to run jobs, selecting a job
for execution.
Memory Layout for Multi-
programmed Batch System
Time-Sharing Systems–Interactive
Computing
• The CPU is multiplexed among several jobs that are
kept in memory and on disk (the CPU is allocated to a
job only if the job is in memory).
• A job swapped in and out of memory to the disk.
• On-line communication between the user and the
system is provided
• When the operating system finishes the execution of
one command, it seeks the next “control statement”
from the user’s keyboard.
• On-line system must be available for users to access
data and code.
Desktop Systems
• User interface is prominent
• Personal computers – computer system dedicated
to a single user.
• User convenience and responsiveness.
• Individuals have sole use of computer and do not
need advanced CPU utilization of protection
features.
• May run several different types of operating
systems (Windows, MacOS, UNIX, Linux)
Multiprocessor systems
• Also called as parallel system
• With more than on CPU in close communication.
• Tightly coupled system – processors share memory and
a clock; communication usually takes place through
the shared memory.
• :
– Increased throughput
– Economical
– Increased reliability
• graceful degradation
• fail-soft systems
Advantages of Multi-Processor
system
• Increased throughput
• Economical
• Increased reliability
– graceful degradation
– fail-soft systems
Types of Multi-Processor
Systems
• Symmetric multiprocessing (SMP)
– Each processor runs and identical copy of the
operating system.
– Many processes can run at once without
performance deterioration.
– Most modern operating systems support SMP
• Asymmetric multiprocessing
– Each processor is assigned a specific task; master
processor schedules and allocated work to slave
processors.
– More common in extremely large systems
Architecture of Symmetric
Multiprocessing
Distributed Systems
• Distribute the computation among several
physical processors.
• Loosely coupled system – each processor
has its own local memory
• Processors communicate with one another
through various communications lines, such
as high-speed buses or telephone lines.
• Requires networking infrastructure
Advantages of distributed
systems.
• Resources Sharing
• Computation speed up – load sharing
• Reliability
• Communications
Types of distributed systems.

• Client-server systems
• Peer-to-peer systems.
Structure of Client-Server
Clustered Systems
• Clustering allows two or more systems to
share storage.
• Provides high reliability.
• Asymmetric clustering: one server runs the
application while other servers standby.
• Symmetric clustering: all N hosts are
running the application.
Real-Time Systems
• Well-defined fixed-time constraints.
• Used in a dedicated application such as
controlling scientific experiments, medical
imaging systems, industrial control systems,
and some display systems.
Types of Real-Time Systems
• Hard real-time:
– Secondary storage limited or absent, data stored in
short term memory, or read-only memory (ROM)
– Conflicts with time-sharing systems, not supported by
general-purpose operating systems.

• Soft real-time
– Limited utility in industrial control of robotics
– Useful in applications (multimedia, virtual reality)
requiring advanced operating-system features
Handheld Systems
• Personal Digital Assistants (PDAs)
• Cellular telephones
• Issues:
– Limited memory
– Slow processors
– Small display screens.
System Components
• Process Management
• Main Memory Management
• File Management
• I/O System Management
• Secondary Management
• Networking
• Protection System
• Command-Interpreter System
Process Management
• A process is a program in execution.
• A process needs following resources, to
accomplish its task.
– CPU time
– Memory
– Files
– I/O devices,
Activities in connection with
Process management
• Process creation and deletion
• Process suspension and resumption.
• Provision of mechanisms for:
– process synchronization
– process communication
Main-Memory Management
• Memory is a large array of words or bytes,
each with its own address.
• Main memory is a volatile storage device.
It loses its contents in the case of system
failure.
Activities in connection with
Main-Memory Management
• Keep track of which parts of memory are
currently being used and by whom.
• Decide which processes to load when
memory space becomes available.
• Allocate and de-allocate memory space as
needed.
File Management
• A file is a collection of related information
defined by its creator.
• In general, files represent programs (both
source and object forms) and data.
Activities in connection with
File Management

• File creation and deletion


• Directory creation and deletion.
• Support of primitives for manipulating files
and directories.
• Mapping files onto secondary storage.
• File backup on stable (nonvolatile) storage
media.
I/O System Management
• A buffer-caching system
• A general device-driver interface
• Drivers for specific hardware devices
Secondary-Storage Management
• Main memory (primary storage) is volatile
and too small.
• Main memory cannot accommodate all
data and programs permanently
• Hence, the computer system must provide
secondary storage to back up main
memory.
Activities in connection with
Secondary-Storage Management

• Free space management


• Storage allocation
• Disk scheduling
Networking
• This is a necessary component in distributed
systems.
• A distributed system provides user access to
various system resources
• A distributed system is
– a collection processors
– do not share memory or a clock.
– Each processor has its own local memory.
• The processors in the system are connected
through a communication network.
Advantages of Distributed
systems
• Access to a shared resource allows:
– Computation speed-up
– Increased data availability
– Enhanced reliability
Protection System
• Protection is to control the access by
programs, processes, or users to both
system and user resources.
• The protection mechanism must:
– distinguish between authorized and
unauthorized usage.
– specify the controls to be imposed.
– provide a means of enforcement.
Command-Interpreter System
• The program that reads and interprets
control statements.
• Various names of command interpreter are
– command-line interpreter
– shell (in UNIX)
Command-Interpreter System
(Conti…)
• In general, commands are given to the operating
system by control statements which deal with:
– process creation and management
– I/O handling
– secondary-storage management
– main-memory management
– file-system access
– protection
– networking
Operating System Services
• Program execution
• I/O operations
• File-system manipulation – program capability to
read, write, create, and delete files.
• Communications
– shared memory
– message passing.
• Error detection – ensure correct computing by
detecting errors in the CPU and memory hardware,
in I/O devices, or in user programs.
Communication Models
Additional Operating System
Functions
• Resource allocation – allocating resources to
multiple users or multiple jobs running at the
same time.
• Accounting – keep track of and record which
users use how much and what kinds of
computer resources for account billing or for
accumulating usage statistics.
• Protection – ensuring that all access to system
resources is controlled
System Calls
• System calls provide the interface between a
running program and the operating system.
• Available as assembly-language instructions
• Languages like C and C++ allow system calls to
be made directly.
• Windows operating system are included in Win32
application programmer interface (API).
Parameter Passing
• Three general methods are used to pass
parameters
– Pass parameters in registers.
– Store the parameters in a table in memory, and
the table address is passed as a parameter in a
register.
– Push (store) the parameters onto the stack by
the program, and pop off the stack by operating
system.
Passing of Parameters As A
Table
Types of System Calls
• Process control
• File management
• Device management
• Information maintenance
• Communications
Process creation and maintenance
in MS-DOS
• . MS-DOS - single task operating system.
• First, the command interpreter is alone
loaded into the main memory.
• Then, program to be executed is loaded into
the main memory.
• Limited concurrent execution of processes -
terminate and stay resident system call.
MS-DOS Execution
Process creation and maintenance
in UNIX
• A shell will become active - a user logs in.
• Shell is a command interpreter.
• Unix is a multitasking operating system.
• Create process – Shell executes a fork system call
• Exec system call – To run a loaded process.
• When the process is completed shell executes exit
system call
UNIX Running Multiple
Programs
System Programs
• System programs provide a convenient
environment for program development and
execution.
• Most users’ view of the operation system is
defined by system programs, not the actual
system calls.
Division of System Programs
• File manipulation
• Status information
• File modification
• Programming language support
• Program loading and execution
• Communications
• Application programs
MS-DOS System Structure
• MS-DOS – written to provide the most
functionality in the least space
– not divided into modules
– Although MS-DOS has some structure, its
interfaces and levels of functionality are not
well separated
MS-DOS Layer Structure
UNIX System Structure
• UNIX – limited by hardware functionality
• The UNIX OS consists of two separable parts.
– Systems programs
– The kernel
• Consists of everything below the system-call interface and
above the physical hardware
• Provides the file system, CPU scheduling, memory
management, and other operating-system functions; a large
number of functions for one level.
UNIX System Structure
END of UNIT 1

You might also like