[comp.os.minix] Follow up on Ganesh's article

u-jeivan@utah-gr.UUCP (Eric Ivancich) (03/10/87)

A short while ago, Ganesh Gopalakrishnan (my OS professor) posted an
arctile regarding the assignments he created for his OS class, centered
around Minix.  In that article, he included my changes to mm/alloc.c to
implement memory compaction when an attempt to allocated failed.  There
are two things worth mentioning with regards to this.

First of all, there is a non-fatal bug.  When the processes are moved in
memory, everything gets moved down, with the exception of the command
line.  That is, after compaction, when the user presses the F1 key to
see the processes, the command line field for all processes that were
moved becomed corrupted.  I haven't had the time to figure out exactly
why.  By the way, the moving of a process is implemented in the same
way as forking, and forked processes don't list anything in the command
field, only execve's do.

The other thing worth mentioning is that compaction won't take place
when executing a program.  As I recall (it's been a while since I looked
into it), execve calls a routine max_hole (in mm/alloc.c) to figure out
if the new process image can fit.  However, with compaction implemented,
this IS misleading.  Rather, max_hole should be replaced with a routine
which ADDS up all the memory in the holes so if execve decides it can
start the new process, the call to alloc_mem will compact automatically.

I hope this helps.  I'd be happy to answer any questions, although things
seem pretty straight forward.

I might also mention my overall opinion of Minix as an educational tool.
I found the exercise of changing and adding to a real OS very useful.
However, Minix does have some short-comings.  We had 640K Leading Edges
(don't know the model number) with two floppy disk drives to do our work
on.  This made things almost unbearable.  The
compile/assemble/link/build loop took far too long.  I found myself
doing my editing on a VAX 780 and having it's C compiler check for any
syntax errors, before downloading to the PC and handing things over to
Minix's C compiler.  I'd be interested to see how much more palatable it
is with a hard disk and possbily an 80286.

Eric