CSE 4600 Operating Systems Homework Assignment 9: File Systems
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.
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 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 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.