Cpsc503 Operating Systems Fall 2017 Project 2 A Portable

Cpsc503 Operating Systems Fall 2017 Project 2 A Portabl

CPSC503 Operating Systems Fall 2017 Project 2 – A Portable File System using Contiguous Allocation Method for GCP VM Due: Friday, December 1, 2017. 11:59:59 PM (EST) Objective: 1. Practical experience with the problems of file systems. 2. Experience with the Windows or Unix/Linux operating system. 3. Keep the definition simple. Don't read things into the problem that aren't there. These will be individual projects. For Project 2 you will use any operating system under Google Cloud Platform (GCP) VM. You may write the program in any language that is supported under any Integrated Development Environment (IDE) that runs on your selected OS on VM. Keep in mind that more help may be available to you in some languages than in others. Furthermore, available controls, etc. may make some of these tasks easier in one language than in another. Problem Statement: Implement a Portable File System (PFS) with Contiguous Allocation Method, which can perform “Allocate a file”, and “Move files from the Windows file system into your file.” You should have your own directory structure, allocation table, etc. inside your file. Move files back out of your file to the Windows file system or Linux/Unix file system. When your program is running it should somehow accept the following commands: open PFSfile Allocate a new 10 KByte "PFS" file if it does not already exist. If it does exist, begin using it for further commands. put myfile Copy the Windows (or Unix/Linux) file "myfile" into your PFS file. get myfile Extract file "myfile" from your PFS file and copy it to the current Windows (or Unix/Linux) directory. rm myfile Delete "myfile" from your PFS file. dir List the files in your PFS file. putr myfile "Remarks" Append remarks to the directory entry for myfile in your PFS file. kill PFSfile Delete the PFSfile from the Windows file system. quit Exit PFS. You can provide those commands through command line interface ONLY (No GUI will be accepted). Limits: 1. PFS is NOT a memory based file system, but based on the existing file system on your OS, such as Windows or Linux/Unix. 2. Command-Line Interface (CLI) Only, i.e., cmd.exe (in Windows) or shell interface (in Unix/Linux). When PFS is executed, it will show the prompt as: C:\> pfs.exe PFS> open pfs 3. Filenames are a maximum of 20 bytes. And, file extension is optional like Unix/Linux. 4. The directory need handle only Name, Size, Time and Date. For example, PFS> dir Test1.txt 128 bytes 12:30 PM September 2 Test2.txt 512 bytes 11:00 AM November 11 Lee.exe 1k bytes 08:52 PM September 1 ... 5. If the original PFS file fills up then you should create a new PFS "volume" with the same name but a different suffix - e.g., pfs.1, pfs.2, etc., each the same size as the first "volume". 6. Your file system should use Contiguous Allocation for an allocation scheme where “disk block” size is 256 bytes. 7. In your files system, each file has one File Control Block (FCB) that includes file name, file size, create time, create date, starting block ID, ending block ID and more (if needed). 8. Your file system should consist of two main parts, i) Directory Structure and ii) Data Blocks. Therefore, you need to define the directory data structure that includes File Control Block (FCB) for each file. 9. In addition, your files system should be able to manage free blocks. You can use any techniques that you learned in the classroom, such as bit map (vector) or linked free space management. Free block management should be part of directory structure. 10. You should handle unusual conditions such as trying to put a file into the PFS when a file with that name is already there, file too large to fit into one "volume", etc. If you need to make assumptions, do so. Make a “reasonable” choice & include it in the write-up. Reasonable means that you can explain the logic behind your choice. These problems change each semester and it is difficult to imagine every question that might come up. It is advisable to ask Professor Lee or the GA if in doubt. Write-up You should submit a write-up as well as your program. Your write-up should include any known bugs, limitations, and assumptions in your program. This write-up should be in text-format and titled as ‘README’. It should be submitted along with your code. The GA will use the ‘README’ file to compile (or install) and run your program. If the GA has trouble with your program then he will contact you to make it up. Submission You will submit your program using Canvas Assignment ( ). If you have any trouble to use Canvas, contact GA or instructor. You should zip your source files and write-up (README) into a single file and submit it. Ensure that you include everything necessary to unzip on another machine and compile/run. This may include forms, modules, classes, configuration files, etc. DO NOT include the executable itself, as we will recompile. The filename should be your “UB account”_“ID”_“Project2”. For example, “jelee_000000_Project2.zip”. Make sure your name and UB ID are listed in your write-up and source code. You may resubmit your program any number of times, but only the latest count for grading. Late submissions are penalized at 10 points per day. Early submission is encouraged. If your program is not working by the deadline, submit it anyway for partial credit and review with the GA. Do not take zero just because it’s not fully working. If you have trouble, ask the professor or GA. Grading points:

  • 10 points: Defined Data Structure for FCB, Directory, File Block (presentation during a presentation and write-up)
  • 10 points: Allocate new PFS file
  • 10 points: Copy file into PFS
  • 10 points: Extract file from PFS
  • 10 points: Handle second PFS Extent when full
  • 10 points: Kill PFS file
  • 10 points: Delete file from PFS
  • 10 points: Add remarks to a file
  • 10 points: Directory listing
  • 5 points: Write-up
  • 5 points: Comments in code

Extra credit (max 15):

  • Encrypt the PFS
  • Associate a program with a PFS file & launch it
  • Associate a program to be run against this file
  • Extract "myfile" and run it with the associated command

Comments should be detailed, explaining functions, data items, and significant lines.

Paper For Above instruction

The assignment involves creating a portable file system (PFS) that uses a contiguous allocation method, designed to work within a GCP Virtual Machine environment. The goal is to gain practical experience with file system management, command-line interface programming, and OS-level file handling. The system must support functionalities such as creating, copying, retrieving, deleting, and listing files, alongside managing file remarks and handling multiple volumes if a single volume fills up.

The core component of this project is developing a file management system that simulates a simplified, contiguous allocation-based storage mechanism. The program must interact with the host OS’s file system, enabling users to transfer files into and out of their custom PFS. While the design is straightforward—using contiguous blocks of 256 bytes—the implementation requires careful management of free blocks, directory structure, and file control blocks, which include essential metadata such as filename, size, creation time, and block locations.

Key to the project is designing an efficient directory data structure that maintains File Control Blocks (FCBs), which act as the metadata for each stored file. These FCBs should store information like filename (max 20 characters), file size, creation timestamp, starting and ending block IDs, and user remarks (if supplied). The directory management should also facilitate operations like file existence checking, conflict handling, and marking deleted entries without immediate erasure—possibly using a “soft delete” approach.

Efficient free block management is crucial, with approaches such as bit maps or linked free space managing the allocation and deallocation of data blocks transparently. When the PFS reaches capacity, the program should automatically generate a new volume with an incremented suffix (e.g., pfs.1, pfs.2). Implementation involves creating a command loop that accepts user commands: open, put, get, rm, dir, putr, kill, and quit, all via command line, with appropriate prompt display.

Handling exceptional conditions—such as attempting to store a file when the volume is full, duplicate file names, or files too large for a single volume—is essential. Assumptions should be reasonable and documented in a README file accompanying the source code. The project criteria emphasize thorough documentation, including detailed comments, data structure explanations, and potential limitations.

The deliverables include the source code, a README document explaining assumptions, limitations, and bugs, and a submission through Canvas as a zip archive named with the student's UB account ID. Post-deadline, partial grades can still be earned based on program functionality and documentation quality. Extra credit opportunities include encrypting the file system, associating external programs, and automating program execution with files.

Overall, this project aims to deepen understanding of file system architecture, management, and OS-level programming, providing hands-on experience in system design, data management, and command-line software development within a cloud VM environment.