0% found this document useful (0 votes)
12 views11 pages

Operating System Unit 1

The document provides a comprehensive overview of operating systems, covering their evolution, functions, and management of processes, memory, files, and devices. It discusses key concepts such as CPU scheduling, concurrency, deadlocks, and system calls, along with their types and examples. Additionally, it outlines the structure of operating systems, including kernel types and differences between firmware and operating systems.

Uploaded by

rksc098
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)
12 views11 pages

Operating System Unit 1

The document provides a comprehensive overview of operating systems, covering their evolution, functions, and management of processes, memory, files, and devices. It discusses key concepts such as CPU scheduling, concurrency, deadlocks, and system calls, along with their types and examples. Additionally, it outlines the structure of operating systems, including kernel types and differences between firmware and operating systems.

Uploaded by

rksc098
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/ 11

OPERATING SYSTEM

OPERATING SYSTEM
Module - I
OPERATING SYSTEMS OVERVIEW: Introduction, Evolution of operating system, operating
system operations, operating system structure, System Calls, Types of System Calls
Modul – II
PROCESS MANAGEMENT: Process concepts, process state, process control block,
scheduling queues, process scheduling, Interposes Communication, Threads and
implementation of threads.

CPU SCHEDULING: Objective and Criteria, CPU scheduling algorithms: FCFS, SJF, Priority
Scheduling, Round robin, multilevel queue scheduling and multilevel feedback queue
scheduling.

Modul- III
CONCURRENCY AND SYNCHRONIZATION: Process synchronization, critical section
problem, and its solutions. Semaphores, classical problems of synchronization:
readers and writers problem, dining philosophers problem, sleeping barber
problem.

Modul- IV
DEADLOCKS: Introduction, deadlock characterization, Resource allocation graph, Methods
for Handling Deadlocks: deadlock prevention, avoidance and deadlock detection, recovery
from deadlock.

Modul V
MEMORY MANAGEMENT: Introduction, memory allocation techniques, paging,
implementation of paging, segmentation and its implementation, segmentation with
paging, virtual memory, demand paging, page-replacement algorithms, thrashing and its
solution.

Modul VI
FILE SYSTEM: Concept of a file, access methods, directory structure, file system mounting,
file sharing, protection. File system implementation: file system structure, directory
implementation, allocation methods, free-space management, efficiency and
performance.

Mass-Storage Structure: Overview of mass storage structure, disk structure, disk


scheduling algorithms,

TEXT BOOKS:

1. ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, GREG GAGNE (2012), Operating


System Principles, 9th edition, Wiley India Private Limited, New Delhi.
REFERENCE BOOKS:

1|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
1. William Stallings, Operating Systems, Internals and Design Principles, 7th edition,
Pearson Education, India. 2.
2. Andrew S. Tanenbaum (2007), Modern Operating Systems, 2nd edition, Prentice
Hall of India, India. 3. Deitel & Deitel (2008), Operating systems, 3rd edition, Pearson

Module - I
OPERATING SYSTEMS

An Operating System (OS) is a software that acts as an interface between computer


hardware components and the user. Every computer system must have at least one
operating system to run other programs. Applications like Browsers, MS Office, Notepad
Games, etc., need some environment to run and perform its tasks.

The OS helps you to communicate with the computer without knowing how to speak the
computer’s language. It is not possible for the user to use any computer or mobile device
without having an operating system.

History Of OS
• Operating systems were first developed
in the late 1950s to manage tape storage

• The General Motors Research Lab


implemented the first OS in the early
1950s for their IBM 701

• In the mid-1960s, operating systems


started to use disks

• In the late 1960s, the first version of


the Unix OS was developed

• The first OS built by Microsoft was DOS. It was built in 1981 by purchasing the 86-
DOS software from a Seattle company

• The present-day popular OS Windows first came to existence in 1985 when a GUI was
created and paired with MS-DOS.

Functions of Operating System


Some typical operating system functions may include managing memory, files, processes,
I/O system & devices, security, etc.

Below are the main functions of Operating System:

2|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM

In an operating system software performs each of the function:

1. Process management: Process management helps OS to create and delete


processes. It also provides mechanisms for synchronization and communication
among processes.

2. Memory management: Memory management module performs the task of


allocation and de-allocation of memory space to programs in need of this resources.

3. File management: It manages all the file-related activities such as organization


storage, retrieval, naming, sharing, and protection of files.

4. Device Management: Device management keeps tracks of all devices. This module
also responsible for this task is known as the I/O controller. It also performs the task
of allocation and de-allocation of the devices.

5. I/O System Management: One of the main objects of any OS is to hide the
peculiarities of that hardware devices from the user.

6. Secondary-Storage Management: Systems have several levels of storage which


includes primary storage, secondary storage, and cache storage. Instructions and
data must be stored in primary storage or cache so that a running program can
reference it.

7. Security: Security module protects the data and information of a computer system
against malware threat and authorized access.

8. Command interpretation: This module is interpreting commands given by the and


acting system resources to process that commands.

3|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
9. Networking: A distributed system is a group of processors which do not share
memory, hardware devices, or a clock. The processors communicate with one
another through the network.

10. Job accounting: Keeping track of time & resource used by various job and users.

11. Communication management: Coordination and assignment of compilers,


interpreters, and another software resource of the various users of the computer
systems.

Features of Operating System (OS)


Here is a list important features of OS:

• Protected and supervisor mode


• Allows disk access and file systems Device drivers Networking Security
• Program Execution
• Memory management Virtual Memory Multitasking
• Handling I/O operations
• Manipulation of the file system
• Error Detection and handling
• Resource allocation
• Information and Resource Protection
Advantage of Operating System

• Allows you to hide details of hardware by


creating an abstraction
• Easy to use with a GUI
• Offers an environment in which a user may
execute programs/applications
• The operating system must make sure that the
computer system convenient to use
• Operating System acts as an intermediary
among applications and the hardware components
• It provides the computer system resources with
easy to use format
• Acts as an intermediator between all
hardware’s and software’s of the system

Disadvantages of Operating System

• If any issue occurs in OS, you may lose all the contents which have been stored in
your system

4|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
• Operating system’s software is quite expensive for small size organization which
adds burden on them. Example Windows
• It is never entirely secure as a threat can occur at any time

An operating system is a construct that allows the user application programs to interact
with the system hardware. Operating system by itself does not provide any function but it
provides an atmosphere in which different applications and programs can do useful work.
The major operations of the operating system are process management, memory
management, device management and file management. These are given in detail as
follows:

Process Management
The operating system is
responsible for managing the
processes i.e assigning the
processor to a process at a time.
This is known as process
scheduling. The different
algorithms used for process
scheduling are FCFS (first come
first served), SJF (shortest job
first), priority scheduling, round
robin scheduling etc.
There are many scheduling
queues that are used to handle
processes in process
management. When the
processes enter the system, they
are put into the job queue. The processes that are ready to execute in the main memory are
kept in the ready queue. The processes that are waiting for the I/O device are kept in the
device queue.

Memory Management
Memory management plays an important part in operating system. It deals with memory
and the moving of processes from disk to primary memory for execution and back again.
The activities performed by the operating system for memory management are −

• The operating system assigns memory to the processes as required. This can be done
using best fit, first fit and worst fit algorithms.
• All the memory is tracked by the operating system i.e. it nodes what memory parts are
in use by the processes and which are empty.

5|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
• The operating system deallocated memory from processes as required. This may
happen when a process has been terminated or if it no longer needs the memory.
Device Management
There are many I/O devices handled by the operating system such as mouse, keyboard, disk
drive etc. There are different device drivers that can be connected to the operating system
to handle a specific device. The device controller is an interface between the device and the
device driver. The user applications can access all the I/O devices using the device drivers,
which are device specific codes.

File Management
Files are used to provide a uniform view of data storage by the operating system. All the files
are mapped onto physical devices that are usually non volatile so data is safe in the case of
system failure.
The files can be accessed by the system in two ways i.e. sequential access and direct access

• Sequential Access

The information in a file is processed in order using sequential access. The files
records are accessed on after another. Most of the file systems such as editors,
compilers etc. use sequential access.

• Direct Access

In direct access or relative access, the files can be accessed in random for read and
write operations. The direct access model is based on the disk model of a file, since
it allows random accesses.

Operating System Structure


An operating system is a construct that allows the user application programs to interact
with the system hardware. Since the operating system is such a complex structure, it should
be created with utmost care so it can be used and modified easily. An easy way to do this is
to create the operating system in parts. Each of these parts should be well defined with clear
inputs, outputs and functions.

Simple Structure
There are many operating systems that have a rather simple structure. These started as
small systems and rapidly expanded much further than their scope. A common example of
this is MS-DOS. It was designed simply for a niche amount for people. There was no
indication that it would become so popular.
An image to illustrate the structure of MS-DOS is as follows −

6|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
It is better that operating systems have a
modular structure, unlike MS-DOS. That
would lead to greater control over the
computer system and its various
applications. The modular structure would
also allow the programmers to hide
information as required and implement
internal routines as they see fit without
changing the outer specifications.

Layered Structure
One way to achieve modularity in the
operating system is the layered approach.
In this, the bottom layer is the hardware
and the topmost layer is the user
interface.
An image demonstrating the layered approach is as follows −
As seen from the image, each upper
layer is built on the bottom layer. All
the layers hide some structures,
operations etc from their upper layers.

One problem with the layered


structure is that each layer needs to be
carefully defined. This is necessary
because the upper layers can only use
the functionalities of the layers below
them.

What is Kernel in Operating System?


The kernel is the central component of a computer operating systems. The only job
performed by the kernel is to the manage the communication between the software and
the hardware. A Kernel is at the nucleus of a computer. It makes the communication
between the hardware and software possible. While the Kernel is the innermost part of an
operating system, a shell is the outermost one.

7|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM

Introduction to Kernel

Features of Kernel

• Low-level scheduling of processes


• Inter-process communication
• Process synchronization
• Context switching

Types of Kernel
There are many types of kernels that exists, but among them, the two most popular kernels
are:

1. Monolithic
A monolithic kernel is a single code or block of the program. It provides all the required
services offered by the operating system. It is a simplistic design which creates a distinct
communication layer between the hardware and software.

2. Microkernels
Microkernel manages all system resources. In this type of kernel, services are implemented
in different address space. The user services are stored in user address space, and kernel
services are stored under kernel address space. So, it helps to reduce the size of both the
kernel and operating system.

Difference between Firmware and Operating System


Below are the Key Differences between Firmware and Operating System

8|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
Firmware Operating System
Define Firmware: Firmware is one kind Define Operating System: OS provides
of programming that is embedded on functionality over and above that which
a chip in the device which controls that is provided by the firmware.
specific device.
Firmware is programs that been OS is a program that can be installed by
encoded by the manufacture of the IC the user and can be changed.
or something and cannot be changed.
It is stored on non-volatile memory. OS is stored on the hard drive.

Introduction of System Call


A system call is a way for programs to interact with the operating system. A computer
program makes a system call when it makes a request to the operating system's kernel.
System call provides the services of the operating system to the user programs via
Application Program Interface(API).

A figure representing the execution of the system call is given as follows −


As can be seen from this
diagram, the processes
execute normally in the user
mode until a system call
interrupts this. Then the
system call is executed on a
priority basis in the kernel
mode. After the execution of
the system call, the control
returns to the user mode and
execution of user processes
can be resumed.

In general, system calls are required in the following situations −

• If a file system requires the creation or deletion of files. Reading and writing from
files also require a system call.
• Creation and management of new processes.
• Network connections also require system calls. This includes sending and receiving
packets.
• Access to a hardware devices such as a printer, scanner etc. requires a system call.

9|Page Notes by Prof. Deepak Kumar


OPERATING SYSTEM
Types of System Calls
There are mainly five types of system calls. These are explained in detail as follows −
Process Control: - These system calls deal with processes such as process creation, process
termination etc.
File Management: -These system calls are responsible for file manipulation such as
creating a file, reading a file, writing into a file etc.
Device Management: -These system calls are responsible for device manipulation such as
reading from device buffers, writing into device buffers etc.
Information Maintenance: -These system calls handle information and its transfer
between the operating system and the user program.
Communication: -These system calls are useful for inter process communication. They also
deal with creating and deleting a communication connection.
Some of the examples of all the above types of system calls in Windows and Unix are given
as follows −

Types of System Calls Windows Linux

Create Process() fork()


Process Control Exit Process() exit()
Wait For Single Object() wait()

Create File() open()


Read File() read()
File Management Write File() write()
Close Handle() close()

Set Console Mode() ioctl()


Device Management Read Console() read()
Write Console() write()

Get Current Process ID() getpid()


Information Maintenance Set Timer() alarm()
Sleep() sleep()

Create Pipe() pipe()


Communication Create File Mapping() shmget()
Map View Of File() mmap()

There are many different system calls as shown above. Details of some of those system calls
are as follows −

10 | P a g e Notes by Prof. Deepak


Kumar
OPERATING SYSTEM
open(): - The open() system call is used to provide access to a file in a file system. This
system call allocates resources to the file and provides a handle that the process uses to
refer to the file. A file can be opened by multiple processes at the same time or be restricted
to one process. It all depends on the file organisation and file system.
read(): -The read() system call is used to access data from a file that is stored in the file
system. The file to read can be identified by its file descriptor and it should be opened using
open() before it can be read. In general, the read() system calls takes three arguments i.e.
the file descriptor, buffer which stores read data and number of bytes to be read from the
file.
write(): -The write() system calls writes the data from a user buffer into a device such as a
file. This system call is one of the ways to output data from a program. In general, the write
system calls takes three arguments i.e. file descriptor, pointer to the buffer where data is
stored and number of bytes to write from the buffer.
close(): -The close() system call is used to terminate access to a file system. Using this
system call means that the file is no longer required by the program and so the buffers are
flushed, the file metadata is updated and the file resources are de-allocated.

11 | P a g e Notes by Prof. Deepak


Kumar

You might also like