Introduction to MSDOS FAT12 File System for COP4610 - OS Principles, Assignments of Operating Systems

A programming assignment for the cop4610 - introduction to operating system principles course, where students are required to implement various features of a file manager for an ms-dos formatted floppy disk using the posix floppy disk driver api. The assignment includes designing and implementing functions for directory listing, changing the current directory, and deleting a file.

Typology: Assignments

Pre 2010

Uploaded on 08/31/2009

koofers-user-rfx-1
koofers-user-rfx-1 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COP4610 - Introduction to Operating System Principles
Programming Assignment 4: MSDOS FAT12 File System
December 8th, 2006
Goal
You will implement a simple file system, MSDOS FAT12 File System. You will design and
implement a set of directory operations on a floppy disk drive.
Project Description
You will implement various features of a file manager for an MS-DOS formatted floppy disk by using
the POSIX floppy disk driver API. This is a user level program and it does not require any kernel
reconfiguration or compilation.
Part A
Design and implement a function to provide a directory listing (like the ls command in UNIX).
int fd_ls();
After you have completed Part A, your function will be able only to list the files in the root directory.
Part B
Design and implement a function to change the current diretory up to one level or to a subdirectory in
the current directory (you do not need to handle pathnames):
int fd_cd(char * directory);
This function assumes that you have implemented subdirectories. You will probably find it helpful to
use a static variable in your file system implementations to represent the current directory. This
function is to manipulate the current directory variable.
You should now modify your ls command to be able to list files in the current directory.
Part C
Design and implement a function to delete a file. It should take the name of a file to delete (from the
current directory) as its argument:
int fd_rm(char * name);
The function needs to find the file, follow its links in the FAT, set each cluster’s entry in the FAT to
mark it as unused, and update the directory entry. In the case of deletion, pay attention to the hidden,
read-only, and system attributes. Files with any of these set should not be deleted.
08/29/05 1/2
pf2

Partial preview of the text

Download Introduction to MSDOS FAT12 File System for COP4610 - OS Principles and more Assignments Operating Systems in PDF only on Docsity!

COP4610 - Introduction to Operating System Principles Programming Assignment 4: MSDOS FAT12 File System December 8th, 2006 Goal You will implement a simple file system, MSDOS FAT12 File System. You will design and implement a set of directory operations on a floppy disk drive. Project Description You will implement various features of a file manager for an MS-DOS formatted floppy disk by using the POSIX floppy disk driver API. This is a user level program and it does not require any kernel reconfiguration or compilation. Part A Design and implement a function to provide a directory listing (like the ls command in UNIX). int fd_ls(); After you have completed Part A, your function will be able only to list the files in the root directory. Part B Design and implement a function to change the current diretory up to one level or to a subdirectory in the current directory (you do not need to handle pathnames): int fd_cd(char * directory); This function assumes that you have implemented subdirectories. You will probably find it helpful to use a static variable in your file system implementations to represent the current directory. This function is to manipulate the current directory variable. You should now modify your ls command to be able to list files in the current directory. Part C Design and implement a function to delete a file. It should take the name of a file to delete (from the current directory) as its argument: int fd_rm(char * name); The function needs to find the file, follow its links in the FAT, set each cluster’s entry in the FAT to mark it as unused, and update the directory entry. In the case of deletion, pay attention to the hidden, read-only, and system attributes. Files with any of these set should not be deleted. 08/29/05 1 / 2

COP4610 - Introduction to Operating System Principles Submission Instructions

  1. Please ensure that your programs work on a standard Linux distribution.
  2. Ensure that all other relevant documents are in place.
  3. Archive these files using the following command: (Assuming that the files and folders are located under the current working directory) %> tar cvf p4-ps-<member 1 last 4 digit SSN>-<member 2 last 4 digit SSN>.tar * (To ensure that this archived file correct before mailing, try to unarchive in a temporary directory and check to ensure all the files are locatable)
  4. Lastly, send a copy of the file to [email protected] with the filename as the subject. List your names and last 4 digit of your SSNs in the content of the message. (In the pass, sending a carbon-copy(cc) of the email to both the team members proves to be a good practice as more parties are involved in ensuring the project is received by its intended recipient, which in this case the teaching assistant, and both team members) 08/29/05 2 / 2