Exercise 3: Memory compaction

Introduction

Since MINIX does not support virtual memory you run the risk of running out of memory because of memory fragmentation. In this exercise you have to modify the memory manager to prevent this by compacting memory when it runs out.

Assignment and hints

Relevant information can be found in the OS book in sections: 3.10, 4.7.1-6, 4.8.1-5, and 4.8.8. Check at least the index for the following references:

Testing

The following are some suggested tests. Your code should pass these tests to get a grade at all. The first test should work, with or without memory compaction. The second test should only work on a MINIX kernel with memory compaction.

To properly test this exercise, you should probably add extra test code to the kernel to test your exercise.

Manual pages

chmem(1)
change memory allocation