Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We're creating a simple simple file system in our Operating Systems Concepts class and I need help getting started. Any help works! A Very Simple
We're creating a simple simple file system in our Operating Systems Concepts class and I need help getting started. Any help works!
A Very Simple File Svstem File system is an integral part of any operating system. The goal of this project is to design and implement a very simple file system on a virtual disk. After successful implementation, you would not only have gained significant insight into the intricacies of a file system, but also have experienced building a moderately complex system. To help you manage your time well, the project is broken down into two parts. Try to finish Part 1 in a week's time Part 1: Virtual Disk File systems are built on storage devices (disks). But UTD cannot afford to get everyone a disk for this project. So, in this part of the project, you will build a virtual disk on a Linux machine You wil emulate a disk using a very large file. You will divide the file into 4K byte blocks. All the blocks are stored sequentially in the file. So, block number 10 will begin at offset 4096 in the file Your virtual disk library should support the following interfaces. int create disk (char* filename, size t nbytes); This function creates the disk. To be specific, the file (filename) of length specified by nbytes is created. On success, it returns 0. Otherwise returns -1 int open disk (char* iilename) This functions opens the file (specified by filename) for reading and writing. On success, returns the file descriptor of the opened file. Otherwise returns -1 int read block (int disk, int block num, char *buf) This function reads disk block block num from the disk pointed to by disk (file descriptor returned by open disk) into a buffer pointed to by buf. On success it returns 0. Otherwise it returns -1 int write block (int disk, int block num, char *buf) This function writes the data in buf to disk block bl ck num pointed to by disk. On success it returns 0. Otherwise returns -1 int close disk (int disk) This function closes the disk. On success returns 0. Otherwise returns -1 All the above functions should be in file disk.c(cpp). Note that this source file should be compiled to a library disk.?. Use file disk.h to define relevant constants and data structures for this library A Very Simple File Svstem File system is an integral part of any operating system. The goal of this project is to design and implement a very simple file system on a virtual disk. After successful implementation, you would not only have gained significant insight into the intricacies of a file system, but also have experienced building a moderately complex system. To help you manage your time well, the project is broken down into two parts. Try to finish Part 1 in a week's time Part 1: Virtual Disk File systems are built on storage devices (disks). But UTD cannot afford to get everyone a disk for this project. So, in this part of the project, you will build a virtual disk on a Linux machine You wil emulate a disk using a very large file. You will divide the file into 4K byte blocks. All the blocks are stored sequentially in the file. So, block number 10 will begin at offset 4096 in the file Your virtual disk library should support the following interfaces. int create disk (char* filename, size t nbytes); This function creates the disk. To be specific, the file (filename) of length specified by nbytes is created. On success, it returns 0. Otherwise returns -1 int open disk (char* iilename) This functions opens the file (specified by filename) for reading and writing. On success, returns the file descriptor of the opened file. Otherwise returns -1 int read block (int disk, int block num, char *buf) This function reads disk block block num from the disk pointed to by disk (file descriptor returned by open disk) into a buffer pointed to by buf. On success it returns 0. Otherwise it returns -1 int write block (int disk, int block num, char *buf) This function writes the data in buf to disk block bl ck num pointed to by disk. On success it returns 0. Otherwise returns -1 int close disk (int disk) This function closes the disk. On success returns 0. Otherwise returns -1 All the above functions should be in file disk.c(cpp). Note that this source file should be compiled to a library disk.?. Use file disk.h to define relevant constants and data structures for this libraryStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started