Chapter 1
Chapter 1
INTRODUCTION:
A computer system has many resources (hardware and software), which may be required
to complete a task. The commonly required resources are input/output devices, memory,
file storage space, CPU, etc. The operating system acts as a manager of the above
resources and allocates them to specific programs and users, whenever necessary to
perform a particular task. Therefore the operating system is the resource manager i.e. it
can manage the resource of a computer system internally. The resources are processor,
memory, files, and I/O devices. In simple terms, an operating system is an interface
between the computer user and the machine.
It is very important for you that every computer must have an operating system in order
to run other programs. The operating system mainly coordinates the use of the hardware
among the various system programs and application programs for various users.
1. Controlling and coordinating the use of system resources like cpu time, memory,
clock, io devices etc
2. Providing convenient environment for the user to access available resources.
3. To increase the productivity of processing resources.
4. To use the computer hardware in an efficient manner
OS is divided into the layers in which the lowest layer represents the hardware
part and the highest layer represents its user interface ( os)
The two layers of OS are : KERNEL and the SHELL
KERNEL : Is the core of the OS. It controls the computer’s resources , alloting the
resources to the different users and tasks. It interacts directly with the hardware.
SHELL: this acts as a command interpreter for the kernel. This is the interface
between the user and the kernel.
An operating system is a large and complex system created by combining small pieces.
These pieces are well-defined parts of a system that have carefully defined inputs,
outputs, and functions. Though most OSs differ in structure, most of them have similar
components.
FILE MAMANGEMENT
PROCESS MANAGEMENT
SECURITY MANAGEMENT
NETWORK MANAGEMENT
1. File Management
A set of related information that represents programs, source forms, object forms, and
data is called a file. A data file can either be numeric, alphabetic, or alphanumeric.
Following are the features of file management:
2. Process Management
The process management component is the way to manage the multiple processes
running simultaneously on the OS. Process management manages all the running
processes and makes sure that all of them run efficiently. It also uses the memory
allocated to them and shuts them down when required.
The execution of a process must be in a sequence such that at least one instruction
executes on behalf of the process. Following are the features of process management:
I/O device management hides the variations of some hardware devices from the user.
Following are the features of I/O device management:
4. Network Management
Network management administers and manages computer networks. Its services include
performance management, fault analysis, network provisioning, and service quality
management.
In a distributed system all processors have their personal local memory. It is a collection
of computers or processors that are connected through a communication network and
the processors communicate with the help of communication lines, like fiber optics or
telephone lines.
Network management helps connect the network fully or partially so that users can
design routing and connection strategies with no connection and security issues.
➢ It offers user access to the various resources that the network shares.
➢ We can access shared resources. These help speed-up computation and offer data
availability and reliability.
➢ We can access different computing resources that vary in size and function like
microprocessors, minicomputers, and many general-purpose computer systems
with the help of distributed systems.
5. Main memory management
Main Memory comprises large amounts of storage or byte where each storage and byte
has an address. In order to conduct the process of memory management a sequence of
reads or writes of specific memory addresses is used. We map it to absolute addresses
and load it inside the memory in order to execute a program.
Memory management is mainly based on the system’s hardware design as each algorithm
needs the support of a hardware. It ensures fast storage so that the CPU can access it
directly. It is costly and has a low storage capacity. Despite this, in order to execute a
program, the program needs to be in the main memory.
Programs help access data in the main memory during execution. The main memory is
too small and cannot store all the data and programs permanently. Thus, secondary
storage acts as a backup to the main memory. Assemblers and compilers are stored on
the disk until they are loaded into the memory and use the disk for processing.
➢ Allocates storage
➢ Manages free space
➢ Disk scheduling
7. Security Management
It is necessary to protect the processes from each other’s activities. Security management
ensures that the operating files, memory, CPU, and other hardware resources have
proper authorization from the OS. No process can do its own I/O, this maintains the
integrity of peripheral devices.
1. The operating system mainly controls the allocation and use of the computing
System’s resources among the various user and tasks.
2. It mainly provides an interface between the computer hardware and the
programmer that simplifies and makes feasible for coding, creation of application
programs and debugging
1. User's View
2. System View
The user view of the computer refers to the interface being used. Such systems are
designed for one user to monopolize its resources, to maximize the work that the user is
performing. In these cases, the operating system is designed mostly for ease of use, with
some attention paid to performance, and none paid to resource utilization.
➢ USER INTERFACE
➢ PROGRAM EXECUTION
➢ I/O OPERATION
➢ FILE SYSTEM MANIPULATION
➢ ERROR DETECTION
➢ COMMUNICATION
ASHWINI.S. DIWAKAR, Assistant Professor SURANA COLLEGE
AUTONOMOUS
Department Of Computer Science
UNIT-I OPERATING SYSTEM-2024-25
The operating system can be viewed as a resource allocator also. A computer system
consists of many resources like - hardware and software - that must be managed
efficiently. The operating system acts as the manager of the resources, decides between
conflicting requests, controls the execution of programs, etc.
➢ RESOURCE MANAGEMENT
➢ PROTECTION AND SECURITY
➢ ACCOUNTING ( Memory space )
In the 1970s, Batch processing was very popular. In this technique, similar types of jobs
were batched together and executed in time. People were used to having a single
computer which was called a mainframe.
There are different users, and each user prepares their work in a standalone device, such
as punch cards in batch operating systems and sends them to a computer operator. The
various systems split and distribute similar tasks in batches to facilitate computing and
faster responses. A single operator takes similar jobs with similar needs and
requirements and then groups them into various batches. Similar kinds of jobs that share
similar needs and requirements. These types of operating systems are not used
nowadays.
The system put all of the jobs in a queue on the basis of first come first serve and then
executes the jobs one by one. The users collect their respective output when all the jobs
get executed.
The purpose of this operating system was mainly to transfer control from one job to
another as soon as the job was completed. It contained a small set of programs called the
resident monitor that always resided in one part of the main memory. The remaining part
is used for servicing job.
A punch card is a simple piece of paper stock that can hold data in the form of small,
punched holes, which are strategically positioned to be read by computers or machines.
It is an early computer programming relic that was used before the many data storage
advances relied upon today.
ADVANTAGES
➢ The overall time the system takes to execute all the programs will be reduced.
➢ The CPU utilization is low because the time taken in loading and unloading
batches is very high compared to execution time.
➢ Sometimes, jobs enter into an infinite loop due to some mistake.
ASHWINI.S. DIWAKAR, Assistant Professor SURANA COLLEGE
AUTONOMOUS
Department Of Computer Science
UNIT-I OPERATING SYSTEM-2024-25
➢ Meanwhile, if one job takes too much time, other jobs must wait.
In a multiprogramming environment, when a process does its I/O, The CPU can start the
execution of other processes. Therefore, multiprogramming improves the efficiency of
the system.
The operating system which can run multiple processes on a single processor is called a
multiprogramming operating system. There are different programs that want to get
executed. So these programs are kept in the ready queue. And are assigned to the CPU
one by one. If one process gets blocked, then other processes from the ready queue are
assigned to the CPU. The aim of this is optimal resource utilization and more CPU
utilization. In the below figure, different processes are there in RAM(main memory).
Some processes are waiting for the CPU, and process 2(which was previously executing)
is now doing I/O operations. So, CPU shifted to execute process.
ADVANTAGES OF MULTIPROGRAMMING OS
➢ Throughout the system, it increased as the CPU always had one program to
execute.
➢ Response time can also be reduced.
DISADVANTAGES OF MULTIPROGRAMMING OS
ASHWINI.S. DIWAKAR, Assistant Professor SURANA COLLEGE
AUTONOMOUS
Department Of Computer Science
UNIT-I OPERATING SYSTEM-2024-25
The Time-Sharing Operating System is a type of operating system in which the user can
perform more than one task and each task gets the same amount of time to execute. It is
also called a multitasking operating system.
It allows the user to perform more than one task at a time, each task getting the same amount
of time to execute. Hence, the name time sharing OS. Moreover, it is an extension of
multiprogramming systems. In multiprogramming systems, the aim is to make the maximum
use of the CPU. On the other hand, here the aim is to achieve the minimum response time of
CPU.
Therefore, all the tasks will run smoothly on the system. Hence, its name is also multitasking
operating system. Multiple jobs are running at the CPU time and also, they use the CPU
simultaneously. But, the switching between the tasks is very fast due to which the user feels
that all tasks are running at the same time.
The operating system performs time sharing through CPU scheduling and
multiprogramming. Let us study closely the process in a time sharing system. It is as follows:
➢ It is the division of CPU time for each process when more than one task are given
by the user.
➢ A short duration of time is chosen for each process. Moreover, this time duration is
very small in the order of 10-100 milliseconds. This time duration is known as time
slot, time slice, or quantum.
➢ Suppose three processes namely, P1, P2, and P3 are running on the system. Now,
suppose that the quantum is 4 nanoseconds (ns). Now, they will execute in the
following manner.
➢ Process P1 will execute for 4 ns, as soon a sit gets over, process p2 starts executing
for a duration of 4 ns. Further, when p2 gets complete process P3 executes for 4ns.
This process continues till all the processes gets complete.
➢ In this way, only one process runs at a time but, the switching between the
processes is very fast. Hence, the user feels that all the processes are running at the
same time.
The parallel processing system is designed to speed up the execution process of programs
by dividing them into multiple segments and processing them simultaneously. These
systems are called multiprocessor systems or tightly coupled systems.
It is an evolution of serial processing wherein tasks are broken down into manageable
tasks that can be executed concurrently. Further, each part is broken down into a series
of instructions executed simultaneously on different CPUs. The working of the parallel
operating system is such that the CPU and its components are divided into smaller parts,
each having full speed and power. In a normal operating system, once an I/O device is
identified, it will use the CPU to transfer the information into the memory before
performing any operations on it, like processing and transmitting. By parallel operating
systems, however, more data can be transferred and processed simultaneously, resulting
in quicker data transfer.
➢ VMware
➢ Microsoft Hyper-V
➢ Red Hat enterprise
➢ Oracle VM
A distributed operating system is one in which several computer systems connected through
a single communication channel. Moreover, these systems have their individual processors
and memory. Furthermore, these processors communicate through high-speed buses or
telephone lines. These individual systems that connect through a single channel are
considered as a single unit. We can also call them loosely coupled systems. The individual
components or systems of the network are nodes.
Advantages of Distributed OS
Disadvantages of Distributed OS
Spooling refers to putting data of various I/O jobs in a buffer. This buffer is a special area
in memory or hard disk which is accessible to I/O devices. An operating system does the
following activities related to the distributed environment:
➢ Handles I/O device data spooling as devices have different data access rates.
➢ Maintains the spooling buffer, which provides a waiting station where data can
rest while the slower device catches up.
➢ Maintains parallel computation because of the spooling process as a computer can
perform I/O in parallel order. It becomes possible to have the computer read data
from a tape, write data to disk, and write out to a tape printer while it is doing its
computing task.
Example of Spooling
o Many features can also be added to the Spooling printing process, like setting
priorities or notification when the printing process has been completed or
selecting the different types of paper to print on according to the user's choice.
ASHWINI.S. DIWAKAR, Assistant Professor SURANA COLLEGE
AUTONOMOUS
Department Of Computer Science
UNIT-I OPERATING SYSTEM-2024-25
Advantages of Spooling:
Disadvantages of Spooling:
The buffer is an area in the main memory used to store or hold the data temporarily.
In other words, buffer temporarily stores data transmitted from one place to another,
either between two devices or an application. The act of storing data temporarily in the
buffer is called buffering.
A buffer may be used when moving data between processes within a computer. Buffers
can be implemented in a fixed memory location in hardware or by using a virtual data
buffer in software, pointing at a location in the physical memory. In all cases, the data in
a data buffer are stored on a physical storage medium.
Most buffers are implemented in software, which typically uses the faster RAM to store
temporary data due to the much faster access time than hard disk drives. Buffers are
typically used when there is a difference between the rate of received data and the rate
of processed data, for example, in a printer spooler or online video streaming.
ADVANTAGES:
➢ It handles the speed mismatch between the producer and consumer of a data
stream.
➢ To adapt between devices that have different data – transfer sizes.
SYSTEM CALL
System call offers the services of the operating system to the user programs via API
(Application Programming Interface). System calls are the only entry points for the
kernel system.
In an interactive system, this type of program execution requires some system calls by
OS.
Step 1) The processes executed in the user mode till the time a system call interrupts it.
Step 2) After that, the system call is executed in the kernel-mode on a priority basis.
Step 3) Once system call execution is over, control returns to the user mode.,
There are commonly five types of system calls. These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communications
Process Control
This system calls perform the task of process creation, process termination, etc.
Functions:
File Management
File management system calls handle file manipulation jobs like creating a file, reading,
and writing, etc.
Functions:
➢ Create a file
➢ Delete file
➢ Open and close file
➢ Read, write, and reposition
➢ Get and set file attributes
Device Management
Device management does the job of device manipulation like reading from device
buffers, writing into device buffers, etc.
Functions:
Information Maintenance
It handles information and its transfer between the OS and the user program.
Functions:
Communication:
These types of system calls are specially used for inter process communications.
Functions:
VIRTUAL MACHINE
A virtual machine (VM) is a virtual environment which functions as a virtual computer
system with its own CPU, memory, network interface, and storage, created on a physical
hardware system.
VMs are isolated from the rest of the system, and multiple VMs can exist on a single piece
of hardware, like a server. That means, it as a simulated image of application software
and operating system which is executed on a host computer or a server.
It has its own operating system and software that will facilitate the resources to virtual
computers.
Definition: A Virtual Machine (VM) is a compute resource that uses software instead of
a physical computer to run programs and deploy apps. One or more virtual “guest”
machines run on a physical “host” machine.