Sunteți pe pagina 1din 24

What is an Operating System?

• A program that controls the execution of


application programs
• An interface between applications and hardware
• Manages computer resources.
• Masks the details of the hardware
• Operating system goals:
– Execute user programs and make solving user
problems easier.
– Make the computer system convenient to use.
(Primary goal)
– Use the computer hardware in an efficient
manner.(Secondary goal)
Operating System Objectives
• Convenience
– Makes the computer more convenient to use
• Efficiency
– Allows computer system resources to be used
in an efficient manner
• Ability to evolve
– Permit effective development, testing, and
introduction of new system functions without
interfering with service
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
Four Components of a Computer
System
Functions of an Operating System / Services
provided by an Operating System
• 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)
– 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.
Functions of an Operating System / Services
provided by an Operating System
– 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
Functions of an Operating System / Services
provided by an Operating System
• 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,mainmemory, 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 A good operating
system keeps usage statistics for various resources and
monitor performance parameters such as response time.
For example in windows it gives you information about
performance, disk usage or job queues for printing.
Functions of an Operating System / Services
provided by an Operating System
– 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
• 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
– including denial-of-service, worms, viruses, identity theft, theft of service
• 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
Operating system
• Operating system can be explored from two
viewpoints:
– User View
– System View
• The user view of the computer system varies by the
interface being used.
– System designed for one user to monopolize its resources,
to maximize the work that the user is performing.
Operating system is designed for ease of use.
– Users which access the same computer through other
terminals share resources and exchange information. The
operating system is designed to maximize resources
utilization- to assure that all available CPU time, memory,
and I/O are used efficiently, and that no user takes more
than her fair share.
System View
• From the computer’s point of view, the operating system is the
program that is most intimate with the hardware. The OS can be
viewed as:
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for efficient and fair resource use
– Must be fair; not partial to any process, specially for process in the same
class
– Must discriminate between different class of jobs with different service
requirements
– Do the above efficiently
• Within the constraints of fairness and efficiency, an OS should attempt to
maximize throughput, minimize response time, and accommodate as many
users as possible
• OS is a control program
– Controls execution of programs to prevent errors and improper use of
the computer
Classes of OS
OS Class Periods Prime Concern

Batch 60’s CPU idle time


Processing
Multiprogram 70’s Resource utilization
ming
Time sharing 70’s Good response time

Real time 80’s Meet the deadlines

Distributed 90’s Resource sharing


Batch Operating System
• Batch jobs together with similar needs and
run them through the computer as group.
• Batch processing generally requires the
program, data and appropriate system
commands to be submitted together in the
form of job
• Batch operating systems usually allow
little or no interaction between the users
and the executing programs.
Batch Operating System
• Scheduling in batch system is very simple. Jobs
are typically processed in the order of
submission that is in first-come, first - served.
• Memory management in batch systems is also
very simple. Memory is usually divided into two
areas.
• In this execution environment, the CPU is often
idle, because the speeds of the mechanical I/O
devices are intrinsically slower than are those of
the electronic devices.
Multiprogramming OS
• When one job needs to wait for I/O, the
processor can switch to the other job
Multiprogramming OS
• 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
– If several jobs ready to run at the same time CPU
scheduling
– When it has to wait (for I/O for example), OS switches
to another job
– Process Scheduling, disk storage, and memory
management
Time Sharing OS
• 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
• Processor’s time is shared among multiple users
– Response time should be < 1 second
– Each user has at least one program executing in memory
process
– 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
Time Sharing OS
• In time-sharing systems, several jobs must be
kept simultaneously in memory (job-scheduling
technique – Round Robin method), the system
must have memory management and protection.
To obtain reasonable response time virtual
memory concept is used.
• To ensure orderly execution, the system must
provide mechanisms for job synchronization and
communication, and it may ensure that the job
do not get stuck in a deadlock.
Real Time systems
• Real – time computing may be defined as
that type of computing in which the
correctness of the system depends not
only on the logical result of the
computation but also on the time at which
results are produced.
– A hard real – time
– A soft real – time
Real Time systems
• A hard real-time task must meet its deadline;
otherwise it will cause undesirable damage or fatal
error to the system.
• Secondary storage is usually limited or missing, data
stored in ROM
• Virtual memory is absent (Time Sharing)
• Also called as special purpose OS
• A soft real – time task has an associated deadline,
which is desirable but not mandatory; it still makes
sense to schedule and complete the task even if it has
passed its deadline. (E.g. Digital audio or multimedia
system)
Multiprocessor Systems
• Multiprocessor systems (also known as parallel
systems or tightly coupled systems) have more
than one processor in close communication,
sharing the computer bus, memory and peripheral
devices
– Increased throughput: By increasing the number of
processors, more work is done in less time
– Economy of scale: Multiprocessor systems can save
more money than multiple single – processor systems,
because they can share peripherals, mass storage, and
power supplies.
– Increased – reliability:
• graceful degradation (Fault tolerant)
Multiprocessor Systems
• Symmetric multiprocessing (SMP) in which each processor
run on an identical copy of the operating system, and these
communicate with one another as needed. SMP means that
all processor are peers; no master – slave relationship exists
between processors.
• Asymmetric multiprocessing, in which each processor is
assigned a specific task. A master processor controls the
system; the other processor either look to the master for
instruction or have predefined tasks. This defines a master-
slave relationship. The master processor schedules and
allocates work to the slave processors. The disadvantages of
this approach are:
a) A failure of the master brings down the whole system.
b) The master can become a performance bottleneck.
Distributed System
• A distributed computer system is a
collection of autonomous computer
systems capable of communication and
cooperation via their hardware and
software interconnections
– Client-Server Computing
– Peer-to-Peer System
Distributed System
• In client/server environment the client machines
are generally single- user PCs or workstations
that provide a highly user friendly interface to the
end user. Server provides the set of shared user
services to the clients.
• Compute-server provides an interface to client to request
services (i.e. database)
• File-server provides interface for clients to store and retrieve
files
Distributed System
– P2P does not distinguish clients and servers
• Instead all nodes are considered peers
• May each act as client, server or both
• Node must join P2P network
• These systems are usually referred to as
loosely coupled systems.

S-ar putea să vă placă și