0% found this document useful (0 votes)
23 views4 pages

CSE 4600 Operating Systems Homework Assignment 9: File Systems

Uploaded by

008133327
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

CSE 4600 Operating Systems Homework Assignment 9: File Systems

Uploaded by

008133327
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CSE 4600 Operating Systems

Homework Assignment 9: File Systems

Part I Long Answer Questions. Please provide your own responses to the
questions, using original wording, and refrain from directly copying information
from the lecture notes.

Question 1. (2 points) Please provide an overview of SEVEN key attributes


commonly associated with files in computer systems.
- Name – the only information that is located inside a human-readable form.
- Identifier - non-human-readable name that identifies a file within its own
system.
- Type – required for systems supporting various files.
- Location – a pointer to the file location
- Size – how large the file is, which would be measured in bytes, words, or
blocks as the units.
- Protection – determines who can do the reading, writing, and/or executing.
- Timestamps and user identification – may be kept for display of creation ,
last modification and/or use.

Question 2. (2 points) Please explain SEVEN frequently employed file operations


in computer systems.
- Creating file
- Opening file
- Writing file
- Reading file
- Repositioning within file
- Deleting file
- Truncating file

1
Question 3. (3 points) Please explore the system calls related to file operations
create(), open(), read(), write(), and close() in Linux (you may use the manual
pages), and describe their functionalities, parameters, and return values.

- Read() – contains a file descriptor in which the user is capable of reading the
amount of count bytes that are contained.

Question 4. (3 points) Please explain the contiguous, linked, and indexed


allocation methods, along with their respective advantages and disadvantages.

- Contiguous allocation is where each set occupies a set of contiguous blocks.


The advantages are that it has the best performance and has an easy starting
location. Disadvantages are that it can be complicated to find space for a
certain file or being familiar with the file being used.
- Linked allocation is where each filled would be mixed along the disk. An
advantage is that it doesn’t contain any external fragmentation. The
disadvantages are that it contains sequential access files and the pointers
have space that is available to it.
- Indexed allocation is where each file would contain its own index block,
which are pointers to the data blocks. An advantage is that it reduces the
amount of external fragmentation. A disadvantage is that if the index is
faulty, it can result in the loss of the whole file.

Question 5. (3 points) Please describe the I node (index node) structure used in
Unix-like file systems.

- It contains 32-bit addresses along with 4K bytes in each block. The model of
the I node contains a direct block and 3 indirect blocks.

2
Question 6. (2 points) Please describe two commonly used free space management
methods.

- Linked list – all blocks, which contain a pointer to the next free disk, would
be linked together to the first block that is free.

Question 7. (3 points) The xv6 file system implementation is organized in seven


layers. please refer to Chapter 6 File System in the xv6 book and provide a
description of the seven-layer file system architecture employed in xv6.

- Log-structured file system (LFS) layer: This layer is responsible for


managing the disk blocks and organizing them in a log-structured manner.
- Buffer cache layer: This layer provides a cache for disk blocks in memory,
allowing for faster access to frequently used data.
- File system layer: This layer manages the file system metadata, such as
inodes and directories, and provides operations for file manipulation.
- Virtual file system (VFS) layer: This layer abstracts the underlying file
system implementation, allowing for different file systems to be supported
without changing the higher layers.
- Block I/O layer: This layer handles reading and writing disk blocks,
interacting with the disk driver to perform these operations.
- Disk driver layer: This layer communicates with the hardware disk
controller to read and write data to the physical disk.
- IDE disk driver layer: This layer specifically deals with IDE disk controllers,
providing an interface for the disk driver layer to interact with IDE disks.

Question 8. (2 points) The file system must have a plan for where it stores inodes
and content/data blocks on the disk. To do so, xv6 divides the disk into several
sections, as shown in the following figure. Please describe the information is stored
in each section.

3
Boot – initializes the system in which the remaining OS would get stored into
memory, otherwise known as the bootstrap code.
Super – stores the block numbers of the I nodes in the table and the data bitmap.
Log – helps store transaction logs, which are useful for recovering the file system
whenever the system itself freezes and/or crashes.
I nodes – data structures that store metadata about files.
Bit Map – some blocks can be free, and some are allocated. It this characteristic’s
job to keep track of which blocks, specifically, are either free or allocated.
Data – files would be stored in data blocks, whereas the data blocks would be
located in this segment.

You might also like