AW: AW: Interrupt handling

"Christian, Martin, OPEE45" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Thanks Espen for the clarification of the interrupt processing! Finally
my handmade user mode echo server works. :-)

The problem I've been tracking for hours was this:
-> At the end of root tasks main I made it do some bogus calculation
forever: while ( true ) i = (i + 1) % 33331; (i is volatile, of course)

-> Even that I've started the echo server thread, it got never
scheduled. I guess a new thread has a lower priority than the root
thread by default, even if both are in the same address space. This is
why the interrupt got ACK and MASK, but never processed.

-> In the beginning I tried to send the root task sleeping forever:
   L4_Sleep( L4_Never );
   But if the echo_server is waiting for an interrupt IPC the kernel
sends a lot of "No runnable threads" (or something similar) messages,
which are annoying.

-> I solved the problem by creating a second thread, which does the
bogus calculation and sending the root task to sleep forever.

The wrong threadid would have been the next problem to encounter, but
fortunately I got the hint before. :-)

However, I found some strange behaviour of the kernel during my
debugging. In the beginning, I moved the interrupt registration into the
echo_server thread, so it would have been executed in the beginning. But
as explained, the thread got never scheduled. That is, the interrupt was
never registered. If I triggered an interrupt, I got the following
message:
<console>
Disable MPSC_INT_RCC
ACK MPSC_INT_RCC
Assertion irq_tcb->get_state().is_halted() failed in file
/cygdrive/c/Martin/pro
jects/L4-Pistachio/kernel/src/api/v4/interrupt.cc, line 169
(fn=c0025d40)
>> KD# assert
IP: 0xc002ddec, MSR: 0x00023032, user IP: 0x00300410, user MSR:
0x0000d032
</console>

That shouldn't happen, I assume. Is it expected, that all interrupts are
masked unless they are registered? Because on registering for an
interrupt, a call to intctrl_t:mask() is done from somewhere inside the
kernel.

Best,

Martin.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.