Os Unit4-1
Os Unit4-1
SYSTEMS INTERFACE
STORAGE MANAGEMENT:
• 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.
• Internal fragmentation
-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:
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
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