You are on page 1of 50

Amity School of Engineering & Technology

Amity School of Engineering & Technology


Operating Systems (CSE 404)
Credit Units: 03
Mr. VIVEK PARASHAR
Assistant Professor CSE

1
Amity School of Engineering & Technology

Schools ASET
Program & Semester CSE V semester

Course Title Operating Systems

Course Code CSE 404

Credit Unit 03
Faculty Name Mr. Vivek Parashar
Email Vparahsar@gwa.amity.edu

Contact no. +918878644486

2
Amity School of Engineering & Technology

About Myself

• I am Vivek Parashar Assistant Professor (ASET)


• B.Tech (2002) and M.Tech (2006) from NIT Raipur
• Having more than 17 years of Teaching and Training
experience
• I was a corporate trainer at Wipro Technologies.

3
Amity School of Engineering & Technology

My Promise to you
• I will treat you with respect
• I will be available for questions (after class, during
office hours)
• I will arrive prepared to teach
• I will try to be engaging and helpful
• I will grade you fairly and objectively

4
Amity School of Engineering & Technology

University Expectations
• Come to class on-time (especially during exams)
• Turn in work on-time
• Do all work independently (except group work)
• Follow Rules of Conduct and Academic Behavior
Standards as detailed in the Student Regulations.
• Take responsibility for your own learning!

5
Amity School of Engineering & Technology

My Expectations

• Treat each other with respect


• Work hard
• Keep silence in class room
• Ask if you have questions!

6
Amity School of Engineering & Technology

Course Objectives
• To understand the services provided by and the design
of an operating system.
• To understand the structure and organization of the file
system.
• To understand what a process is and how processes are
synchronized and scheduled.
• To understand different approaches to memory
management.
• Students should be able to undersyand system calls for
managing processes, memory and the file system.
Amity School of Engineering & Technology

Learning Outcomes
• At the end of the course, the students should be able to:
• Analyze various scheduling algorithms.
• Understand deadlock, prevention and avoidance
algorithms.
• Compare and contrast various memory management
schemes.
• Understand the functionality of file systems.
Amity School of Engineering & Technology

Syllabus
Module I: Introduction to operating system

Operating system overview-objectives and functions, Batch


processing, multiprogramming, Time Sharing and Real
Time System, multiprocessor system, Distributed system.
Operating System structure, Operating System Services,
System Program and System calls.
Amity School of Engineering & Technology

Module II: Process Management

Process: Process concept, State model, process


scheduling, CPU Scheduling, Scheduling Algorithms-Non
Preemptive and preemptive Strategies, Multiprocessor
Scheduling. Process Synchronization – The critical-section
problem, Synchronization hardware, Mutex locks,
Semaphores, Classic problems of synchronization:
Producer Consumer Problem, Reader writer’s problem.
Critical regions, Monitors. Threads.

Deadlock: Deadlock – System model, Deadlock


characterization, Methods for handling deadlocks,
Deadlock prevention, Deadlock avoidance, Deadlock
detection, Recovery from deadlock.
Amity School of Engineering & Technology

Module III: Memory Management

Main Memory: Contiguous Allocation, Advantages and


disadvantages, Fragmentation, Paging, Segmentation,
Virtual memory concept, Demand paging, paged replaced
algorithm, Allocation of frames, Thrashing.

Module IV: Device management

Mass Storage system: Overview of Mass Storage Structure,


Disk Structure, Disk Scheduling and Management, Disk
space management.
Amity School of Engineering & Technology

Module V: File System and I/O System

File System: File Concept, File Organization and access


Mechanism, File Directories, Allocation method.

I/O Systems: I/O Hardware, Application I/O interface,


Kernel I/O subsystem
Amity School of Engineering & Technology

Text & References:

Text: •
A. Silberschatz, P.B. Galvin “Operating System Concepts”, John Willey

References:

•Dietel, “An introduction to operating system”, Addision Wesley


•Tannenbaum, “Operating system design and implementation”, PHI
•Operating System, A Modern Perspection, Gary Nutt, Pearson Edu.
• Willam Stalling “ Operating system” Pearson Education
Amity School of Engineering & Technology

Operating Systems
Amity School of Engineering & Technology

What is Operating Systems ?


Amity School of Engineering & Technology

Operating system is an interface between user and the


computer hardware. The hardware of the computer cannot
understand the human readable language as it works on
binaries i.e. 0’s and 1’s. Also it is very tough for humans to
understand the binary language, in such case we need an
interface which can translate human language to hardware
and vice−versa for effective communication.
Amity School of Engineering & Technology

Types of Operating System:

There are Three Types of Operating Systems. They are:


•Single User − Single Tasking Operating System
•Single User − Multitasking Operating System
•Multi User − Multitasking Operating System
Amity School of Engineering & Technology

Single User – Single Tasking Operating System


In this type of operating system only one user can log into system and can
perform only one task at a time.
E.g: MS- DOS

Single User − Multitasking Operating System


This type of Operating System supports only one user to log into the system
but a user can perform multiple tasks at a time, browsing internet while playing
songs etc.
E.g: Windows

Multi User − Multitasking Operating System


This type of Operating System provides multiple users to log into the system
and also each user can perform various tasks at a time. In a broader term
multiple users can logged in to system and share the resources of the system
at the same time.
E.g: UNIX, LINUX etc.
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Know your Computer first ?

Multi-core: means it's a single processor (CPU, Central


Processing Unit) with multiple cores. Each core = two
threads. A thread, in the simplest sense, is the most basic
level of code execution, so two threads can be seen as
two things that each core can work on simultaneously. So
an Oct-core CPU (8 cores) can work on 16 things at once.
Ex: Your friends working on same problem with you.
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Now a days computers are equipped with L1,L2,L3


Cache Memory. In multicore processors, each core may
have dedicated L1 and L2 cache, but they can share an
L3 cache Level 3 (L3) cache is specialized memory
developed to improve the performance of L1 and L2. L1 or
L2 can be significantly faster than L3.
Amity School of Engineering & Technology

Generation of Computers: It depends on the size of


transistors. In every one or two years the generation
changes means the size of transistors placed on chip
changes. The size also play a great role, ex 10 nM,12 nM ,
Smaller the size faster the processor. 10nM means the size
of transistors.

What is i3,i5, i7 & i9 ?

i3 Core i3 processors first appeared in 2010 and are the


entry-level Intel chipsets with 2 cores (processors). Core i3
have a slower clock speed then i5 without Turbo Boost.
Amity School of Engineering & Technology

i5 Core i5 processors first appeared in 2009, It may have


2-4 cores (processors) with turbo boost. Turbo Boost
allows faster speeds when the processor is under high
demand. Other advantages included better memory
support. Hyper-threading.

i7 Core i7 processors were introduced in 2008 and is


aimed at businesses and power users with 2-6 cores
(processors). As you might expect, the i7 features more
cache, more clock speed, and often more cores.
Amity School of Engineering & Technology

i9 Core i9 processors were introduced in 2017 and feature a


high number of cores, high power draw, high thermal
output, and high performance. They are intended to be used
by hardcore gamers and enthusiasts. They are also the
most expensive processors.
Amity School of Engineering & Technology

Stock Keeping Unit or part number: SKUs are generally


assigned in the order in which processors in that generation and
product line are developed. SKU numbers are not recommended
for comparison across different generations or product lines

Product Line Suffix: These remaining differences are indicated


by a letter-based product line suffix. For example, within the
Intel® Core™ series, U indicates a processor that has been
designed for power-efficient laptops or 2-in-1s. Meanwhile, XE
indicates an “extreme edition” processor for desktops designed
for maximum performance.
Amity School of Engineering & Technology

Suffix Meaning

G1-G7 Graphics level (processors with new integrated graphics technology only)

F Requires discrete graphics (Require graphic card seperately)

G Includes discrete graphics on package

H High performance optimized for mobile

HK High performance optimized for mobile, unlocked

HQ High performance optimized for mobile, quad core

K Unlocked (You can overclock)

S Special edition

T Power-optimized lifestyle

U Mobile power efficient


Amity School of Engineering & Technology

Processor
Product Launch Max Turbo
Status # of Cores Base Cache
Name Date Frequency
Frequency
Intel® 16 MB
Core™ i9- Intel®
Launched Q2'19 8 5.00 GHz 2.40 GHz
9980HK Smart
Processor Cache
Intel® 16 MB
Core™ i9- Intel®
Launched Q2'19 8 4.80 GHz 2.30 GHz
9880H Smart
Processor Cache
Intel® 16 MB
Core™ i9- Intel®
Launched Q2'19 8 4.40 GHz 2.10 GHz
9900T Smart
Processor Cache
Intel® 16 MB
Core™ i9- Intel®
Launched Q4'19 8 5.00 GHz 4.00 GHz
9900KS Smart
Processor Cache
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology

A Process is a isolated memory structure which supports an


application in OS hardware and software. A Windows Process
contains 1 or more Threads

A Thread is a stream of sequential machine-code instructions


that the processor executes. With the exception of Interrupts,
Any time the CPU runs an Instruction on behalf of an
application, it does so because a thread contained it. Threads
within a process may access the processes memory (to the
extent that the specific operation on the memory element is
"thread-safe" and doesn't present
unreconciled concurrency issues when more than one thread
is run simultaneously). An Application may speed its operation
by using multiple threads, each performing an isolated task by
running their stream of instructions through a different
CPU Execution unit (CPU/core/virtual core) simultaneously.
Amity School of Engineering & Technology

A Handle is a logical association with a shared resource like a


file, Window, memory location, etc. When a thread opens a file, it
establishes a "handle" to the file, and internally it acts like a
"name" for that instance of the file. Handles are used to link to
transitory or environmental resources outside the processes
memory structure.
Handles represent system resources like files, registry
keys, and threads. Threads: The number of active threads
in a process.
Amity School of Engineering & Technology

What Happens When You Turn On Your


Computer?

When you power on a computer, it goes through a “boot up”


process– a term that comes from the word
“bootstrap.” Here’s what’s happening in the background—
whether you’re using a Windows PC, Mac, or Linux system.
Amity School of Engineering & Technology

When you press the power button, the computer


supplies power to its components—the motherboard,
CPU, hard disks, solid state drives, graphics processors,
and everything else in the computer.

In the past, the PC loaded something called a BIOS


(Basic Input/Output System.) On modern PCs, the CPU
loads UEFI (Unified Extensible Firmware
Interface) firmware instead. This is a modern
replacement for the old-style BIOS. But, to avoid
confusion, some PC manufacturers still call their UEFI
software “BIOS” anyway.
Amity School of Engineering & Technology

The CPU runs the UEFI or BIOS, which tests and


initializes your system’s hardware—including the CPU
itself. For example, if your computer doesn’t have any
RAM, it will beep and show you an error, stopping the boot
process. This is known as the POST (Power On Self Test)
process.

You may see the PC manufacturer’s logo appear on your


screen during this process, and you can often press a
button to access your BIOS or UEFI settings screen from
here. However, many modern PCs fly through this process
so fast that they don’t bother displaying a logo and require
accessing their UEFI setting screen from the Windows
Boot Options menu (Advanced options).
Amity School of Engineering & Technology
Amity School of Engineering & Technology

The UEFI or BIOS looks for a “boot device” to boot your


operating system from. This is usually your computer’s hard
disk or solid-state drive, but may also be a CD, DVD, USB
drive, or network location. The boot device is configurable from
within the UEFI or BIOS setup screen. If you have multiple boot
devices, the UEFI or BIOS attempts to hand off the startup
process to them in the order they’re listed. So, for example, if
you have a bootable DVD in your optical drive, the system
might try starting from that before it tries starting from your hard
drive.
Amity School of Engineering & Technology

Traditionally, a BIOS looked at the MBR (master boot


record), a special boot sector at the beginning of a disk.
The MBR contains code that loads the rest of the operating
system, known as a “bootloader.” The BIOS executes the
bootloader, which takes it from there and begins booting
the actual operating system—Windows or Linux, for
example.

The bootloader is a small program that has the large task


of booting the rest of the operating system. Windows uses
a bootloader named Windows Boot Manager
(Bootmgr.exe), most Linux systems use GRUB, and Macs
use something called boot.efi.
Amity School of Engineering & Technology

The OS loader loads essential hardware drivers that are


required to run the kernel—the core part of the Windows
operating system—and then launches the kernel. The kernel
then loads the system Registry into memory and also loads
any additional hardware drivers that are marked with
“BOOT_START,” which means they should be loaded at
boot. The Windows kernel then launches the session
manager process (Smss.exe), which starts the system
session and loads additional drivers. This process
continues, and Windows loads background services as well
as the welcome screen, which lets you sign in.
Amity School of Engineering & Technology

Definition
 An Operating System, or OS,
is software that enables a
user and application software
to interact with a computer’s
hardware and the data and
other programs stored on the
computer.
 An OS performs basic tasks,
such as recognizing input
from the keyboard, sending
output to the display screen,
keeping track of files and
directories on the disk, and
controlling peripheral devices
such as printers.
Amity School of Engineering & Technology

What is operating System?


An operating system is the primary software that
manages all the hardware and other software on a
computer. The operating system, also known as an “OS,”
interfaces with the computer’s hardware and provides
services that applications can use.
What is operating System in technical terms?
Operating systems also include a lot of software—things
like common system services(Program execution I/O
operations ,File System manipulation, Communication Error
Detection), libraries (like .dll(dynamic link libraries) files),
and application programming interfaces (APIs) (Win32 API
) that developers can use to write programs that run on
the operating system.
Amity School of Engineering & Technology

Need for an OS
• The primary need for the OS arises from the fact that
user needs to be provided with services and OS ought
to facilitate the provisioning of these services.
• The central part of a computer system is a processing
engine called CPU. A system should make it possible for
a user’s application to use the processing unit.
• A user application would need to store information. The
OS makes memory available to an application when
required.
• Similarly, user applications need use of input facility to
communicate with the application. This is often in the
form of a key board, or a mouse or even a joy stick (if
the application is a game for instance).
Amity School of Engineering & Technology

• The output usually provided by a video monitor or a printer as some times the
user may wish to generate an output in the form of a printed document.
Output may be available in some other forms. For example it may be a video
or an audio file.
Let us consider few applications.
• Document Design
• Accounting
• E-mail
• Image processing
• Games
We notice that each of the above application requires resources for
• Processing information
• Storage of Information
• Mechanism to inputting information
• Provision for outputting information
These service facilities are provided by an operating system regardless of the
nature of application.
Amity School of Engineering & Technology

• The OS offers generic services to support all the


above operations. These operations in turn
facilitate the applications.
• To that extent an OS operation is application
neutral and service specific.
Amity School of Engineering & Technology

Other Services
 Program Execution
OS provides an environment where the user can conveniently run
programs. The user does not have to worry about memory
allocation or CPU scheduling. 

 I/O Operations
Each program requires input and produces output. The OS hides
some of the details of the underlying hardware for such I/O. All the
user sees is that the I/O has been performed, without those details.  

 Communications
There are instances where processes need to communicate with
each other to exchange information. It may be between processes
running on the same computer or running on different computers.
The OS provides these services to application programs, making
inter-process communication possible, and relieving the user of
having to worry about how this accomplished.
Amity School of Engineering & Technology

Application programs and OS


 Operating systems provide a software platform on top of which other
programs, called application programs, can run.

 The choice of operating system, therefore, determines to a great


extent the applications a user can run.

 For example, the DOS operating system contains commands such


as COPY and RENAME for copying files and changing the names of
files, respectively. The commands are accepted and executed by a
part of the operating system.

 Similarly, the UNIX operating system has commands like CP and


MV to copy and rename.
Amity School of Engineering & Technology
User and System View:
• From the user point of view the primary consideration is always the
convenience. It should be easy to use an application. In launching an
application, it helps to have an icon which gives a clue which application it
is. We have seen some helpful clues for launching a browser, e-mail or
even a document preparation application.
• In other words, the human computer interface which helps to identify an
application and its launch is very useful. This hides a lot of details of the
more elementary instructions that help in selecting the application.
Similarly, if we examine the programs that help us in using input devices
like a key board – all the complex details of character reading program are
hidden from the user. The same is true when we write a program. For
instance, when we use a programming language like C, a printf command
helps to generate the desired form of output. The following figure
essentially depicts the basic schema of the use of OS from a user stand
point.
Amity School of Engineering & Technology

• when it comes to the view point of a system, the OS needs to


ensure that all the system users and applications get to use the
facilities that they need. Also, OS needs to ensure that system
resources are utilized efficiently. For instance, there may be many
service requests on a Web server. Each user request need to be
serviced.

• Similarly, there may be many programs residing in the main


memory. The system need to determine which programs are active
and which need to await some form of input or output. Those that
need to wait can be suspended temporarily from engaging the
processor. This strategy alone enhances the processor throughput.

• In other words, it is important for an operating system to have a


control policy and algorithm to allocate the system resources.
Amity School of Engineering & Technology

UNIX
 UNIX was one of the first operating systems to
be written, in 1971.

 Advantages of UNIX are…

 Multitasking – multiple programs can run at one


time.

 Multi-user – allows more than a single user to


work at any given time. This is accomplished by
sharing processing time between each user.

 Safe – prevents one program from accessing


memory or storage space allocated to another
program, and enables file protection, requiring
users to have permission to perform certain
functions, such as accessing a directory, file, or
disk drive.

You might also like