Subject: Re: Kernel threads
To: Bill Studenmund <wrstuden@zembu.com>
From: Bharani Chadalavada <bharani.chadalavada@nexsi.com>
List: tech-kern
Date: 02/05/2001 10:12:07
Bill Studenmund wrote:

> On Sat, 3 Feb 2001, Bharani Chadalavada wrote:
>
> > OK. I started playing with this and I wrote a small kernel thread which is
> > awakened periodically by the interrupt service routine. Basically I have something
> > like this.
> >
> > device_monitor()
> > {
> >     while(1)
> >     {
> >         tsleep(&do_monitor, PWCHAN, "bharani", 0); /* PWCHAN = 12 */
> >         Do_read_device_registers();
> >     }
> > }
> >
> > and I have my interrupt service routine coded like this :
> >
> > service_interr()
> > {
> >     ...
> >     ...
> >     wakeup(&do_monitor);
> > }
> >
> > (I am running NetBSD on our hardware simulator and I put break points on the
> > kernel thread routine)
> >
> >
> > I can see the thread being created (when I do ps, I see "bharani"). But it does
> > not seem to be getting scheduled at all. Obviously I am missing something. I think
> > I am giving it a wrong priority or something. Could you please figure out what I
> > am doing wrong??
>
> Does anything ever wake it up once?

Nope. It gets executed, once when the thread is created and goes to sleep as expected.
But later, it does not get awakened at all. And my interrupt service routine is
executing for sure.
Do you see anything wrong, with the above psedo-code?

Thanks,
Bharani.


>
>
> Take care,
>
> Bill