Description
In Assignment 4, you are required to implement a mechanism of file system
management via GPU’s memory.
Background:
• File systems provide efficient and convenient access to the disk by allowing data
to be stored, located, and retrieved easily.
• A file system poses two quite different design problems. The first problem is
defining how the file system should look to the user. This task involves defining a
file with its attributes, the operations allowed on a file, and the directory
structure for organizing files.
• The second problem is creating algorithms and data structures to map the logical
file system on to the physical secondary-storage devices.
• The file-organization module knows about files and their logical blocks, as well as
physical blocks. By knowing the type of file allocation used and the location of
the file, the file-organization module can translate logical block address to
physical block address for the basic file system to transfer.
• Each file’s logical blocks are numbered from 0 (or 1) through N. Since the
physical blocks containing the data usually do not match the logical numbers, a
translation is required to locate each block.
• The logical file system manages metadata information.
• Metadata includes all of the file-system structure except the actual data (or
contents of the files).
• The file-organization module also includes the free-space manager, which tracks
unallocated blocks and provides these blocks to the file-organization module
when requested.
• The logical file system manages the directory structure to provide the fileorganization module with the information the latter needs, given a symbolic file
name. It maintains file structure via file-control blocks.
• A file-control block (FCB) (an inode in UNIX file systems) contains information
about the file, including ownership, permissions, and location of the file
contents.
• Because there have no OS in GPU to maintain the mechanism of the logical file
system, we can try to implement a simple file system in CUDA GPU with single
thread, and limit global memory as volume.
The GPU File System we need to design:
• We take the global memory as a volume (logical drive) from a hard disk.
• No directory structure stored in volume, only one root directory, no
subdirectory in this file system.
• A set of file operations should be implemented.
• In this project, we use only one of GPU memory, the global memory as a
volume. We don’t create the shared memory as physical memory for any data
structures stored in, like system-wide open file table in memory.
• In this simple file system, we just directly take the information from a volume (in
global memory) by single thread.
Specification:
• The size of volume is 1085440 bytes (1060KB).
• The size of files total is 1048576 bytes (1024KB).
• The maximum number of file is 1024.
• The maximum size of a file is 1024 bytes (1KB).
• The maximum size of a file name is 20 bytes.
• File name end with “\0”.
• FCB size is 32 bytes.
• FCB entries is 32KB/ 32 bytes = 1024.
• Storage block size is 32 bytes.
• fs_open:
Open a file
Give a file pointer to find the file’s location.
Space in the file system must be found for the file.
An entry for the new file must be made in the directory.
Also accept access-mode information: read/write
When to use write mode, if no such file name can be found, create a new
zero byte file.
Return a write/read pointer.
Function definition:
De