3.9 Extra Credit: McDOS

In C, implement a mock OS with a terminal interface.

Your program should accept a path as a command-line argument. If the path exists, then run in execute mode. If it does not, then run in create mode.

In create mode, the program should run with a little interactive prompt which should ask for (a) the size of the disk and (b) the number of users to create, then their usernames and passwords. It should create the disk file, initialize it, and then exit. This should create a format the disk. You can use any format you want for the disk, but you must keep track of the users as well as file contents. The filesystem must store files and directories. Every file should have metadata for an owner, permissions, a create time, a modify time, and a name.

In execute mode, you should display a login prompt, and once logged in, you should get a basic shell that supports the following commands:

This assignment may look complicated, but there’s a very easy way to do all of it. If you need to make it simpler to do it, I’ll give you less extra credit. If you want to make it more complicated, I’ll give you more extra credit.

The assignment is deliberately vague, so that you can flesh it out for yourself.

You must turn in
  • A README file that contains a short write-up of your project. It should discuss the approach you took to solving the problem, it should discuss any problems or issues that still remain, it should discuss any interesting things that you learned in the course of the project. Finally, it should provide the grade you believe the project deserves with a detailed explanation of why. This explanation should almost certainly focus on why you believe the program is correct.

    This file must be in plain-text. If you need formatting, use Markdown. It must be limited to 80 characters wide, unless you are quoting program output.

  • Your source code, named mcdos.c.

  • A Makefile that first builds the program and then tests it by running it in a way that demonstrates each mode, all the features, and the persistence of the data.

This assignment will be graded based on its correctness and your ability to articulate why it is correct.