1/99
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is a file directory
A special file that stores information about other files and directories
What does each directory entry contain
A file name and information needed to access that file
What is a tree structured directory hierarchy
A structure where each directory has one parent and can point to multiple children
What is the root directory
The top level directory with no parent
What is a file system internal ID
A unique identifier assigned to each file or directory for internal use
Are internal IDs visible to users
No
What do users use instead of internal IDs
ASCII names
What is an absolute path
A full path from the root to a file
What symbol usually separates names in a path
Forward slash or backslash
What is a relative path
A path that starts from the current working directory
What is the current working directory
The directory the user is currently in
What does ".." represent
The parent directory
What does the change operation do
Changes the current working directory
What does the create operation do
Creates a new directory
What does the delete operation do
Deletes a directory and all its contents
What does the move operation do
Moves a file or directory to another location
What does the rename operation do
Changes the name of a file or directory
What does the list operation do
Displays contents of a directory
What does the find operation do
Searches for a file or directory by name
What is a directed acyclic directory structure
A structure where files can have multiple parents but no cycles
What problem exists in a tree structure that DAG solves
Limited file sharing
What does the link operation do
Creates another reference to a file or directory
What is a reference count
The number of directory entries pointing to a file
When is a file actually deleted in a DAG
When its reference count becomes 1 and the last link is removed
What happens when a link is deleted but reference count is greater than 1
Only the link is removed and count decreases
What is a cycle in a directory structure
A loop where a directory points back to a higher level directory
Why are cycles dangerous
They can cause infinite loops during searches
What is a symbolic link
A special directory entry that points to a file or directory
How is a symbolic link different from a regular link
Deleting it removes only the link, not the actual file
Why are symbolic links used
To allow sharing without creating multiple parent relationships or cycles
What is a file
A named collection of information stored on secondary storage
What is the purpose of a file system
To manage files and provide access to stored data
Why is direct device management impractical for users
Because devices have complex and varied interfaces
What does the file system hide from users
Details of how data is stored on physical devices
How does a user view a file
As a single abstract unit of data
What are two common views of file structure
Byte stream and record based
What is a byte stream file
A file viewed as a sequence of bytes
What is a record
A group of related data items within a file
How are records identified
By record number or key field
What is an example of a key field
A student ID
What is an access method
A set of operations used to access files
What is the most common access method
Sequential access
How does sequential access work
It reads or writes the next data in order
What does the file system track for sequential access
The current position in the file
What does a read operation do in sequential access
Reads the next n bytes or next record
What is direct access
Accessing data at a specific position
How is direct access performed
By specifying a record number or key
What operation moves to a specific position in a file
Seek
What is required for direct access in record files
A way to calculate record position
What is a fixed length record
A record with the same size as others
Why are fixed length records useful
They allow direct access
How is position calculated in fixed length records
Record number times record length
What is a variable length record
A record with a size that can vary
Why is direct access difficult with variable length records
Because positions cannot be calculated directly
What must be done to find a record in variable length files
Read all previous records
What is file data
The part of the file visible to the user
What is metadata
Information about file structure and organization
Where is metadata stored
In the file header
What is a file header
A section before the file data that stores metadata
What is the purpose of the file header
To help the system understand and manage the file
What is external fragmentation in memory management?
Loss of usable memory due to small gaps between allocated blocks.
What causes external fragmentation when using variable-sized memory allocation?
Allocating and freeing blocks of different sizes creates scattered holes.
What is a “hole” in the context of external fragmentation?
A free block of memory between occupied blocks.
Why does external fragmentation make memory unusable even if free space exists?
Free space is split into small pieces that cannot satisfy large requests.
What is the main difference between a hole and an occupied block?
A hole is free memory. An occupied block is in use by a program.
According to the 50% rule, what is the ratio of holes to occupied blocks?
1 hole for every 2 occupied blocks.
Write the formula that represents the 50% rule.
n = 0.5m
Does the 50% rule depend on allocation strategy? Explain.
No. The ratio stays the same regardless of allocation strategy.
What assumption must hold for the 50% rule to apply?
The probability of finding an exact match is near zero.
Does the 50% rule describe number of holes or total space wasted?
It describes the number of holes, not total space.
How does average hole size affect total memory waste?
Larger holes increase wasted space. Smaller holes reduce waste.
If hole size equals block size, what fraction of memory is wasted?
One third of memory.
Why can smaller hole sizes improve memory utilization?
They reduce the amount of unused memory space.
What happens to the number of holes when a block of type A is released?
It decreases by 1.
What happens to the number of holes when a block of type B or C is released?
It stays the same.
What happens to the number of holes when a block of type D is released?
It increases by 1.
Why does releasing blocks not change the number of holes on average?
All block types are equally likely, so changes cancel out.
Why does allocation not change the number of holes when exact matches are rare?
Allocation only reduces hole size, not the number of holes.
What is meant by a “stable state” in memory allocation?
Average releases equal average allocations.
Why does the hole-to-block ratio remain constant in a stable state?
Because neither allocation nor release changes the average number of holes.
What is memory compaction and how does it address external fragmentation?
It shifts blocks to combine holes into one large hole.
What is swapping and how can it help when no large hole exists?
It moves a block to disk to create a larger free space.
What is internal fragmentation?
Loss of usable memory inside allocated space.
What causes internal fragmentation in paging systems?
Program size is not a multiple of page size.
Where does internal fragmentation occur within a page?
At the end of the last page.
Why does paging eliminate external fragmentation?
All pages and frames have equal size, so no gaps form between them.
Why can paging still lead to wasted memory space?
The last page may not be fully used.
Compare the causes of internal fragmentation and external fragmentation.
Internal is caused by fixed-size pages. External is caused by variable-size allocation.
Compare where unused memory appears in internal vs external fragmentation.
Internal is inside allocated blocks. External is between blocks.
Which type of fragmentation is reduced by compaction and which is not?
Compaction reduces external fragmentation. It does not reduce internal fragmentation.
In contiguous allocation, what does the FCB store to locate a file
The starting block and the file length
A file starts at disk block 50. What disk block stores file block 3
53
Why is sequential access fast in contiguous allocation
Blocks are adjacent, so no seek operations are needed
What is the main cause of fragmentation in contiguous allocation
Free space becomes split into variable sized gaps over time
Why is file expansion difficult in contiguous allocation
The next block may be occupied, so the file must be copied elsewhere
In linked allocation, how is the next block found
Each block contains a pointer to the next block
How many disk reads are needed to access block 2 in a 4 block linked file
3 reads
What is one major disadvantage of linked allocation
Direct access is not possible
In clustered allocation, what does the last block of a cluster store
A pointer to the next cluster and cluster size information
Why is clustered allocation faster than linked allocation
Blocks within a cluster are contiguous, so fewer seeks are needed