Os Unit 1
Os Unit 1
Introduction
Unit: 1
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)
• 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. 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
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
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.
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
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.
• Memory hierarchy
• Cache Organization
• Interrupt
• Registers
• Associative memory
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
• To know about the Operating System and types of Operating system and their applications
•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.
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.
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.
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
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
• 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.
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.
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.
Protection
• 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.
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.
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
• 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.
• 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.
• 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.
Process Concept
Process Scheduling
Operations on Processes
Interprocess Communication
Examples of IPC Systems
Communication in Client-Server Systems
• 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.
• 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.
• 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.
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.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
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
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
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