[okl4-developer] About Wombat a Portable User-Mode Linux for Embedded Systems

Carl van Schaik carl at ok-labs.com
Fri Jun 15 11:23:46 EST 2007


Jorge Torres wrote:
> Hi okl4.org <http://okl4.org>,
>
> On the:  Wombat a Portable User-Mode Linux for Embedded Systems, paper 
> by Ben Leslie, Carl van Schaik and Gernot Heiser
>
> I've found many answers to my questions, but, there is something I 
> can't clearly understand, it is on how is it that you make Wombat 
> threads to be scheduled by wombat scheduler, in this document it is 
> clear that  there is  timer_thread (code on the  interrupt_loop(void) 
> on  sys_iguana.c right?), which  on  timeout  signals a kernel  
> schedule().
This is done by designing the system such that one of the Linux threads 
is runnable at any one time - ie one of Linux kernel thread or one othe 
the User process threads. (The timer_thread is different - eg works like 
an ISR in Linux). Thus L4 does not need to schedule between different 
Linux threads.
>
> But what I can't understand is  after  linux schedule chooses  the  
> next task,  how  is it that  schedule tells L4 scheduler to 
> "switch_to"  the chosen task.
By having only one thread runnable, Linux can choose which thread it 
will run (using the Linux scheduler). The thread becomes runnable when 
Linux switches to the thread - ie replies to an IPC or makes the thread 
runnable and yields.
>
> Switch_to on process.c seems to do it independently from L4 scheduler. 
> or well, I cant understand what arch_switch does, or if I'm looking at 
> the wrong place.
This just switches Linux process contexts. ie changes the Linux kernel 
to a different stack. This is similar to user-mode threading. One single 
Linux kernel thread can run on behalf of any Linux process. (If you 
think about it, this is similar to what is really happening in native Linux)
>
> Does somebody know how is this done, and what does  arch_switch on ie. 
> linux/kernel/include/asm-l4/i386/arch.h do?
This just switches the Linux kenrel to a new stack. ie the stack in the 
user-processes thread_control_block.
>
> Thank you very much,
>
> Jorge
>   
regards,
Carl




More information about the Developer mailing list