Vorige Titel Volgende
______________________________________________________________________
We will now look into the system in more detail and see how all this
is stored.
The entire memory is divided up into cells. Each cell is 8 bytes
long and has a startingaddress of the form 8xN where N is the cell-
number. Cellnumbers range from 0-65535. (65535=2^16-1) It is defined
that if there is RAM at address 0 the systemprogram of JANOS is loaded
there. The reason for this is that a pointer to cell 0 is used to
indicate an empty link. (meaning that the object the pointer is
supposed to be pointing to doesn't exist)
From now in the word 'link' will be used to indicate a pointer to
a cell. The link contains the cellnumber. If it points to an object
wich occupies more than one cell the link points to the first cell.
Keeping the same order as before we will start with the tasks.
Every task has a Task Information Block or TIB.
All TIB's are linked in a linear list. (Every TIB has a link to
the next TIB in the list.) In the list the TIB's are sorted from
high to low priority. In every TIB there is a prioritybit. If this
bit is set it indicates that this TIB is the last one in this priority-
level. A lower prioritylevel follows. This system doesn't restrict
the number of prioritylevels.
When a task is started up it is given the same prioritylevel as it's
parent or a lower one. The only thing a task can do with it's priority
is to decrement it.
A TIB contains:
- A link to the next TIB in the TIBlist.
- A link to the list of children of this task. All the children have
a link to the next child of this task. This list is used to abort
all children (and grandchildren and so on) of a task if the task
is aborted.
- A link to the next child of it's parent
- A link to the parent of this task. This is necessary to make it
possible for a task to wait for one of it's children to finish.
- A link to the first piece of RAM used by this task. This link is
meaningless if this task is unapproved. If it is approved every
piece of RAM it uses has a link to the next piece.
- The linklayout. This is a list of segments that are mapped into
the CPU memory when this task is running. (This is equal to the
contents of the MMU when the task is running)
- A link to a directoryelement wichrepresents the programcode this
tasks uses. This link is also used to give the task a name as
every directoryelement has a name.
- A pointer to the home directory. That is to say, a link to the
directoryelement wich represents the home directory. THis home-
directory is used to place files in containing error messages
and such.
- Pointer to the current directory. (=link to directoryelement repre-
senting the current directory) This pointer can be changed by the
task. The task uses it to find files wich are not in it's home-
directory.
- A pointer to the current directoryentry. This pointer points to
a directoryelement in the current directory with wich the task
wants to do something.
- The status of the task. This contains among others:
- A bit wich indicates if this task is waiting for something.
______________________________________________________________________
Vorige Titel Volgende