0% found this document useful (0 votes)
11 views43 pages

Oslecture 1

The document provides an overview of operating systems, detailing their definition, goals, and types, including batch, multiprogrammed, time-sharing, and real-time systems. It discusses the structure and components of operating systems, such as process management, memory management, and system calls, as well as the importance of understanding operating systems for efficient resource management and application development. Additionally, it covers the evolution of early systems and the need for specialized operating systems in modern computing.

Uploaded by

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

Oslecture 1

The document provides an overview of operating systems, detailing their definition, goals, and types, including batch, multiprogrammed, time-sharing, and real-time systems. It discusses the structure and components of operating systems, such as process management, memory management, and system calls, as well as the importance of understanding operating systems for efficient resource management and application development. Additionally, it covers the evolution of early systems and the need for specialized operating systems in modern computing.

Uploaded by

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

Outline

• What is an operating system?


• Early Operating Systems
• Types of Operating System
-Batch Operating Systems
-Multi programmed Systems
-Time-sharing Systems
-Real-time Systems

1
Cont..
• Operating – System Structures
- System Components
- Operating System Services
- System Calls
- System Programs
What is an Operating System?
• An OS is a program that manages the computer
hardware and also provide a basis for
application programs and acts as an
intermediary between a user of a computer and
the computer hardware.
• Major cost of general purpose computing is
software.
– OS simplifies and manages the complexity
of running application programs efficiently.
3
Goals of an Operating System
• Simplify the execution of user programs and
make solving user problems easier.
• Use computer hardware efficiently.
– Allow sharing of hardware and software
resources.
• Make application software portable and
versatile.

4
Contd..
• Provide isolation, security and protection
among user programs.

• Improve overall system reliability


• error confinement, fault tolerance,
reconfiguration

5
Why should I study Operating
Systems?
– Need to understand interaction between the
hardware and applications

• New applications, new hardware..

– Need to understand basic principles in the


design of computer systems
• efficient resource management, security,
flexibility
6
Contd..
– Increasing need for specialized operating
systems

• e.g. embedded operating systems for devices -


cell phones, sensors and controllers

• real-time operating systems - aircraft control,


multimedia services

7
8
Computer System Components
• Hardware
– Provides basic computing resources (CPU, memory, I/O
devices).
• Operating System
– Controls and coordinates the use of hardware among
application programs.
• Application Programs
– Solve computing problems of users (compilers, database
systems, video games, business programs such as banking
software).
• Users
– People, machines, other computers
9
Abstract View of System

User
1 User User User
2 3 ... n

compiler assembler Text editor Database


system
System and Application Programs

Operating System

Computer
Hardware

10
Operating System Views
• Resource allocator
• to allocate resources (software and hardware) of
the computer system and manage them efficiently.
• Control program
• Controls execution of user programs and operation
of I/O devices.
• Kernel
• The program that executes forever (everything else
is an application with respect to the kernel).

11
Early Systems - Bare Machine
(1950s)
• Structure
• Large machines run from console
• Single user system, Programmer/User as operator
• Paper tape or punched cards
• Early software
• Assemblers, compilers, linkers, loaders, device
drivers, libraries of common subroutines.
• Secure execution
• Inefficient use of expensive resources
• Low CPU utilization, high setup time. 12
Types of Operating System

- Batch Operating Systems


-Multi programmed Operating
Systems
-Time-sharing Systems
-Real-time Systems
Batch Operating Systems
(1960’s)
– Early computers ware fairly simple.
– Major task was to transfer control automatically from
one job to the next.
– To speed up processing ,the computer operator
batched together jobs with similar requirements.
– Programmers would leave their programs with the
operator.
– The operator would sort programs into batches with
similar requirments and as the computer became
available, would run each batch.

14
Contd..
– The output from each job would be sent back
to the appropriate programmer.
- For eg. Five jobs coded in
C,Java,C,Pascal,Java appear in this
sequence. So the Operating System has to
first load C compiler for first program then
Java compiler for the second program and
then reload C compiler for the third program
and so on.
- Reduce the total execution time of the five
programs. 15
Memory Layout fo Batch
Operating System
Contd..
– Problem
1. Lack of interaction between the user and
the job.
2. CPU is often idle, because the speed of
the I/O devices is slower than the CPU.
3. Difficult to provide the desired priority.
Multi programmed Systems
- The operating system keeps several jobs
in memory simultaneously.
- This set of jobs is a subset of the jobs
kept in the job pool.
- The operating system picks and begins to
execute one of the jobs in the memory.
- At the end, the job may have to wait for
some task,such as an I/O operation to
complete.

18
Contd..
- In a multiproframming system,the O.S
simply switches to, and executes, another
job. When the job needs to wait, the CPU
is switched to another job and so on. At
the end the first job finishes waiting and
gets CPU back.
- CPU bound: When CPU has an
instruction for processing or computation
Cont…
- I/O bound: There is a request to an I/P or O/P
device to read or write. During the I/O bound
instructions, CPU is not doing work and is idle.
- Advantages:
1. Less execution time as compared to batch
system
2. Increased utilization of memory
3. Increased throughput.
Memory Layout for
Multiprogrammed Systems
Several jobs are kept in main memory at the same time, and the
CPU is multiplexed among them.
Time-sharing System
• It is a logical extension of multiprogramming .
• The CPU executes multiple jobs by switching among
them.
• The switches occur so frequently that the user can
interact with each program while it is running.
• It allows many user to share the computer
simultaneously.
• A time shared O.S. uses CPU scheduling and
Multiprogramming to provide each user with a small
portion of time shared computer.
22
Contd..
• Each user has at least one separate program in
memory.
• It is more complex than multiprogrammed O.S.
• It also provide a file system.
• It is used in CPU scheduling.

23
Real-time systems
• A real time system is used when rigid time
requirements have been placed on the
operation of a processor.
• It is used as a control device in a dedicated
application.
• Sensors bring data to the computer and analyze
the data and adjust controls to modify the
sensor inputs.
24
Contd..
• Batch System and time sharing systems are
desirable,which may have no time constraints at all.
• Real time system come into two flavors
• Hard real-time systems -
• Failure if response time too long.
• Secondary storage is limited
• Soft real-time systems -
• Less accurate if response time is too long.
• Useful in applications such as multimedia, virtual
reality.
25
Personal Computing Systems
• Single user systems, portable.
• I/O devices - keyboards, mouse, display screens,
small printers.
• Laptops , Smart cards, Wireless devices.
• Single user systems may not need advanced CPU
utilization or protection features.
• Advantages:
– user convenience, responsiveness, ubiquitous

26
Operating System Structures

• System Components
– Process Management
– Memory Management
– Secondary Storage Management
– I/O System Management
– File Management
– Protection System
– Networking
– Command-Interpreter System.
Process Management

• Process - fundamental concept in OS


– Process is a program in execution.
– Process needs resources - CPU time, memory,
files/data and I/O devices.
• OS is responsible for the following process
management activities.
– Process creation and deletion
– Process suspension and resumption
– Process synchronization and interprocess
communication
– Process interactions - deadlock detection, avoidance
and correction
Memory Management

• Main Memory is an array of addressable words


or bytes that is quickly accessible.
• Main Memory is volatile.
• OS is responsible for:
• Allocate and deallocate memory to processes.
• Managing multiple processes within memory -
keep track of which parts of memory are used by
which processes. Manage the sharing of memory
between processes.
• Determining which processes to load when
memory becomes available.
Secondary Storage Management
• Since primary storage is expensive and volatile,
secondary storage is required for backup.
• Disk is the primary form of secondary storage.
– OS performs
– storage allocation,
– free-space management
– disk scheduling.
File System Management
• File is a collection of related information defined
by creator - represents programs and data.

• OS is responsible for
– File creation and deletion
– Directory creation and deletion
– Supporting primitives for file/directory manipulation.
– Mapping files to disks (secondary storage).
– Backup files on archival media (tapes).
I/O System Management
• I/O system in the OS consists of
– Buffer caching and management
– Device driver interface that abstracts device details
– Drivers for specific hardware devices
Protection and Security

• Protection mechanisms control access of programs


and processes to user and system resources.
– Protect user from himself, user from other users, system
from users.
• Protection mechanisms must:
– Distinguish between authorized and unauthorized
use.
– Specify access controls to be imposed on use.
– Provide mechanisms for enforcement of access
control.
– Security mechanisms provide trust in system and
privacy
• authentication, certification, encryption etc.
Networking (Distributed
Systems)
• Distributed System is a collection of processors
that do not share memory or a clock.
• Processors are connected via a communication
network.
• Advantages:
– Allows users and system to exchange information
– provide computational speedup
– increased reliability and availability of information
Command Interpreter System

• Commands that are given to the operating


system via command statements that execute
– Process creation and deletion, I/O handling,
Secondary Storage Management, Main Memory
Management, File System Access, Protection,
Networking.
• Obtains the next command and executes it.
• Programs that read and interpret control
statements also called -
– Control card interpreter, command-line interpreter,
shell (in UNIX)
Operating System Services

• Services that provide user-interfaces to OS


• Program execution - load program into memory
and run it
• I/O Operations - since users cannot execute I/O
operations directly
• File System Manipulation - read, write, create,
delete files
• Communications - interprocess and intersystem
• Error Detection - in hardware, I/O devices, user
programs
Contd..
•Resource Allocation - for
simultaneously executing jobs
•Accounting - for account billing and
usage statistics
•Protection - ensure access to system
resources is controlled
System Calls

• System calls provide the Interface between a


running program and the Operating System.
– Generally available as assembly language
instructions.
– Some higher level languages allow system calls to be
made directly (e.g. C,C++)
• Three general methods are used to pass
parameters between a running program and the
Operating System.
- Pass parameter in a registers
Cont..
• 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.
• Unix has about 32 system calls
– read(), write(), open(), close(), fork(), exec(),
ioctl(),…..
Types of System Calls
• Process Control: end, abort, load, execute,
create process, terminate process, get process
attributes, set process attributes.
• File management: create file, delete file,
open,close, read, write.
• Device management: request device, release
device, read, write, reposition, get device
attribute, set device attributes.
Cont…
• Information maintenance: get time or
date, set time or date, set system data,
get process, get system data.
• Communications: create, delete
communication connection, send, receive
messages, transfer status information,
attach or detach remote devices.
System Program
• System programs provides a convenient
environment for program development and
execution.
• They can be divided into:
- File manipulation
- Status information
- File modification
- Programming language support
- Program loading and execution
Cont..
- Communications
- Application programs
• Most users view of the operating system
is defined by system programs, not the
actual system calls

You might also like