Hardware Reference
In-Depth Information
void ini system (float tick)
proc i;
time unit = tick;
<enable the timer to interrupt every time unit>
<initialize the interrupt vector table>
/* initialize the list of free TCBs and semaphores */
for (i=0; i<MAXPROC-1; i++) vdes[i].next = i+1;
vdes[MAXPROC-1].next = NIL;
for (i=0; i<MAXSEM-1; i++) vsem[i].next = i+1;
vsem[MAXSEM-1].next = NIL;
ready = NIL;
idle = NIL;
zombie = NIL;
freetcb = 0;
freesem = 0;
util fact = 0;
<initialize the TCB of the main process>
pexe = <main index>;
}
10.5
KERNEL PRIMITIVES
The structure of DICK is logically divided in a number of hierarchical layers, as il-
lustrated in Figure 10.1. The lowest layer includes all interrupt handling drivers and
the routines for saving and loading a task context. The next layer contains the func-
tions for list manipulation (insertion, extraction, and so on) and the basic mechanisms
for task management (dispatching and scheduling). All kernel services visible from
the user are implemented at a higher level. They concern task creation, activation,
suspension, termination, synchronization, and status inquiry.
Search WWH ::




Custom Search