Peter Nguyen petern at
Sun Apr 22 15:18:19 CEST 2007


I'm currently messing around with L4 at the moment.  More specifically, i'm
providing some facilities for profiling in L4 via sampling.  Right now, i'm
trying to implement an exception handler for the Performance Measurement
Counters on the PowerPC architecture.  In providing calls to these
facilities via the pingpong root-task, i seem to run into problems with
input.  Essentially, while the root-task is waiting for user input, it seems
as if the exception is not kicking in until i enter a character.  The
exception that should be handled is a performance monitor exception (where
one of the counters overflow).  Basically, the overflow takes place such
that a significant amount of instructions have been executed when
theoretically it should be signalled earlier.  

In accepting input, the root-task (which i didn't write myself) uses getc()
to obtain such input.  My question is basically whether getc() blocks
everything and sits there until a character is received?  I suspect that
this is most certainly the case.  If so, does anyone know whether there are
other facilities available for provide an alternative means for providing
input in an application.  The reason why i am asking about whether getc() is
a factor or not is that in providing an infinite loop, the
exception/interrupt kicks in at the right time ie. when the counter
overflows, the resulting counter value is slightly above the overflow value
eg. the counter overflows when the contents of the register is 0x80000000. 
When the exception kicks in, the "final" value is 0x80000012 as opposed to a
random value in the case with a root-task that requests input.

Any help would be greatly appreciated.

Peter N
View this message in context:
Sent from the L4 mailing list archive at

More information about the l4-hackers mailing list