CSE 451 Assignment 0

Due: Friday, October 3, 9:00pm

The project is to be done in groups of 2-3. Everyone in the group should be able to answer the questions in this assignment. If you have not formed a group yet, please get started on the assignment anyway, and then compare answers and resolve any questions you may still have.

Overview

The purpose of this assignment is to introduce you to the code you will be using throughout the rest of the course. We will do significant portions of this assignment in lecture and section. Even if you found answers to some of these questions during class, include them in your answers to hand in.

By the time you complete this assignment and the related in-class work, you should be able to:


What You Must Hand In

You must turn in the answers to the code-reading questions via Catalyst.


Getting Started

To pull the baseline code for OS/161:
% git clone /projects/instr/14au/cse451/os161

This creates a directory named os161 containing the source code for the operating system and various utilities.

The operating system is written for a cache-coherent MIPS computer named System/161. For this, you will need to use a cross-compiler: a compiler for generating MIPS instructions, along with various other related tools such as a cross-gdb. You will need to put the following directory in your UNIX path:

/projects/instr/14au/cse451/tools/bin
In this directory you will find all the necessary tools, such as cse451-gcc and cse451-gdb.

See Setting Up a Toolchain if you want to build OS/161 for your own VM.

Typical practice when developing a new OS is to run it on a machine simulator. The simulator, sys161, is in the same directory as the cross-compile binaries, along with a few other versions like trace161 and stats161 that may be useful later.

Next, tag your repository to indicate that you are beginning assignment 0. In your git repository, issue the following command:

% git tag asst0-start

Once you have a partner and we have assigned you a shared account, push a copy to the shared account. We will provide you a location for your shared repository, and instructions will be posted after groups have been assigned.

Code Reading Questions (HAND ME IN)

OS/161 is a simplified skeleton of a modern operating system. It comes with a configurable build system, code for some useful user-level utilities that can be run from within OS/161, and of course code for the operating system itself. To complete the assignments of this course, you will need to get your hands deep in the guts of the OS/161 codebase, and the sooner you become familiar with it, the better. To that end, you should look through the files and begin to internalize how the code is structured, what goes where, and how things work. This applies both to the build system and the codebase itself.

To guide you in this process, please write up and hand in answers to the questions below.

The questions are designed to encourage code exploration (we tried to avoid questions you could answer simply using grep). The goal is to help you understand key parts of the system. That said, you are not yet expected to understand everything you see (that's what the rest of the course is for!). But you should get the "gist," and your answers should reflect that. Please give function names and full pathnames in the source tree where appropriate. You don't need to explain what every last line of a function does, but your answers should be conceptually complete. Note that some questions may require longer answers than others.

Let's begin with some discussion questions:

Below is a brief overview of the organization of the source tree, and a description of what goes where.

Now that you've perused the source tree, here is the last question.

Discuss Me! Question 14: Refer to the document Using GDB and run gdb on your kernel. Experiment a bit and follow the execution from the start.S file through the main menu kmain and then to the code that executes some of the commands. Explain the control flow from start.S through the menu and on to other parts of the kernel.


Finally, upload a file with your answers to Catalyst. Normally we would ask you to upload a tar file of the entire directory, but we don't need that for this assignment.

Congratulations! You're done with assignment 0!