Operating Systems Project 2


The goals of this project are:
  1. to install a Minix you can use in future projects
  2. to customize the kernel
  3. to verify that you can print from the kernel (and therefore have at least rudimentary debugging capabilities)

This is an individual or group project, at your choice -- but it will be difficult to change that choice in future projects, so choose carefully. You may collaborate with anybody else and search the web, as long as all the code you turn in is authored by you personally. You may use any libraries that are part of the standard Minix distribution.

The project is due Wednesday, September 15th 2003, any time. Submission is by email. Please send me the following:

  1. a brief statement that you have successfully installed minix on your target system, and that you are able to execute programs and recompile and reinstall the operating system. If you are not able to do so, a brief description of what you have been able to achieve.
  2. a brief description of your installation, including whether on a simulator (and if so, which one) or on what hardware, and if on actual hardware, whether you have a dedicated machine or a machine that multi-boots minix and other operating systems. Also (whether on real hardware or on a simulator), the size of your disk and the amount of memory available to the OS.
  3. a copy of the parts of the file exec.c modified as explained below (starting two lines before the first change and ending two lines after your last change). This may be sent inline or as an attachment.

Please send in your project on time -- late submissions will not be accepted, and I prefer to have partially-working projects rather than no project at all.

Installation

I expect that most of the effort in this project will go towards installing Minix.

You must select a target platform, whether a simulator or actual hardware (if you wish to install on actual hardware, the instructor still has one machine available -- but no keyboard or display). Simulators include Bochs (for which Josh Wingstrom has provided a ready-made installation package) or Plex86 and Vmware (the last two may be faster than bochs, but will only run on an x86 platform).

If running Bochs, you can follow Josh's instructions. For all other installations, you follow the instructions in the Minix README.TXT file (in the top level of the CD that came with your textbook, or from Andrew Tanenbaum's Minix installation page). It will tell you to follow instructions in the file MINIX/README.TXT and MINIX/INSTALL.TXT. You follow these instructions, which include

  1. partitioning the hard disk -- note that minix cannot handle partitions larger than 1GB (assuming you use MINIX-386, which I strongly recommend, otherwise the limit is 128MB).
  2. making the floppy disks, or the simulator equivalents. You may need fewer than 9 floppy disks if you are willing and able to create them during the installation, i.e. if you are creating them on a machine other than the one you are installing on.
  3. installing the OS, including the bare system (ROOT and USR) and all the sources (USR.TAZ, SYS.TAZ, and CMD.TAZ)
  4. logging in, setting your machine name (if you like), and testing commands
  5. recompiling the kernel, installing and rebooting the new kernel (I have installed it on a floppy -- make fdboot -- so the base kernel remains untouched on the hard disk, in case the new kernel that I produce by changing the code has any problems).

You may have questions while doing this. The documentation, the web, the mailing list, and the instructor (who can be reached at his office phone, 956-3891 -- but do identify yourself and ask if he is busy) often have some of the answers.

Testing your kernel hacking abilities

I want you to print the path of every file being executed. To do this, you have to modify file /usr/src/mm/exec.c appropriately, then send me your changes (not the entire exec.c file, please) and the 2 lines before and after your changes (my own solution changes a single line, so I would send 5 lines total). You may use printf to print the file that is being executed. For example, if a process executes /bin/ls, your code should print to the console "executing /bin/ls". This is just to confirm that you are executing the kernel you think you are executing (which is often a problem when first debugging kernels).

I also want you to change /usr/include/minix/config.h to set ROBUST to the value 1 -- which may save you much time if your kernel ever fails to reboot when you want it to. You should also check the other options (including the ones mentioned in MINIX/INSTALL.TXT) and set them appropriately.

After making these changes, recompile and make sure your kernel is printing each command that is executed.

Finally, once you have verified that everything works, send me the changes to exec.c, then change them back so you have a "normal" (but ROBUST) operating system that you can use in future projects.