III BCA B OS Unit I
III BCA B OS Unit I
1
Types of Operating System
Batch Systems
Mainframe Systems
Desktop Systems
Multiprocessor Systems
Distributed Systems
Clustered System
Real -Time Systems
Handheld Systems
Batch Systems
The users of batch operating system do not interact with the computer directly.
Each user prepares his job on an off-line device like punch cards and submits it
to the computer operator. To speed up processing, jobs with similar needs are
batched together and run as a group. Thus, the programmers left their programs
with the operator. The operator then sorts programs into batches with similar
requirements.
The problems with Batch Systems are following.
Lack of interaction between the user and job.
CPU is often idle, because the speeds of the mechanical I/O devices is slower
than CPU.
Difficult to provide the desired priority
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
o initial control in monitor
o control transfers to job
o when job completes control transfers pack to monitor
2
Desktop Systems
Personal computers – computer system dedicated to a single user.
I/O devices – keyboards, mouse, display screens, small printers.
User convenience and responsiveness.
Can adopt technology developed for larger operating system’ often 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)
Multiprogrammed Systems
Multiprogramming is the ability to execute more than one programs to keep the
CPU or the I/O devices busy.
Several jobs are kept in main memory at the same time, and the CPU is
multiplexed among them.
It increases CPU utilization and thus increases throughput.
OS Features Needed for Multiprogramming
o I/O routine supplied by the system.
o Memory management – the system must allocate the memory to several
jobs.
o CPU scheduling – the system must choose among several jobs ready to
run.
o Allocation of devices.
Multiprocessor Systems
Multiprocessor systems have more than on CPU in close communication.
Tightly coupled system – processors share memory and a clock; communication
usually takes place through the shared memory.
Advantages of Multiprocessor system:
o Increased throughput - More work is done in less time
3
o Economical – saves money by sharing peripherals
o Increased reliability – failure of one processor will no halt the system.
graceful degradation
Fault tolerant systems
Symmetric multiprocessing (SMP)
o Each processor runs and identical copy of the operating system.
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.
Advantages of distributed systems.
o Resources Sharing
o Computation speed up – load sharing
o Reliability
o Communications
Distributed Systems Requires networking infrastructure.
Local area networks (LAN) or Wide area networks (WAN)
May be either client-server or peer-to-peer systems.
Client-server system
Client-server system can be classified as Compute-server system that executes
action and File-server system which provide file system interface where clients
can create update, read and delete files.
4
Clustered Systems
Clustering allows two or more systems coupled together to share storage and
linked via LAN.
Clustered system provides high reliability.
A layer of clustered software runs on the cluster nodes.
Each node can monitor one or more of the others.
Asymmetric clustering: one server runs the application while other servers
standby.
Symmetric clustering: all N hosts are running the application.
Real-Time Systems
Often used as a control device in a dedicated application such as controlling
scientific experiments, medical imaging systems, industrial control systems,
and some display systems.
It has a Well-defined fixed-time constraints.
Real-Time systems may be either hard or soft real-time.
Hard real-time: guarantees that critical tasks to be completed on time.
o Secondary storage limited or absent, data stored in short term memory,
or read-only memory (ROM)
o Conflicts with time-sharing systems, not supported by general-purpose
operating systems.
Soft real-time : a critical task gets priority over other tasks , and retains that
priority until it completes
o Limited utility in industrial control of robotics
o Useful in applications (multimedia, virtual reality) requiring advanced
operating-system features.
Handheld Systems
Personal Digital Assistants (PDAs)
Cellular telephones
Issues:
o Limited memory
o Slow processors
o Small display screens.
1. Process Management
A process is a program in execution. A process needs certain resources,
including CPU time, memory, files, and I/O devices, to accomplish its task.
The operating system is responsible for the following activities in connection
with process management.
Process creation and deletion.
process suspension and resumption.
Provision of mechanisms for:
process synchronization
process communication
2. Main-Memory Management
Memory is a large array of words or bytes, each with its own address. It is a
repository of quickly accessible data shared by the CPU and I/O devices.
Main memory is a volatile storage device. It loses its contents in the case of
system failure.
The operating system is responsible for the following activities in connections
with 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 deallocate memory space as needed.
3. File Management
A file is a collection of related information defined by its creator. Commonly,
files represent programs (both source and object forms) and data.
The operating system is responsible for the following activities in connections
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.
5. Secondary-Storage Management
6
Since main memory (primary storage) is volatile and too small to
accommodate all data and programs permanently, the computer system must
provide secondary storage to back up main memory.
Most modern computer systems use disks as the principle on-line storage
medium, for both programs and data.
The operating system is responsible for the following activities in connection
with disk management:
Free space management
Storage allocation
Disk scheduling
7. Protection System
8. Command-Interpreter System
Many 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
7
Operating System Services
Program execution – system capability to load a program into memory and to
run it.
I/O operations – since user programs cannot execute I/O operations directly,
the operating system must provide some means to perform I/O.
File-system manipulation – program capability to read, write, create, and delete
files.
Communications – exchange of information between processes executing
either on the same computer or on different systems tied together by a network.
Implemented via shared memory or message passing.
Error detection – ensure correct computing by detecting errors in the CPU and
memory hardware, in I/O devices, or in user programs.
Additional Operating System Functions
Additional functions exist not for helping the user, but rather for ensuring efficient
system operations.
• 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.
Generally available as assembly-language instructions.
Languages defined to replace assembly language for systems
programming 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 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
8
Types of System Calls
1. Process control
2. File management
3. Device management
4. Information maintenance
5. Communications
10
System Programs
System programs provide a convenient environment for program development
and execution. They can be divided into:
File management – These programs create , delete, copy, rename, print,
list and manipulate files/directories.
Status information – Maintains the date, time, number of users or similar
status information
File modification – Text editors are available for editing text.
Programming language support – Assemblers, Compilers, interpreters
for common PLs.
Program loading and execution – Loads program for execution.
Communications – Provides mechanism for creating virtual connections
and sending and receiving messages.
Application programs – DBMS, Spread sheets, games and etc.,.
Most users’ view of the operation system is defined by system programs, not
the actual system calls.
System Structure
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
Layered Approach
The operating system is divided into a number of layers (levels), each
built on top of lower layers. The bottom layer (layer 0), is the hardware;
the highest (layer N) is the user interface.
With modularity, layers are selected such that each uses functions
(operations) and services of only lower-level layers.
An Operating System Layer
12