int AwaitEvent( int EventType );
Implementation notes
but not for the timer event
What do we do when there is no task ready to be scheduled?
IdleTask( ). Why?void IdleTask( ) {
FOREVER ;
}
But in reality it could do anything
Intel decided exactly how you should use the timers when they designed the south bridge.
Interrupt controller we already discussed.
General description of clock and PIC included in 82801 documentation.
What is the structure of the service regime?
Who should initialize timer?
void ClockServer( ) {
Tid requester;
RegisterAs( "ClockServer" );
notifier = Create( ... );
if( notifier < 0 )
// handle error
FOREVER {
length = Receive( *requester, request, requestlen );
if ( length < 0 )
// handle error
else if (!( type = decode( request ) ) )
// handle error
else {
switch( type ) {
case TICK:
time++;
// service queues
break;
case XXX:
// et cetera
}
}
}
void TickNotifier( ) {
server = WhoIs( "clockserver" );
if ( server < 0 )
//handle error
FOREVER {
error = AwaitInterrupt( TIMER );
if ( error < 0 )
//handle error
error = Send( server, nullmessage );
if ( error < 0 )
//handle error
}
}
All the error handling code should be telling you something. What?
As a general policy we would like to concentrate the hardware dependence
Return to: