All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Initialization of a nucleus pod
@ 2006-01-18 14:05 Germain Olivier
  2006-01-19 12:50 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Germain Olivier @ 2006-01-18 14:05 UTC (permalink / raw)
  To: xenomai

Hello

I am trying to understand how a pod is initialized.

I think it start with xncore_attach() from core.c, then with xnpod_init from
pod.c
But here (in xnpod_init) there is something not clear about the root thread
creation.

It use xnthread_init(&sched->rootcb, ...), but I don't see where
&sched->rootcb is initialized

Maybe I don't understand how it works, so the pod don't have his own code
to run, but this thread will be in fact replaced by the task to run.

I hope my question is clear enough

Thank

Germain


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] Initialization of a nucleus pod
  2006-01-18 14:05 [Xenomai-core] Initialization of a nucleus pod Germain Olivier
@ 2006-01-19 12:50 ` Gilles Chanteperdrix
  2006-01-19 15:07   ` Germain Olivier
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-19 12:50 UTC (permalink / raw)
  To: Germain Olivier; +Cc: xenomai

Germain Olivier wrote:
 > Hello
 > 
 > I am trying to understand how a pod is initialized.
 > 
 > I think it start with xncore_attach() from core.c, then with xnpod_init from
 > pod.c
 > But here (in xnpod_init) there is something not clear about the root thread
 > creation.
 > 
 > It use xnthread_init(&sched->rootcb, ...), but I don't see where
 > &sched->rootcb is initialized

xnthread_init does part of the initialization. The low level part of
rootcb (its xnarchtcb_t member) is initialized twice, first by the call
to xnarch_init_tcb in xnthread_init, and then overriden by
xnarch_init_root_tcb in xnpod_init.

For any other thread than root, the thread would be given a stack and
entry point by the call to xnarch_init_thread in xnpod_start_thread. But
the root thread is Xenomai idle task, a placeholder for whatever task
Linux is currenty running. At the time where xnpod_init is called, the
root thread is the current context, so already has a stack and is
already running.

-- 


					    Gilles Chanteperdrix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] Initialization of a nucleus pod
  2006-01-19 12:50 ` Gilles Chanteperdrix
@ 2006-01-19 15:07   ` Germain Olivier
  2006-01-29 23:00     ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Germain Olivier @ 2006-01-19 15:07 UTC (permalink / raw)
  To: xenomai

Thank you for your response

So rootcb isn't the "scheduler task".
I was thinking it was this task which was determining what thread to run,
depending of its parameters (priority, periodicity, scheduling mode).

I go back to the code to understand how it work ...

Germain

>
> xnthread_init does part of the initialization. The low level part of
> rootcb (its xnarchtcb_t member) is initialized twice, first by the call
> to xnarch_init_tcb in xnthread_init, and then overriden by
> xnarch_init_root_tcb in xnpod_init.
>
> For any other thread than root, the thread would be given a stack and
> entry point by the call to xnarch_init_thread in xnpod_start_thread. But
> the root thread is Xenomai idle task, a placeholder for whatever task
> Linux is currenty running. At the time where xnpod_init is called, the
> root thread is the current context, so already has a stack and is
> already running.
>
> --
>
>
> 					    Gilles Chanteperdrix.
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] Initialization of a nucleus pod
  2006-01-19 15:07   ` Germain Olivier
@ 2006-01-29 23:00     ` Philippe Gerum
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-01-29 23:00 UTC (permalink / raw)
  To: Germain Olivier; +Cc: xenomai

Germain Olivier wrote:
> Thank you for your response
> 
> So rootcb isn't the "scheduler task".
> I was thinking it was this task which was determining what thread to run,
> depending of its parameters (priority, periodicity, scheduling mode).
> 
> I go back to the code to understand how it work ...
>

Use the simulator to understand the dynamics of this code: it brings you 
single-stepping of the entire Xenomai core over GDB, at source code level.


> Germain
> 
> 
>>xnthread_init does part of the initialization. The low level part of
>>rootcb (its xnarchtcb_t member) is initialized twice, first by the call
>>to xnarch_init_tcb in xnthread_init, and then overriden by
>>xnarch_init_root_tcb in xnpod_init.
>>
>>For any other thread than root, the thread would be given a stack and
>>entry point by the call to xnarch_init_thread in xnpod_start_thread. But
>>the root thread is Xenomai idle task, a placeholder for whatever task
>>Linux is currenty running. At the time where xnpod_init is called, the
>>root thread is the current context, so already has a stack and is
>>already running.
>>
>>--
>>
>>
>>					    Gilles Chanteperdrix.
>>
> 
> 
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
> 


-- 

Philippe.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-29 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-18 14:05 [Xenomai-core] Initialization of a nucleus pod Germain Olivier
2006-01-19 12:50 ` Gilles Chanteperdrix
2006-01-19 15:07   ` Germain Olivier
2006-01-29 23:00     ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.