KEMBAR78
Os Unit 1 | PDF | Operating System | Virtual Machine
0% found this document useful (0 votes)
167 views95 pages

Os Unit 1

This document provides an introduction to an Operating Systems course taught by Rifa Nizam Khan at Noida Institute of Engineering and Technology in Greater Noida. It outlines Khan's work experience and education, the course contents and syllabus, textbooks, objectives, outcomes, and how the course maps to program outcomes and specific outcomes.
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)
167 views95 pages

Os Unit 1

This document provides an introduction to an Operating Systems course taught by Rifa Nizam Khan at Noida Institute of Engineering and Technology in Greater Noida. It outlines Khan's work experience and education, the course contents and syllabus, textbooks, objectives, outcomes, and how the course maps to program outcomes and specific outcomes.
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/ 95

Noida Institute of Engineering and Technology, Greater Noida

Introduction

Unit: 1

Operating System (ACSBS0403)


Rifa Nizam Khan
Assistant Professor
Course Details CSBS
(B Tech CSBS 4th Sem )

Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1


1
1/31/2024
Faculty Introduction

Work Experience
Education Publications
• NIET, Gr Noida From Nov 2021 to till date
• GNIOT, Gr Noida From Oct 2019 to Nov 2021 • M.Tech (AKTU, Lucknow) Total: 04
• TIAS, Delhi From Jan 2019 to July 2019 • B.Tech (AKTU, Lucknow) International: 2 (DRDO, Delhi)
• SRMSCET, Bareilly From Jan 2017 to Nov 2017
• PHD (pursuing Jamia Millia National: 2
Islamia, Delhi)

➢ Awarded by Scholarship In M.Tech.


➢ Give Guest Lecture on Cloud Computing In Company Training Basket Pvt Ltd, Noida
➢ Attended 11 FDPs , Coordinated International Conference, NATCOM at SRMSCET campus.
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 2
Evaluation Scheme

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 3


Course Contents / Syllabus

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 4


Course Contents / Syllabus

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 5


Course Contents / Syllabus

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 6


Textbooks and References

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 7


Branch wise Applications

• Operating System is a software that is going to use in every computer based


technology whether it is Computer System, Embedded System or any other
computing device
• Operating System provides an environment to the user so that they can interact
with the hardware of a machine like Computer System. It allows user to install
different Application Software, so that user can perform some specific task
• In today, Digital World space is more important to store data for future use and
Operating System also manage the memory of system, it also creates virtual
memory that creates an illusion for user of more memory.
• Some more tasks like Device Management, Process Management and File
Management are performed by Operating System.
• Operating System like UNIX also provide opportunities to programmers to
trouble shoot the network problem.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 8


Course Objective

• The course objective is to enable students to understand the concept of Operating System and
it’s importance in computer system.
• To Design an Operating System that could work efficiently in comparison of existing
Operating Systems by implementing different types of CPU scheduling algorithms.
• To manage the Memory available in OS to store more data by using the concept of virtual
memory and Memory Management
• To understand the process of communication between different processes and solve the
problem of deadlock that arises because of resource sharing the same time
• To understand the concept of File and Disk Management, so that more space can be available
for storing data.
• To understand the concept of shell programming in UNIX OS

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 9


Course Outcomes

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 10


Program Outcome

1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and
an engineering specialization for the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, research literature, and analyze complex engineering problems
reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering
sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for public
health and safety, and cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of information to provide
valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering
and IT tools, including prediction and modeling to complex engineering activities, with an understanding of
the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 11
Program Outcome

17. Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with the society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 12


CO-PO Mapping

OPERATING SYSTEM(ACSBS-403)
CODE PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12

CO1 3 3 2 2 1 2 - 2 3 2 2 3
CO2 3 3 3 2 2 3 2 2 3 - 1 3
CO3 3 3 2 2 2 2 2 2 2 3 1 3
CO4 3 2 2 3 1 2 2 - 2 - 2 3
CO5 3 1 2 2 2 2 - - 2 2 2 3

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 13


Program Specific Outcomes (PSOs)

At the end of the program, the student will be able to

PSO1: Apply technical and business knowledge to solve complex problems and face
current business challenges.

PSO2: Explore modern tools and technologies and apply the knowledge to design and
develop solutions for betterment of the society.

PSO3: Work innovatively and communicate effectively with professionals worldwide


and pursue lifelong learning to add value to society and environment.

Ms. Rifa Nizam Khan ACSBS0403 Operating


1/31/2024 14
System Unit 1
CO- PSO Mapping

Program Specific Outcomes


Course
Outcomes
PSO1 PSO2 PSO3 PSO4

CO1 2 1 2 2

CO2 2 2 1 2

CO3 2 3 3 2

CO4 2 2 1 2

CO5 2 2 2 2

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 15


Program Educational Objectives(PEOs)
The graduates of B.Tech Data CSBS program will

PEO1: Engage in successful professional practices in emerging areas of computer science and
business systems and pursue higher education and research.

PEO2: Adapt easily to dynamically changing environment, applying their knowledge in technology
abstraction and common business principles.

PEO3: Demonstrate effective business communication with innovation mindset who can effectively
work in a team and exhibit strong ethics and life values to serve the society.

Ms. Rifa Nizam Khan ACSBS0403 Operating


1/31/2024 16
System Unit 1
Result Analysis

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 17


End Semester Question Paper Template

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 18


Prerequisite and Recap

• Basic knowledge of computer fundamentals.

• Basic knowledge of computer organization.

• Memory hierarchy

• Cache Organization

• Interrupt

• Registers

• Associative memory

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 19


Brief Introduction about the Subject

For Computer Engineers/Students, it important that they must be aware about the Operating System and
its task because operating system is the first things that is required to communicated with hardware of
computer system like mouse, monitor, mother board, printer, etc. Operating System provides an
environment to users where they can install many more application software to perform their specific
tasks. In short Operating System acts as an interface between Users and Hardware of Computer System.
Operating System also perform the task of Memory Management, Processor Management, Device
Management, File Management, Security Control over system performance, Job accounting, Error
detecting aids and Coordination between other software and users. Some popular Operating Systems
include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.
This subject helps students to know about the Operating System in detail and understand the management
of different resources like memory, disk management, process scheduling etc.

https://www.youtube.com/watch?v=mXw9ruZaxzQ
https://www.youtube.com/watch?v=vBURTt97EkA

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 20


UNIT Content : Introduction

• Concept of Operating Systems (OS),


• Generations of OS,
• Types of OS, OS Services,
• Functions of OS Interrupt handling and System Calls,
• Basic architectural concepts of an OS,
• Concept of Virtual Machine,
• Resource Manager view, process view and hierarchical view of an OS.
• Processes:
• Definition, Process Relationship,
• Different states of a Process,
• Process State transitions,
• Process Control Block (PCB),
• Context switching

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 21


Unit Objective

• To know about the Operating System and types of Operating system and their applications

• To understand the tasks of Operating Systems and role of OS to handle interrupts.

• To be familiar with basic architecture of OS

• To understand the concept of System Calls and their importance in OS

• Understand the different views of OS

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 22


Topic Objective/Topic Outcome

▪ To know about Operating System and its function

▪ To get knowledge of different types of Operating System

▪ To understand various system calls

▪ To understand the concept of interrupt handling by Operating System

▪ To know about different views of Operating System

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 23


Lecture 1 related to topic :Introduction

• Concept of Operating Systems (OS),


• Generations of OS,
• Types of OS,
• OS Services,

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 24


Concept of Operating System

Basic of Operating System


• OS acts as an interface between the User and hardware of a Computer System.
• OS provides an environment in which user can execute programs conveniently
and efficiently.
• OS is available in Software that manages computer hardware.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 25


Operating System – Definition

•An operating system is a program that controls the execution of application


programs and acts as an interface between the user of a computer and the
computer hardware.
•A more common definition is that the operating system is the one program
running at all times on the computer (usually called the kernel), with all else
being application programs.
•An operating system is concerned with the allocation of resources and services,
such as memory, processors, devices, and information. The operating system
correspondingly includes programs to manage these resources, such as a traffic
controller, a scheduler, a memory management module, I/O programs, and a file
system.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 26


Generation of Operating System

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 27


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.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 28


Operating System – Functions
The common tasks of an OS perform are:
1.Convenience: An OS makes a computer more convenient to use.
2.Efficiency: An OS allows the computer system resources to be used efficiently.
3.Ability to Evolve: An OS should be constructed in such a way as to permit the effective
development, testing, and introduction of new system functions at the same time without
interfering with service.
4.Throughput: An OS should be constructed so that It can give
maximum throughput(Number of tasks per unit time).

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 29


Operating System – Major Functions

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 30


Operating System – Major Functions

•Resource Management: When parallel accessing happens in the OS means when multiple users are
accessing the system the OS works as Resource Manager, Its responsibility is to provide hardware to
the user. It decreases the load in the system.
•Process Management: It includes various tasks like scheduling, termination of the process. OS
manages various tasks at a time. Here CPU Scheduling happens means all the tasks would be done
by the many algorithms that use for scheduling.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 31


Operating System – Major Functions:
•Storage Management: The file system mechanism used for the management of the
storage. NIFS, CFS, CIFS, NFS, etc. are some file systems. All the data stores in various
tracks of Hard disks that all managed by the storage manager. It included Hard Disk.
•Memory Management: Refers to the management of primary memory. The operating
system has to keep track, how much memory has been used and by whom. It has to decide
which process needs memory space and how much. OS also has to allocate and deallocate the
memory space.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 32


Operating System – Major Functions:

•Security/Privacy Management: Privacy is also provided by the Operating system by means of


passwords so that unauthorized applications can’t access programs or data.
•For example, Windows uses Kerberos authentication to prevent unauthorized access to data.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 33


Type of Operating System
1. Batch Operating System –
This type of operating system does not interact with the computer directly. There is an operator
which takes similar jobs having the same requirement and group them into batches. It is the
responsibility of the operator to sort jobs with similar needs.
• Examples of Batch based Operating System: Payroll System, Bank Statements, etc.

Memory Layout for a Simple Batch Multiprogrammed Batch


System Systems
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 34
Type of Operating System

Advantages of Batch Operating System:


•It is very difficult to guess or know the time required for any job to complete. Processors of the
batch systems know how long the job would be when it is in queue
•Multiple users can share the batch systems
•The idle time for the batch system is very less
•It is easy to manage large work repeatedly in batch systems

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 35


Type of Operating System

Disadvantages of Batch Operating System:


•The computer operators should be well known with batch systems
•Batch systems are hard to debug
•It is sometimes costly
•The other jobs will have to wait for an unknown time if any job fails

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 36


Type of Operating System

2. Time-Sharing Operating Systems –


Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time
of CPU as they use a single system. These systems are also known as Multitasking Systems. The task
can be from a single user or different users also. The time that each task gets to execute is called
quantum. After this time interval is over OS switches over to the next task.
Examples of Time-Sharing OSs are: Multics, Unix, etc

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 37


Type of Operating System

Advantages of Time-Sharing OS:


•Each task gets an equal opportunity
•Fewer chances of duplication of software
•CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
•Reliability problem
•One must have to take care of the security and integrity of user programs and data
•Data communication problem

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 38


Type of Operating System

3. Distributed Operating System –Various autonomous interconnected computers communicate


with each other using a shared communication network.
• Independent systems possess their own memory unit and CPU.
• These are referred to as loosely coupled systems or distributed systems.
• These system’s processors differ in size and function.
• The major benefit of working with these types of the operating system is that it is always
possible that one user can access the files or software which are not actually present on his
system but some other system connected within this network i.e., remote access is enabled
within the devices connected in that network.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 39


Type of Operating System

Advantages of Distributed Operating System:


•Failure of one will not affect the other network communication, as all systems are independent
from each other
•Electronic mail increases the data exchange speed
•Since resources are being shared, computation is highly fast and durable
•Load on host computer reduces
•These systems are easily scalable as many systems can be easily added to the network
•Delay in data processing reduces

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 40


Type of Operating System

Disadvantages of Distributed Operating System:


•Failure of the main network will stop the entire communication
•To establish distributed systems the language which is used are not well defined yet
•These types of systems are not readily available as they are very expensive. Not only that the
underlying software is highly complex and not understood well yet

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 41


Type of Operating System

4. Network Operating System –


These systems run on a server and provide the capability to manage data, users, groups, security,
applications, and other networking functions.
• These types of operating systems allow shared access of files, printers, security, applications,
and other networking functions over a small private network.
• One more important aspect of Network Operating Systems is that all the users are well aware of
the underlying configuration, of all other users within the network, their individual connections,
etc. and that’s why these computers are popularly known as tightly coupled systems.
Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 42


Type of Operating System

Advantages of Network Operating System:


•Highly stable centralized servers
•Security concerns are handled through servers
•New technologies and hardware up-gradation are easily integrated into the system
•Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
•Servers are costly
•User has to depend on a central location for most operations
•Maintenance and updates are required regularly

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 43


Type of Operating System

5. Real-Time Operating System –


These types of OSs serve real-time systems. The time interval required to process and respond to
inputs is very small. This time interval is called response time.
Real-time systems are used when there are time requirements that are very strict like missile
systems, air traffic control systems, robots, etc.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 44


Type of Operating System

Two types of Real-Time Operating System which are as follows:


•Hard Real-Time Systems:
These OSs are meant for applications where time constraints are very strict and even the shortest
possible delay is not acceptable. These systems are built for saving life like automatic parachutes
or airbags which are required to be readily available in case of any accident. Virtual memory is
rarely found in these systems.
•Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 45


Type of Operating System

Advantages of RTOS:
•Maximum Consumption: Maximum utilization of devices and system, thus more output from all
the resources
•Task Shifting: The time assigned for shifting tasks in these systems are very less. For example, in
older systems, it takes about 10 microseconds in shifting one task to another, and in the latest
systems, it takes 3 microseconds.
•Focus on Application: Focus on running applications and less importance to applications which
are in the queue.
•Real-time operating system in the embedded system: Since the size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
•Error Free: These types of systems are error-free.
•Memory Allocation: Memory allocation is best managed in these types of systems.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 46


Type of Operating System

Disadvantages of RTOS:
•Limited Tasks: Very few tasks run at the same time and their concentration is very less on few
applications to avoid errors.
•Use heavy system resources: Sometimes the system resources are not so good and they are
expensive as well.
•Complex Algorithms: The algorithms are very complex and difficult for the designer to write on.
•Device driver and interrupt signals: It needs specific device drivers and interrupts signals to
respond earliest to interrupts.
•Thread Priority: It is not good to set thread priority as these systems are very less prone to
switching tasks.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 47


Type of Operating System

6. Parallel OS
• Multiprocessor systems with more than one CPU in close communication.
• Tightly coupled system – processors share memory and a clock; communication usually takes
place through the shared memory.
• Advantages of parallel system:
– Increased throughput
– Economical
– Increased reliability
• graceful degradation
• fail-soft systems

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 48


Type of Operating System

6. Parallel OS
• Symmetric multiprocessing (SMP)
– Each processor runs an identical copy of the operating system.
– Many processes can run at once without performance deterioration.
– Most modern operating systems support SMP
• Asymmetric multiprocessing
– Each processor is assigned a specific task; master processor schedules and allocates work to
slave processors.
– More common in extremely large systems

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 49


Functions of OS Interrupt handling

• Interrupts are signals sent to the CPU by external devices, normally I/O devices.
• They tell the CPU to stop its current activities and execute the appropriate part of the operating
system.
• Interrupts are important because they give the user better control over the computer.
• Without interrupts, a user may have to wait for a given application to have a higher priority
over the CPU to be ran.
• This ensures that the CPU will deal with the process immediately.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 50


Functions of OS Interrupt handling

Type of Interrupts
• Hardware Interupts are generated by hardware devices to signal that they need some attention
from the OS. They may have just received some data (e.g., keystrokes on the keyboard or an
data on the ethernet card); or they have just completed a task which the operating system
previous requested, such as transfering data between the hard drive and memory.
• Software Interupts are generated by programs when they want to request a system call to be
performed by the operating system.
• Traps are generated by the CPU itself to indicate that some error or condition occurred for
which assistance from the operating system is needed.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 51


System Call

System calls provide an interface to the services made available by an operating system.
System calls are generally available as routines written in C and C++,
Although certain low-level tasks (for example, tasks where hardware must be accessed directly),
may need to be written using assembly-language instructions.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 52


Type of System Call

System calls can be grouped into six major categories:


• Process Control,
• File Manipulation,
• Device Manipulation,
• Information Maintenance,
• Communication
• Protections

Protection

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 53


Type of System Call

• Process Control: Process control is the system call that is used to direct the processes. Some
process control examples include creating, load, abort, end, execute, process, terminate the
process, etc.
• File Manipulation: File management is a system call that is used to handle the files. Some file
management examples include creating files, delete files, open, close, read, write, etc.
• Device Manipulation: Device management is a system call that is used to deal with devices.
Some examples of device management include read, device, write, get device attributes,
release device, etc.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 54


Type of System Call

• Information Maintenance: Information maintenance is a system call that is used to maintain


information. There are some examples of information maintenance, including getting system
data, set time or date, get time or date, set system data, etc.
• Communication: Communication is a system call that is used for communication. There are
some examples of communication, including create, delete communication connections, send,
receive messages, etc.
• Protections

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 55


Type of System Call
Process Windows Unix
Process Control CreateProcess() Fork()
ExitProcess() Exit()
WaitForSingleObject() Wait()
File Manipulation CreateFile() Open()
ReadFile() Read()
WriteFile() Write()
CloseHandle() Close()
Device Management SetConsoleMode() Ioctl()
ReadConsole() Read()
WriteConsole() Write()
Information Maintenance GetCurrentProcessID() Getpid()
SetTimer() Alarm()
Sleep() Sleep()
Communication CreatePipe() Pipe()
CreateFileMapping() Shmget()
MapViewOfFile() Mmap()
Protection SetFileSecurity() Chmod()
InitializeSecurityDescriptor() Umask()
SetSecurityDescriptorgroup() Chown()

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 56


Type of System Call

open()
The open() system call allows you to access a file on a file system. It allocates resources to the file
and provides a handle that the process may refer to. Many processes can open a file at once or by a
single process only. It's all based on the file system and structure.
read()
It is used to obtain data from a file on the file system. It accepts three arguments in general:
•A file descriptor.
•A buffer to store read data.
•The number of bytes to read from the file.
The file descriptor of the file to be read could be used to identify it and open it using open() before
reading.
write()
It is used to write data from a user buffer to a device like a file. This system call is one way for a
program to generate data. It takes three arguments in general:
•A file descriptor.
•A pointer to the buffer in which data is saved.
•The number of bytes to be written from the buffer.
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 57
Type of System Call

fork()
Processes generate clones of themselves using the fork() system call. It is one of the most common
ways to create processes in operating systems. When a parent process spawns a child process,
execution of the parent process is interrupted until the child process completes. Once the child
process has completed its execution, control is returned to the parent process.
close()
It is used to end file system access. When this system call is invoked, it signifies that the program no
longer requires the file, and the buffers are flushed, the file information is altered, and the file
resources are de-allocated as a result.
exec()
When an executable file replaces an earlier executable file in an already executing process, this
system function is invoked. As a new process is not built, the old process identification stays, but the
new process replaces data, stack, data, head, etc.
exit()
The exit() is a system call that is used to end program execution. This call indicates that the thread
execution is complete, which is especially useful in multi-threaded environments. The operating
system reclaims resources spent by the process following the use of the exit() system function.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 58


Basic Architectural Concepts of an OS

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 59


Concept of Virtual Machine

• A virtual machine takes the layered approach to its logical conclusion.


• It treats hardware and the operating system kernel as though they were all hardware
• A virtual machine provides an interface identical to the underlying bare hardware
• The operating system host creates the illusion that a process has its own processor and (virtual
memory)
• Each guest provided with a (virtual) copy of underlying computer

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 60


Concept of Virtual Machine

Non – Virtual Machine Virtual Machine

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 61


Concept of Virtual Machine

History of VM
• First appeared commercially in IBM mainframes in 1972
• Fundamentally, multiple execution environments (different operating systems) can share the
same hardware
• Protect from each other
• Some sharing of file can be permitted, controlled
• Commutate with each other, other physical systems via networking
• Useful for development, testing „
• Consolidation of many low-resource use systems onto fewer busier systems „
• “Open Virtual Machine Format”, standard format of virtual machines, allows a VM to run
within many different virtual machine (host) platforms

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 62


Resource Manager View

• 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.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 63


Resource Manager View

• 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.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 64


Process View of Operating System

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 65


Hierarchical architecture views

• The middle layer provides more domain dependent functions such as business logic and core
processing services. And,
• The upper layer provides more abstract functionality in the form of user interface such as GUIs,
shell programming facilities, etc.
• It is also used in organization of the class libraries such as .NET class library in namespace
hierarchy.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 66


Hierarchical architecture views

• The whole system as a hierarchy structure, in which the software system is decomposed into
logical modules or subsystems at different levels in the hierarchy.
• This approach is typically used in designing system software such as network protocols and
operating systems.
• In system software hierarchy design, a low-level subsystem gives services to its adjacent upper
level subsystems, which invoke the methods in the lower level.
• The lower layer provides more specific functionality such as I/O services, transaction, scheduling,
security services, etc.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 67


Hierarchical architecture views

• All the design types can implement this hierarchical architecture and often combine with other
architecture styles.
• Hierarchical architectural styles is divided as −
•Main-subroutine
•Master-slave
•Virtual machine.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 68


Processes

Process Concept
Process Scheduling
Operations on Processes
Interprocess Communication
Examples of IPC Systems
Communication in Client-Server Systems

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 69


Concept of Process
• Program that in executing state is informally known as Process.
• Some time a process is not only a program code (Text Section)
• A Process also includes Value of Program counter (Current Activity represented by a value)
and contents of processor’s Register.
• A process generally also includes the
• Process stack, which contains temporary data (such as function parameters, return
addresses, and local variables), and
• A Data section, which contains global variables.
• A heap, which is memory that is dynamically allocated during process run time.
• A program is considered as Passive entity while a process is Active Entity. such as a file
containing a list of instructions stored on disk (often called an executable file), whereas
• A program becomes a process when an executable file is loaded into memory.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 70


Concept of Process

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 71


States of Process

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 72


States of Process

• New. The process is being created.


• Running. Instructions are being executed.
• Waiting. The process is waiting for some event to occur (such as an I/O completion or
reception of a signal).
• Ready. The process is waiting to be assigned to a processor.
• Terminated. The process has finished execution.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 73


Process Control Block

Each process is represented in the operating system by a


process control block (PCB)-also called a Task control block
(TCB).
Elements of PCB:
• Process state. The state may be new, ready, running,
waiting, halted, and so on.
• Program counter. The counter indicates the address of the
next instruction to be executed for this process.
• CPU registers.
• Vary in number based on Computer Architecture.
• They include accumulators, index registers, stack
pointers, and general-purpose registers, plus any
condition-code information.
• CPU-scheduling information. This information includes a
process priority, pointers to scheduling queues, and any
other scheduling parameters.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 74


Process Control Box

• Memory-management information. This information may


include such information as the value of the base and limit
registers, the page tables, or the segment tables, depending
on the memory system used by the operating system.

• Accounting information. This information includes the


amount of CPU and real time used, time limits, account
numbers, job or process numbers, and so on.

• I/O status information. This information includes the list of


I/O devices allocated to the process, a list of open files, and
so on.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 75


Context Switching

• A context switching is a process that involves switching of the CPU from one process or task
to another.

• In this phenomenon, the execution of the process that is present in the running state is
suspended by the kernel and another process that is present in the ready state is executed by
the CPU.

• It is one of the essential features of the multitasking operating system.

• The processes are switched so fastly that it gives an illusion to the user that all the processes
are being executed at the same time.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 76


Context Switching

• But the context switching process involved a number of steps that need to be followed.

• Switching a process from the running state to the ready state is not allowed directly .

• You have to save the context of that process. If you are not saving the context of any process
P then after some time, when the process P comes in the CPU for execution again, then the
process will start executing from starting.

• But in reality, it should continue from that point where it left the CPU in its previous
execution.

• So, the context of the process should be saved before putting any other process in the running
state.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 77


Context Switching

A context is the contents of a CPU's registers and program counter at any point in time.
Reasons for Context Switching:
•When a process of high priority comes in the ready state. In this case, the execution of the
running process should be stopped and the higher priority process should be given the CPU
for execution.
•When an interruption occurs then the process in the running state should be stopped and the
CPU should handle the interrupt before doing something else.
•When a transition between the user mode and kernel mode is required then you have to
perform the context switching

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 78


Steps for Context Switching

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 79


Steps for Context Switching

1.Firstly, the context of the process P1 i.e. the process present in the running state will be saved in
the Process Control Block of process P1 i.e. PCB1.

2.Now, you have to move the PCB1 to the relevant queue i.e. ready queue, I/O queue, waiting
queue, etc.

3.From the ready state, select the new process that is to be executed i.e. the process P2.

4.Now, update the Process Control Block of process P2 i.e. PCB2 by setting the process state to
running. If the process P2 was earlier executed by the CPU, then you can get the position of last
executed instruction so that you can resume the execution of P2.

5.Similarly, if you want to execute the process P1 again, then you have to follow the same steps as
mentioned above(from step 1 to 4).

Note: For context switching to happen, two processes are at least required in general, and in the
case of the round-robin algorithm, you can perform context switching with the help of one process
only.
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 80
Steps for Context Switching

Advantage of Context Switching


• Context switching is used to achieve multitasking i.e. multiprogramming with time-
sharing that gives an illusion to the users that more than one process are being executed
at the same time.
• But in reality, only one task is being executed at a particular instant of time by a
processor.
• the context switching is so fast that the user feels that the CPU is executing more than
one task at the same time.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 81


Steps for Context Switching

The disadvantage of Context Switching


• The disadvantage of context switching is that it requires some time for context switching
i.e. the context switching time.
• Time is required to save the context of one process that is in the running state and then
getting the context of another process that is about to come in the running state.
• During that time, there is no useful work done by the CPU from the user perspective. So,
context switching is pure overhead in this condition.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 82


Daily Quiz

1. What is an operating system?


a) interface between the hardware and application programs
b) collection of programs that manages hardware resources
c) system service provider to the application programs
d) all of the mentioned
2. CPU scheduling is the basis of ___________
a) multiprogramming operating systems
b) larger memory sized systems
c) multiprocessor systems
d) none of the mentioned
3. f a process fails, most operating system write the error information to a ______
a) new file
b) another running process
c) log file
d) none of the mentioned

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 83


Weekly Assignment 1

1. What is Operating System? Briefly Explain various type of OS.


2. What are the functions of Operating System?
3. Write the function of any five system calls.
4. Explain different states of Process.
5. Explain Operating System task as Resource Managers.

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 84


Faculty Video Links, Youtube & NPTEL Video Links and Online Courses Details

Unit 1 Unit 3
• https://www.youtube.com/watch?v=783 • https://www.youtube.com/watch?v=UczJ7misUEk
KAB-tuE4
• https://www.youtube.com/watch?v=_IxqinTs2Yo
• https://www.youtube.com/watch?v=Bxx
2_aQVeeg
• https://www.youtube.com/watch?v=Za Unit 4
GGKFCLNc0 • https://www.youtube.com/watch?v=IwESijQs9sM
• https://nptel.ac.in/courses/106/105/106 • https://www.youtube.com/watch?v=-orfFhvNBzY
105214/ • https://www.youtube.com/watch?v=2OobPx246zg
&list=PL3-wYxbt4yCjpcfUDz-
Unit 2 TgD_ainZ2K3MUZ&index=10
• https://www.youtube.com/watch?v=NS Unit 5
hBeqTkXnQ • https://www.youtube.com/watch?v=AnGOeYJCv6
• https://www.youtube.com/watch?v=4h • https://www.youtube.com/watch?v=U1Jpvni0Aak
Cih9eLc7M
• https://www.youtube.com/watch?v=9YR
xhlvt9Zo

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 85


MCQ

1. What is the main function of the command interpreter?


a) to provide the interface between the API and application program
b) to handle the files in the operating system
c) to get and execute the next user-specified command
d) none of the mentioned CPU scheduling is the basis of ___________

2. To access the services of the operating system, the interface is provided by the ___________
a) Library
b) System calls
c) Assembly instructions
d) API

3. If a process fails, most operating system write the error information to a ______
a) log file
b) another running process
c) new file
d) none of the mentioned
1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 86
Glossary Questions

1. Fill in the blanks using following words


Operating System, Process, Five, Counter, kernel
a) ________ acts as an interface between user and hardware
b) Instance of a program in execution is called __________
c) Generally a process has __________ states
d) Core part of operating system is called______________
2. Match the following
a) First generation of computer a) Vaccum
b) Second Generation of Computer b) Transistor
c) Virtual Memory c) Illusion of memory
d) Generation of computer based on VLSI d) Fourth

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 87


Old Question Papers
)

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 88


Old Question Papers

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 89


Old Question Papers

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 90


Old Question Papers

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 91


Old Question Papers

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 92


Expected Questions for University Exam

1.Distinguish between Monolithic and Micro Kernel.


2. Explain Briefly Layered operating system structure with neat sketch.
3. Describe differences between symmetric and asymmetric multiprocessing.
4. List the services provided by an Operating System.
5. List the Components of Operating System.
6. Define System calls.
7. Distinguish between batch systems and time sharing systems.
8. Describe parallel systems and give their advantages.
9. Differentiate between Multi programming and Multi Tasking.
10. Mention the objectives and functions of OS

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 93


Recap

• Concept of Operating Systems (OS),


• Generations of OS,
• Types of OS, OS Services,
• Functions of OS Interrupt handling and System Calls,
• Basic architectural concepts of an OS,
• Concept of Virtual Machine,
• Resource Manager view, process view and hierarchical view of an OS.
• Processes:
• Definition, Process Relationship,
• Different states of a Process,
• Process State transitions,
• Process Control Block (PCB),
• Context switching

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 94


References

Books :
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley
2. SibsankarHalder and Alex A Aravind, “Operating Systems”, Pearson Education
3. Harvey M Dietel, “ An Introduction to Operating System”, Pearson Education
4. D M Dhamdhere, “Operating Systems : A Concept basedApproach”, McGraw Hill.
5. Charles Crowley, “Operating Systems: A Design-Oriented Approach”, Tata McGraw Hill
Education”.
6. Stuart E. Madnick & John J. Donovan, “ Operating Systems”, Tata McGraw

1/31/2024 Ms. Rifa Nizam Khan ACSBS0403 Operating System Unit 1 95

You might also like