Programming Assignment 4 - File Management

Operating Systems, Fall 2000


Table of Contents

Due Date

This assignment is due on Wednesday, 13 December, no later than 2:00 p.m..

Introduction

In this fourth and last assignment, you will be implementing a simple file system.

Files

A file is a sequence of zero or more words; the size of a file is the number of words contained in the file. An empty file contains no words and has size zero. A file has no predefined maximum size; it may grow until there's no more disk space.

The words in a file of size n are addressed by the numbers 0 to n - 1. The first (or leftmost) word in the file is word 0; the last (or rightmost) word in the file is word n - 1. If two words are adjacent in a file and the first word is word i, then the second word is word i + 1; that is, word address increase consecutively and sequentially from the start of the file.

File Operations

A file pointer is a reference to a word in the file, or to the location just past the last word in the file, which is known as the end-of-file location.

When a file is opened, the file pointer references the first word in the file, or end of file if the file is empty. Read and write operations take place relative to the file pointer, and move the file pointer to reference the word after the data read or written, or the end of file.

There is one file pointer per opened file. If a file is opened more than once, it will have more than one file pointer; for example, a file opened three times will have three file pointers. File pointers are independent of one another; an operation affecting one of a file's file pointers doesn't affect any of the other file pointers.

The File System

The file system is a simple, flat file system. A file name must contain one character and can contain no more than 5 characters. A character can be a letter, of either case, or a decimal digit; case is significant.

System Calls

This assignment implements two new system calls - the seek system call and the delete system call - and extends the interpretation of the device system calls to cover files.

Interrupt Handlers

This assignment does not require any changes to the interrupt handlers.

Notes


This page last modified on 29 November 2000.