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 project should be done by each person in the class, whether individually, or collaborating with others in the class. At the end of the project, you should have your own installation of Minix that can be used in future projects.

You may use any libraries that are part of the standard Minix distribution.

The project should be sent to the instructor 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. Simulators include qemu/KVM, virtualbox, Bochs, Plex86 and Vmware. Bochs may be the slowest, but will run on non-x86 platforms.

Follow the instructions in the Appendix A of the textbook (starting on p. 629) or at the Minix 3 download page (the setup guide). You follow these instructions, which include

  1. partitioning the hard disk -- note that minix cannot handle partitions larger than 128GB.
  2. booting minix from the CD (or the simulator equivalent)
  3. starting the setup script
After installing Minix, rebuild the entire operating ssytem. If you have a floppy drive you may use that, or you may use a pre-existing bootloader or the Minix bootloader.

You may have questions while doing this. The documentation, the web, the course mailing list, and the instructor often have some of the answers.

Testing your kernel hacking abilities

I want you to print the name of every command being executed. To do this, you have to modify file servers/pm/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). For example, if a process executes /bin/ls, your code should print to the console "executing /bin/ls". This mainly confirms that you are executing the kernel you think you are executing, yet not get in the way of running Minix.

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" operating system that you can use in future projects.

Optional

If you have the time and interest, dual-boot your machine to also boot some version of linux, or if using a simulator, have another virtual machine that will run linux. Distributions of Linux that may be relatively easy to install include Ubuntu and Linux Mint, Gentoo (if you have plenty of disk space on your machine), Puppy Linux if you want a really small distribution, and Fedora or Open Suse for more enterprise-oriented distributions.

Instead of Linux, you may do this for OpenBSD. One of the goals of the OpenBSD project is a more secure operating system.

Once you have installed your additional system, get the kernel sources (e.g. from http://www.kernel.org/ for Linux), compile them, and install the kernel. For Linux, this can require paying attention to the many, many options, or sticking with the defaults.

Finally, figure out where the exec system call is defined, and change the implementation of that system call to print the program being executed.

This part is optional, and will not be graded, but will be reviewed if you submit it.

If you would prefer to do get credit for installing and modifying a Linux or BSD OS rather than Minix, please talk with the instructor (in person, f2f) as far in advance as possible.