SlideShare a Scribd company logo
UNIT – IV
STORAGE MANAGEMENT AND FILE
SYSTEMS INTERFACE
STORAGE MANAGEMENT:
• Storage management is the process of
• Controlling and coordinating computer memory
• Assigning portions called blocks to various
running programs to optimize overall system
performance(Allocating Process)
• Freeing it for reuse when no longer needed
(Deallocating process)
• Motivation
• Keep several processes in memory to improve a
systems performance
– Allows Multiprogramming
• Instruction execution cycle
All computers have an instruction execution
cycle.
A basic instruction execution cycle can be
broken down into the following steps:
– Fetch cycle
– Execute cycle
Steps in Fetch/ExecuteCycle
• The instruction is fetched from memory addressed by PC
(Program Counter)
• PC is advanced to address the next instruction
• Instruction Decoder decodes the instruction held in IR
• Instruction is then executed.
• Results are stored back to the memory
Memory Space Protection:
Memory protection is away to control memory
access rights on a computer.
SWAPPING:
• Swapping refers to moving entire processes in
and out of main memory.
• RoundRobin CPU-Scheduling Algorithm
-Each process is provided a fix time to execute called time
slice or quantum
• Priority-based scheduling algorithms
-Each process is assigned apriority. Process with highest
priority is to be executed first and so on
-Processes with same priority are executed on first come
first serve basis
CONTIGUOUS MEMORY AL LOCATION
• Memory Allocation
Memory Allocation is the process of assigning
blocks of memory on request for the program
execution.
• Memory Allocation mechanism
• Operating system uses the following memory
allocation mechanism.
• Single-partition allocation
• Multiple-partition allocation
Single-partition allocation:
• The operating system resides in the low
memory. The remaining memory treated as a
single partition.
• This single partition is available for userspace.
• Only one job can be loaded in this user space
Multiple-partition allocation:
• Main memory is divided into a number of fixed-
sized partitions where each partition should
contain only one process.
• When a partition is free, a process is selected
from the input queue and is loaded into the free
partition.
Memory Allocation:
1.Fixed Partitions Scheme:
• In this type of allocation, main memory is divided
into a number of fixed-sized partitions where each
partition should contain only one process.
2.Variable Partition Scheme:
• Partitions are of variable length and number
.Process is allocated exactly as much memory as
required
Methods to assign processes to partitions:
• There are two ways to assign processes to
partitions
• Use multiple queues
-Assign each process to the smallest partition within which
it will fit ,by using the scheduling queues
• Use single queue
– In this method, only one ready queue is present for
scheduling the jobs for all the blocks irrespective of
size.
Dynamic Allocation Placement Algorithms
• The following algorithm is used to decide which
free block to allocate to a program
• First fit
» Allocate the first hole that is big enough;
» Process is placed in the first hole it can fit in.
• Best fit
» Allocate the smallest hole that is big.
• Worst-fit
» Allocate the largest hole, also search entire list.
Fragmentation:
• Fragmentation occurs when a system contains total
free memory to satisfy any request, but that can’t
be utilized.
• Internal f ragmentation
-Internal fragmentation is that the allocated memory
may be slightly larger than requested memory.
• External fragmentation
-External fragmentation is done when the total
memory space exists to satisfy a request.
PAGING:
• Paging is a memory-management scheme that
permits the logical address space of a process
can be non contiguous.
• Pages
• Logical memory is also divided into blocks of
same size called pages
Memory Allocation in Paging
SEGMENTATION:
• Segmentation is the Memory Management
Scheme that supports user view of memory.
• Logical address space is the collection of
segments
• Segmentation Architecture
– Segments are numbered and referred to by a segment
number ,thus a logical address consists of a tuple:
Segment Number Offset
Segmentation with Paging
• In Segmented Paging, the main memory is
divided into variable size segments which are
further divided into fixed size pages
• Segment Number → It points to the appropriate
Segment Number.
• Page Number → It Points to the exact page
within the segment
• Page Offset → Used as an offset within the page
frame
VIRTUALMEMORY
• Virtual memory is a technique that allows
execution of processes that are not
completely in the physical memory.
DEMAND PAGING:
• A demand-paging system is a paging system with swapping.
• Itinitially loads pages only into memory (not the entire process) as
they are needed.
• Page Fault:
Page Fault is an interrupt that a rises upon a
reference to a page that is not in main memory.
• Handling a Page Fault
Performance of Demand Paging
• The performance of Demand Paging is measured by
computing the effective access time for a demand
paged memory.
• Let p be probability of a Page Fault Rate 0 p 1.
• if p = 0 no page faults
• if p = 1,every reference is a fault
Effective Access Time (EAT)
• The Effective Access Time (EAT) is computed as follows
EAT= (1 –p) x memory access +p x page fault time.
Page fault time =page fault over head
+[swap page out ]
+swap page in
+restart over head)
PAGE REPLACEMENT
• Page replacement algorithm decides which
memory pages to be paged out to disk
(Swapout) to allocate memory for another
page
• Types of Page replacement algorithm
• FIFO Page Replacement
• Optimal Page Replacement
• LRU Page Replacement
• FIFOPageReplacement
• FIFO stands for First-InFirst-Out
• Simple page replacement algorithm
• Chooses the―oldest page in the memory
Referencestring: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5
• Numberof page fault=9
• The page fault occurs for the given reference string is shown below
Faultrate=9/12 = 0.75
Optimal Page Replacement:
• Replace the page that will not be used for the
longest period of time in the future
Reference string: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5
Number of page fault=7
Fault rate=7/12 = 0.58
LRU Page Replacement:
Replace the page that has not been used for the
longest period of time in past.
Reference string: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5
Number of page fault=10
Fault rate=10/12 = 0.83
THRASHING
• If a process does not have enough pages ,the
page-fault rate is very high. This leads to high
paging activity called Thrashing.
• A process is spending more time paging than
executing.
Working-Set Model
• The working set strategy is a variable-allocation
method with local scope based on the
assumption of locality of references.
• The pages used by a process within a window
of time are called its working set.
• Page-Fault Frequency
• It establish―acceptable ‖page-fault rate
– If actual rate too low, process loses frame
– If actual rate too high,process gains frame
Page-Fault Frequency (PFF) Strategy
– Define an upper bound U and lower bound L for page fault rates.
– Allocate more frames to a process if fault rate is higher than U.
– Allocate less frames if fault rate is less than L.
•
FILE CONCEPTS
• Named collection of related information that is recorded on
secondary storage such as magnetic disks, magnetic tapes and
optical disks.
• File System
• File system is the mechanism used to control how
data and program is stored and retrieved.
• File system consists of the following parts
– files
– directory structure
– Partitions
File Types
• indicate the internal structure of the file.
The Different types of file
– Data files
– Text file
– Source file
– Object file
– Executable file
• File Attributes
– Name
– Identifier
– Type
– Location
– Size
– Production
– Time,date,and user identification
File operations
– Create
– Write
– Read
– Reposition
– Delete
– Truncate
• Types of Lock
• Shared lock
A shared lock is a reader lock in that several
processes can acquire the lock concurrently.
• Exclusive lock
An exclusive lock behaves like a writer lock; only
one process at a time can acquire such a lock.
FILE ACCESS METHODS
• Sequential access
- information in the file is processed in order
• Direct/Random access
- accessing the records directly
• Indexed sequential access
- index is created for each file which contains pointers to
various blocks
DIRECTORY STRUCTURE
• Directory is a file system structure in which
computer files are stored.
• Directory is also known as folders.
• Files are organized by storing related files in the
same directory.
Logical Structure schemes:
• The different schemes for defining the logical
structure of a directory are
» Single-Level Directory
» Two-level Directory
» Tree-Structured Directories
» Acyclic-Graph Directories
» General Graph Directory
1. Single-Level Directory
• All files are contained in the same directory
Two-level Directory:
• One master file directory(MFD)
• Each user has their own UFD
Tree-Structured Directories
• An extension to the two-tiered directory structure It is extended to
a tree of arbitrary height
• Allows users to create their own subdirectories and to organize
their files
A cyclic-Graph Directories:
– Generalization of the tree-structured directory scheme
FILE SYSTEM MOUNTING
• Mounting is a process by which the operating
system makes files and directories on a storage
device .
• File must be opened before it is used, a file system
must be mounted before it can be available to
processes on the system.
FILE PROTECTION
The information stored in a computer system
must be kept safe from
• Physical damage (reliability)
• Improper access (protection)
Types of Access
– Read: Read from the file
– Write:Write or rewrite the file
– Execute:Load the file into memory and execute it
– Append:Write new information at the end of the file
– Delete: Delete the file and free its space for possible reuse
– List:List the name and attributes of the file

More Related Content

Similar to OS UNIT4.pptx

7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
imrank39199
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
Aisyah Rafiuddin
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
ImranBhatti58
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
Amanuelmergia
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
Harika Pudugosula
 
ch1.ppt
ch1.pptch1.ppt
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
ItechAnand1
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
SujanTimalsina5
 
Operating systems- Main Memory Management
Operating systems- Main Memory ManagementOperating systems- Main Memory Management
Operating systems- Main Memory Management
Chandrakant Divate
 
07-MemoryManagement.ppt
07-MemoryManagement.ppt07-MemoryManagement.ppt
07-MemoryManagement.ppt
hello509579
 
16. PagingImplementIssused.pptx
16. PagingImplementIssused.pptx16. PagingImplementIssused.pptx
16. PagingImplementIssused.pptx
MyName1sJeff
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
UsamaKhan987353
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Memory Management
Memory ManagementMemory Management
Memory Management
lavanya marichamy
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
Rohit Jain
 
Os
OsOs
Computer Architecture & Organization.ppt
Computer Architecture & Organization.pptComputer Architecture & Organization.ppt
Computer Architecture & Organization.ppt
FarhanaMariyam1
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
Welly Dian Astika
 
Os concepts
Os conceptsOs concepts
Os concepts
Sudheesh P Enathu
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
ChethanaThammaiah
 

Similar to OS UNIT4.pptx (20)

7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 
Operating systems- Main Memory Management
Operating systems- Main Memory ManagementOperating systems- Main Memory Management
Operating systems- Main Memory Management
 
07-MemoryManagement.ppt
07-MemoryManagement.ppt07-MemoryManagement.ppt
07-MemoryManagement.ppt
 
16. PagingImplementIssused.pptx
16. PagingImplementIssused.pptx16. PagingImplementIssused.pptx
16. PagingImplementIssused.pptx
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
Os
OsOs
Os
 
Computer Architecture & Organization.ppt
Computer Architecture & Organization.pptComputer Architecture & Organization.ppt
Computer Architecture & Organization.ppt
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Os concepts
Os conceptsOs concepts
Os concepts
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 

More from DHANABALSUBRAMANIAN

unit 2.ppt
unit 2.pptunit 2.ppt
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
DHANABALSUBRAMANIAN
 
Unit 4.ppt
Unit 4.pptUnit 4.ppt
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit -- 5.ppt
Unit -- 5.pptUnit -- 5.ppt
Unit -- 5.ppt
DHANABALSUBRAMANIAN
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit - 5.ppt
Unit - 5.pptUnit - 5.ppt
Unit - 5.ppt
DHANABALSUBRAMANIAN
 
Unit - 3.ppt
Unit - 3.pptUnit - 3.ppt
Unit - 3.ppt
DHANABALSUBRAMANIAN
 
unit -1.ppt
unit -1.pptunit -1.ppt
unit -1.ppt
DHANABALSUBRAMANIAN
 
Unit -2.ppt
Unit -2.pptUnit -2.ppt
Unit -2.ppt
DHANABALSUBRAMANIAN
 
OS UNIT1.pptx
OS UNIT1.pptxOS UNIT1.pptx
OS UNIT1.pptx
DHANABALSUBRAMANIAN
 
OS UNIT2.ppt
OS UNIT2.pptOS UNIT2.ppt
OS UNIT2.ppt
DHANABALSUBRAMANIAN
 
OS Unit5.pptx
OS Unit5.pptxOS Unit5.pptx
OS Unit5.pptx
DHANABALSUBRAMANIAN
 
OS UNIT3.pptx
OS UNIT3.pptxOS UNIT3.pptx
OS UNIT3.pptx
DHANABALSUBRAMANIAN
 

More from DHANABALSUBRAMANIAN (15)

unit 2.ppt
unit 2.pptunit 2.ppt
unit 2.ppt
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
Unit 4.ppt
Unit 4.pptUnit 4.ppt
Unit 4.ppt
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
Unit -- 5.ppt
Unit -- 5.pptUnit -- 5.ppt
Unit -- 5.ppt
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
Unit - 5.ppt
Unit - 5.pptUnit - 5.ppt
Unit - 5.ppt
 
Unit - 3.ppt
Unit - 3.pptUnit - 3.ppt
Unit - 3.ppt
 
unit -1.ppt
unit -1.pptunit -1.ppt
unit -1.ppt
 
Unit -2.ppt
Unit -2.pptUnit -2.ppt
Unit -2.ppt
 
OS UNIT1.pptx
OS UNIT1.pptxOS UNIT1.pptx
OS UNIT1.pptx
 
OS UNIT2.ppt
OS UNIT2.pptOS UNIT2.ppt
OS UNIT2.ppt
 
OS Unit5.pptx
OS Unit5.pptxOS Unit5.pptx
OS Unit5.pptx
 
OS UNIT3.pptx
OS UNIT3.pptxOS UNIT3.pptx
OS UNIT3.pptx
 

Recently uploaded

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 

Recently uploaded (20)

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 

OS UNIT4.pptx

  • 1. UNIT – IV STORAGE MANAGEMENT AND FILE SYSTEMS INTERFACE
  • 2. STORAGE MANAGEMENT: • Storage management is the process of • Controlling and coordinating computer memory • Assigning portions called blocks to various running programs to optimize overall system performance(Allocating Process) • Freeing it for reuse when no longer needed (Deallocating process)
  • 3. • Motivation • Keep several processes in memory to improve a systems performance – Allows Multiprogramming • Instruction execution cycle All computers have an instruction execution cycle. A basic instruction execution cycle can be broken down into the following steps: – Fetch cycle – Execute cycle
  • 4. Steps in Fetch/ExecuteCycle • The instruction is fetched from memory addressed by PC (Program Counter) • PC is advanced to address the next instruction • Instruction Decoder decodes the instruction held in IR • Instruction is then executed. • Results are stored back to the memory
  • 5. Memory Space Protection: Memory protection is away to control memory access rights on a computer.
  • 6. SWAPPING: • Swapping refers to moving entire processes in and out of main memory.
  • 7. • RoundRobin CPU-Scheduling Algorithm -Each process is provided a fix time to execute called time slice or quantum • Priority-based scheduling algorithms -Each process is assigned apriority. Process with highest priority is to be executed first and so on -Processes with same priority are executed on first come first serve basis
  • 8. CONTIGUOUS MEMORY AL LOCATION • Memory Allocation Memory Allocation is the process of assigning blocks of memory on request for the program execution. • Memory Allocation mechanism • Operating system uses the following memory allocation mechanism. • Single-partition allocation • Multiple-partition allocation
  • 9. Single-partition allocation: • The operating system resides in the low memory. The remaining memory treated as a single partition. • This single partition is available for userspace. • Only one job can be loaded in this user space
  • 10. Multiple-partition allocation: • Main memory is divided into a number of fixed- sized partitions where each partition should contain only one process. • When a partition is free, a process is selected from the input queue and is loaded into the free partition.
  • 11. Memory Allocation: 1.Fixed Partitions Scheme: • In this type of allocation, main memory is divided into a number of fixed-sized partitions where each partition should contain only one process. 2.Variable Partition Scheme: • Partitions are of variable length and number .Process is allocated exactly as much memory as required
  • 12. Methods to assign processes to partitions: • There are two ways to assign processes to partitions • Use multiple queues -Assign each process to the smallest partition within which it will fit ,by using the scheduling queues • Use single queue – In this method, only one ready queue is present for scheduling the jobs for all the blocks irrespective of size.
  • 13.
  • 14. Dynamic Allocation Placement Algorithms • The following algorithm is used to decide which free block to allocate to a program • First fit » Allocate the first hole that is big enough; » Process is placed in the first hole it can fit in. • Best fit » Allocate the smallest hole that is big. • Worst-fit » Allocate the largest hole, also search entire list.
  • 15. Fragmentation: • Fragmentation occurs when a system contains total free memory to satisfy any request, but that can’t be utilized. • Internal f ragmentation -Internal fragmentation is that the allocated memory may be slightly larger than requested memory. • External fragmentation -External fragmentation is done when the total memory space exists to satisfy a request.
  • 16. PAGING: • Paging is a memory-management scheme that permits the logical address space of a process can be non contiguous. • Pages • Logical memory is also divided into blocks of same size called pages
  • 17.
  • 18.
  • 20. SEGMENTATION: • Segmentation is the Memory Management Scheme that supports user view of memory. • Logical address space is the collection of segments • Segmentation Architecture – Segments are numbered and referred to by a segment number ,thus a logical address consists of a tuple: Segment Number Offset
  • 21.
  • 22. Segmentation with Paging • In Segmented Paging, the main memory is divided into variable size segments which are further divided into fixed size pages • Segment Number → It points to the appropriate Segment Number. • Page Number → It Points to the exact page within the segment • Page Offset → Used as an offset within the page frame
  • 23.
  • 24. VIRTUALMEMORY • Virtual memory is a technique that allows execution of processes that are not completely in the physical memory.
  • 25. DEMAND PAGING: • A demand-paging system is a paging system with swapping. • Itinitially loads pages only into memory (not the entire process) as they are needed.
  • 26. • Page Fault: Page Fault is an interrupt that a rises upon a reference to a page that is not in main memory.
  • 27. • Handling a Page Fault
  • 28. Performance of Demand Paging • The performance of Demand Paging is measured by computing the effective access time for a demand paged memory. • Let p be probability of a Page Fault Rate 0 p 1. • if p = 0 no page faults • if p = 1,every reference is a fault Effective Access Time (EAT) • The Effective Access Time (EAT) is computed as follows EAT= (1 –p) x memory access +p x page fault time. Page fault time =page fault over head +[swap page out ] +swap page in +restart over head)
  • 29. PAGE REPLACEMENT • Page replacement algorithm decides which memory pages to be paged out to disk (Swapout) to allocate memory for another page • Types of Page replacement algorithm • FIFO Page Replacement • Optimal Page Replacement • LRU Page Replacement
  • 30. • FIFOPageReplacement • FIFO stands for First-InFirst-Out • Simple page replacement algorithm • Chooses the―oldest page in the memory Referencestring: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5 • Numberof page fault=9 • The page fault occurs for the given reference string is shown below Faultrate=9/12 = 0.75
  • 31. Optimal Page Replacement: • Replace the page that will not be used for the longest period of time in the future Reference string: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5 Number of page fault=7 Fault rate=7/12 = 0.58
  • 32. LRU Page Replacement: Replace the page that has not been used for the longest period of time in past. Reference string: 1, 2,3,4, 1,2, 5,1,2,3, 4, 5 Number of page fault=10 Fault rate=10/12 = 0.83
  • 33. THRASHING • If a process does not have enough pages ,the page-fault rate is very high. This leads to high paging activity called Thrashing. • A process is spending more time paging than executing.
  • 34. Working-Set Model • The working set strategy is a variable-allocation method with local scope based on the assumption of locality of references. • The pages used by a process within a window of time are called its working set.
  • 35. • Page-Fault Frequency • It establish―acceptable ‖page-fault rate – If actual rate too low, process loses frame – If actual rate too high,process gains frame Page-Fault Frequency (PFF) Strategy – Define an upper bound U and lower bound L for page fault rates. – Allocate more frames to a process if fault rate is higher than U. – Allocate less frames if fault rate is less than L. •
  • 36. FILE CONCEPTS • Named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tapes and optical disks. • File System • File system is the mechanism used to control how data and program is stored and retrieved. • File system consists of the following parts – files – directory structure – Partitions
  • 37. File Types • indicate the internal structure of the file. The Different types of file – Data files – Text file – Source file – Object file – Executable file
  • 38. • File Attributes – Name – Identifier – Type – Location – Size – Production – Time,date,and user identification File operations – Create – Write – Read – Reposition – Delete – Truncate
  • 39. • Types of Lock • Shared lock A shared lock is a reader lock in that several processes can acquire the lock concurrently. • Exclusive lock An exclusive lock behaves like a writer lock; only one process at a time can acquire such a lock.
  • 40. FILE ACCESS METHODS • Sequential access - information in the file is processed in order • Direct/Random access - accessing the records directly • Indexed sequential access - index is created for each file which contains pointers to various blocks
  • 41. DIRECTORY STRUCTURE • Directory is a file system structure in which computer files are stored. • Directory is also known as folders. • Files are organized by storing related files in the same directory.
  • 42. Logical Structure schemes: • The different schemes for defining the logical structure of a directory are » Single-Level Directory » Two-level Directory » Tree-Structured Directories » Acyclic-Graph Directories » General Graph Directory 1. Single-Level Directory • All files are contained in the same directory
  • 43. Two-level Directory: • One master file directory(MFD) • Each user has their own UFD
  • 44. Tree-Structured Directories • An extension to the two-tiered directory structure It is extended to a tree of arbitrary height • Allows users to create their own subdirectories and to organize their files
  • 45. A cyclic-Graph Directories: – Generalization of the tree-structured directory scheme
  • 46. FILE SYSTEM MOUNTING • Mounting is a process by which the operating system makes files and directories on a storage device . • File must be opened before it is used, a file system must be mounted before it can be available to processes on the system.
  • 47. FILE PROTECTION The information stored in a computer system must be kept safe from • Physical damage (reliability) • Improper access (protection) Types of Access – Read: Read from the file – Write:Write or rewrite the file – Execute:Load the file into memory and execute it – Append:Write new information at the end of the file – Delete: Delete the file and free its space for possible reuse – List:List the name and attributes of the file