UMBC CMSC421 UMBC | CSEE | CMSC421 | Spring 1999 (Section 0101)

 

Programming Project #2

CMSC 421, Section 0101 (Spring 1999)

Assigned: 5 Apr 1999
Design due: 12 Apr 1999
Code due: 21 Apr 1999

Goals

There are two goals for this assignment:

To do this, you'll need to understand traps, keyboard I/O, and memory mapping and allocation. You'll also have to do some work on synchronizing user processes.

Background

The OS code has changed somewhat from the first assignment, though the basic routines are still the same. We've added some basic memory management routines to the operating system, and we've introduced page tables to the operating system. As a result, you'll need to get a new copy of dlxos.tgz. In addition, you'll need to use new versions of the simulator, compiler, and assembler. If you're using the versions compiled for you on gl.umbc.edu, you shouldn't need to change anything. If you're running at home, you'll need to get the latest versions and recompile everything.

Virtual memory

The first part of the assignment is to implement virtual memory. Currently, the operating system allocates a single 64KB page to each process and assumes that the process will fit into this page. However, this is inefficient. Many processes will use considerably less than 64KB, and others will use more. To solve this, you should allow processes to use more than one page and then reduce the page size. By making pages 4KB long, you can control the granularity of memory allocation, allowing processes to use less (or more) than 64KB.

Traps

There are already some basic traps provided for you, such as open() (though the code for open() doesn't do anything. Yet...) You should look at these traps as examples for the traps you'll need to implement.

Basic shell

Your basic shell should allow users to type in a command and have it execute. The command can either execute in the foreground (the shell waits for the new process to complete) or in the background (the shell continues without waiting).

Design hints

The DLX hardware supports both 1-level and 2-level page tables. You may use whichever you think is best for your application. Be sure to check out memory.h for definitions relating to page size and other page table issues.

The shell is a user program, and isn't compiled into the operating system. As such, you shouldn't compile it with the rest of the OS files. Instead, compile it separately and load it in. Since the basic operating system comes with the ability to execute user-level processes (albeit by compiling their names into the kernel...), you might want to experiment with them first and use that information to design your shell.

You'll need at least the following traps to implement your shell

You may want to use semaphores or locks to implement Wait(). If you do, be careful about deadlocks....

What to hand in

As with other projects, you'll need to hand in your design documentation and your code. Because your code may include both operating system code and user programs (the shell!), please make sure your Makefile builds them separately.


Syllabus | Slides | News & Notes | Grades | Feedback
How to Submit Assignments | Homework: 1 2 3 4 5 6 | Project: 1 2 3 4


Last updated 14 Apr 1999 by Ethan Miller (elm@csee.umbc.edu)