Objectives
1. To understand Minix scheduler implementation.
2. To modify the Minix scheduler and observe effects.
Guidelines
In this lab, you will be working once more on the Minix operating system. You will once again install, run, and rebuild Minix, but you will work on the scheduling algorithm. Minix uses a multi-level priority queue scheduler, and modification of the scheduling algorithm, particularly changes to high priority queues, may make the system unstable. You will need to experiment with what changes can be done safely.
Reminder Getting started with Minix on the ECC Systems
For consistency, it is recommended that you run the provided Minix image on the ECC systems. If you have not done so already, follow these instructions to install and run Minix on the ECC Systems.
Start by setting up VMware
$ setup vmwareThis command prepares vmware to run. You should only need to run it once, until the next time you log into your machine. To obtain a copy of a Minix system image, you can use minix-get-image$ minix-get-image (can tab complete)Please note that this will COMPLETELY ERASE any old image (including any changes you may have made which are not saved outside the Minix system). You must do this once, the first time you are setting up vmware. After that, you should only do this if you need a new image, such as if a modification you make causes your VM to break and become unresponsive. Next, you should run vmware.
$ vmware &
This may take a little while to boot up, so be patient. Dont assume that it is not working.Once it boots up, if you dont see the minix option on the left, go to:
- Open a Virtual Machine -> vm images subfolder -> minix3 subfolder -> minix3.vmx
When you launch the minix system, you will eventually be promoted for a username. The username for the minix system is root (with no password, at least until you set one).
To copy files between the Minix system (running in the vmware virtual machine), and your local system, you may use FTP. Inside of the VM, do the following:
If you have not already, type passwd to give the system a password. Make sure its a password youll easily remember (ask yourself, how secure does this particular system need to be? What would it take for someone to access it?) (Note: If you wipe your minix image, you will need to do this again.)Type the following command (again within the Minix system): tcpd ftp /usr/bin/in.ftpd &
This will launch the FTP daemon in the Minix system, allowing the local system to connect to it through FTP.
Type ifconfig to find out what the IP address for the VM is.Now get out of the VM (with Ctrl+Alt) and open a terminal on the host machine. In that terminal, type:
ftp <the IP address you got from ifconfig>
This will launch FTP.
In case you are unfamiliar with FTP commands:
For Remote Navigation
ls show contents of remote directorypwd show current location in VMcd change directory on the VM
For Local Navigation
lcd show current location on host machinelcd <directory> change location to <directory>
File Transfer
get <file> copy <file> from current location in VM to current location on host.put <file> copy <file> from current location on host to current location in VM.
DO NOT work on files inside of the VM. You should use FTP to transfer files from the VM to the host, work on them there, then transfer them back. This is so that you do not lose all of your progress if you should make a mistake which crashes the VM and corrupts the bootable OS.
The files for which you must search in this lab can be found somewhere beneath the /usr/src directory.
The grep utility can be very helpful for finding which files contain particular strings, and should be very helpful in this lab.
Once you have modified a file and wish to see the effects of your changes, do the following:
Return to the /usr/src directory.
Type make world. This will recompile Minix, and may take some time, so be patient.
When that finishes, type reboot. This will reboot the VM with your modifications in effect.
If your VM freezes/crashes during/after a reboot and you wish to restart with a fresh image and setup, start with the first instructions above to get a fresh copy (and note that it will overwrite your existing copy).
The Minix Scheduler
The goal of this assignment is to gain experience in modifying an operating system kernel, and specifically the process scheduling algorithm. You are to modify the queue selection algorithm to skew the priority scheduling. Specifically, the current selection is based on a pure priority order, then you are to include a random selection of a lower-level priority job. Note that if you modify the priority queue imprudently, the operating system will cease to function. Your goal is to achieve the following:
- upon attempting to select the next job, modify the selection to add a random possibility of choosing from a different level (the lower the probability you choose for this, the more consistent with the current selection mechanism you are, some experimentation may be required to select a reasonable value).
You will be graded based on both your implementation of this modification, and on how well you explain the mechanism. It is therefore important to realize that this is both an exercise in coding, as well as an exercise in familiarizing yourself with, and understanding to the point of being able to explain, an unfamiliar code base.
Observing a change
A second challenge in this assignment is to demonstrate how the scheduler has been modified. You are to note an observable change in behavior between the unmodified and modified schedulers. To achieve this, you may need to write a simple test program (e.g., a simple hello world program that identifies which process is running).
Additional Resources:
- Minix Wiki: https://en.wikipedia.org/wiki/MINIX
- Minix user guide: https://wiki.minix3.org/doku.php?id=usersguide:start
- Minix installation guide: https://wiki.minix3.org/doku.php?id=usersguide:doinginstallation
Reviews
There are no reviews yet.