nut 2.3  explain

change from nut 2.2

Nut compiler and Som code generator does not change.

this package includes NOS 1.1 which is a bug fixed version of NOS 1.0.  Now the NOSS can run multi-thread correctly.  (demonstrate 3 processes running concurrently).  Still in progress is: wait, signal to be tested properly.

recognising that a user-task is executed when restore C-state occurs is the key to debug NOS successfully.  Calling eval() once has the effect of

1) start a new stack segment that is used to run switchp
2) run switchp which will arrange the process-list
3) switchp did restore C-state which actually stop the switchp
   and start running the user task.

If there is no task (all tasks are terminated) then eval() comes back without executing any user code.  NOSS now must determine if it will terminate by checking the process-list (activep is not empty).  If there is a task, it continue to simulate another time quantum by

1) saving the current C-state
2) update status (of eval) to user-space (to be used by switchp).
3) loop to do switchp

status in NOS becomes an output variable from NOSS to user-space so that when switchp is run, it knows the status of the process when interrupt occurs.  NOSS checks the process-list empty by itself to terminate the simulation.

24 Jan 2005