Overview of Processes in Minix
Implementation of Processes in Minix

Memory Allocation:

Memory layout after MINIX has been loaded from the disk into memory.  (See figure 2-27)

MINIX directory:
                        usr
                       /  \
                      /    \
                 include   src
                 /  |  \     |
                  minix      kernel
                    |         |
                  type.h      proc.h
                  (p.558)     (p.581)
           (message definition)

Page 558: type.h  (handle message passing)

MINIX Process Table

In MINIX, we actually have process table divided into 3 parts.

We first look at process in kernel table:
Page 581 proc.h

Page 591 MINIX (assembly part)
Once the bootstrap process has loaded the O.S. into memory, control is transferred to the lable MINIX.

Page 601 main
Initialize t as-NR_TASKS (task's number).  We want the tasks have negative label and normal process has positive label.
In C, a[i] is just another way of writing *(a+i).

wants                                              gets

                               User Precesses
                               Servers

 

0
-1
-2
-3
                               Tasks
 

-NR_TASKS                                  0


Page 602, lines 06785 to 06790:  (Set Registers)

  rp->p_map[T].mem_len  = text_clicks;
 rp->p_map[D].mem_phys = text_base + text_clicks;
 rp->p_map[D].mem_len  = data_clicks;
 rp->p_map[S].mem_phys = text_base + text_clicks + data_clicks;
 rp->p_map[S].mem_vir  = data_clicks; /* empty - stack is in data */
 
 
Stack (grow downward)

 

Data (grow upward)
 
Text (Codes)
   (Two processes may read the same program)
Page 596 Restart
Store registers.
Page 595 SAVE
Entry for hardware interrupt.   Get control from process.
Page 595 -s-call
Entry for software interrupt.
Page 605 sys-call Page 606 mini-send
Check deadlock.
Page 607 mini-rec

Page 609 ready

Page 608 pick-proc