CSC 369H: Configure and Compile OS/161

Before you start following the instructions in this document, make sure you have set up you account (or installed the appropriate tools on your home machine) and have checked out a copy of the source code.

  1. Configure your tree for the machine on which you are working. If you want to work in a directory that's not $HOME/csc369, you can use the --ostree option to tell configure where the root of your install tree is located. (./configure --help explains the other options.)
  2.   % cd a1/src
      % ./configure
    or,
      % ./configure --ostree=$HOME/csc369/root
      You should now have a defs.mk file in your src directory. Note that this step is only needed once when you initially set up the source tree.

  3. Configure a kernel named ASST1. Starting from the src directory:
  4.   % cd kern/conf
      % ./config ASST1
  5. Build the ASST1 kernel.
  6.   % cd ../compile/ASST1
      % bmake depend
      % bmake
  7. Install the ASST1 kernel.
  8.   % bmake install
  9. Now also build the user level utilities.
  10.   % cd ../../..
      % bmake
      % bmake install
That's it! You should now have a kernel, and the user level utilities installed under ~/csc369/root.

Running your kernel

  1. Copy the file from your working copy of your repo.../a1/src/sys161.conf to ~/csc369/root
  2. Change into your root directory.
  3.   % cd ~/csc369/root
  4. Run the machine simulator on your operating system.
      % sys161 kernel

    As the system boots, it will print some messages on the console, including a list of all the devices that are found. It finishes by displaying the OS/161 kernel prompt.
  5. At the prompt, type ? to see the menu.
  6. type ?o for the operations menu. Many of these commands do not do anything useful yet, however, the "p" command can be used to load and execute a single user-level program. You can also type ?t at the menu prompt to display a list of test programs. Try running some of them.
  7. At the prompt, type p /sbin/poweroff <return>. This tells the kernel to run the "poweroff" program that shuts the system down.

Congratulations! You are now ready to start assignment 1.