[comp.os.minix] More Questions About Minix 1.5's Kernel

mcm@peach.ucsb.edu (Marcelo C. Mourier) (06/07/90)

Hello Everybody!

    Thanks a lot to those who helped me with my previous questions about
Minix 1.5's kernel.  Just to keep you busy, here's two more...

Note: When refering to a certain piece of code, I'll use the following
      notation: [filename, line number(s)].

    The first one is regarding function unready().  This function is
called directly only twice: [proc.c, 203, 269], and indirectly through
lock_unready() three times: [system.c, 314, 530, 685].  In proc.c it is
called from mini_send() to block the caller when the destination is not
waiting for the message, and from mini_rec() to block the caller when no
message is available.  In both cases the call looks like this:

            if (caller_ptr->p_flags == 0)  unready(caller_ptr);

The question itself is: why the p_flags check is necessary?  If you trace
back the value of caller_ptr you find that is equal to proc_ptr.  So how
come proc_ptr->p_flags NOT be zero..?

    The second question is regarding unready() itself [proc.c, 373].  This
function is in charge of removing a task, server process, or user process
from its corresponding ready queue.  In all three cases the first thing done
is the following check:

        if ( (xp = rdy_head[XXXX_Q]) == NIL_PROC)  return;

The question is: under what circumstances can we find the ready queue of the
process/task to be blocked empty..?  It looks as if the queue should have at
least the process/task that is going to be removed from it.

    A final question, this one directly addressed to Dr. Tanenbaum.  Is the
next package from PH going to include a function and symbol cross reference
listing (like the one in the book), besides the code listing?  I'm finding it
very hard trying to read the code without this cross reference, and I think
I'd would by the whole package just to have it.  But of course it would be
much nicer if PH could make the code listing + cross reference available
separately  :-)

    Thanks,

Marcelo - mcm@cs.ucsb.edu