Hi,<br><br>About the previuos e-mail, I think this last is not necessary:<br>*Comment line on linux/kernel-../arch/l4/Makefile the one that says: include $(KBUILD_SRC)/$(ARCH_DIR)/sys-$(SYSTEM)/Makefile<br>cp linux/kernel-../l4linux_config_&lt;arch&gt; linux/kernel/.config<br>
make menuconfig<br>*Uncomment commented line&nbsp; of linux/kernel/arch/l4/Makefile<br>rm linux/kernel/.config*<br><br>All the best,<br><br>Jorge<br><br><div class="gmail_quote">On Tue, Apr 8, 2008 at 8:40 PM, Jorge Torres &lt;<a href="mailto:jorge.torres.maldonado@gmail.com">jorge.torres.maldonado@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I dont know what would be the best way for doing this, I&#39;ve also done this as follows:<br>
<br>*Adding driver at:<br>linux/kernel-2.6.11-v2/arch/l4/drivers/hello.c<br><br>*at linux/kernel-2.6.11-v2/arch/l4/drivers/Makefile:<br>
<br>obj-$(CONFIG_HELLO) += hello.o<br><br>*at linux/kernel-2.6.11-v2/arch/l4/Kconfig:<br><br>menu &quot;HELLO&quot;<br><br>config HELLO<br>&nbsp;&nbsp;&nbsp; bool &quot;add hello&quot;<br>&nbsp;&nbsp;&nbsp; default y<br>endmenu<br><br><br><br>Hope it helps,<br>
<br>Cheers,<br><font color="#888888"><br>Jorge</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Mon, Mar 31, 2008 at 12:31 PM, Remy Gottschalk &lt;<a href="mailto:rgottschalk@linagora.com" target="_blank">rgottschalk@linagora.com</a>&gt; wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi again<br>
<br>
This howto directly follows the previous one (HelloWorld Iguana server<br>
HowTo) and explain how interacting with the helloworld server from wombat.<br>
The next will probably deal with more elaborate communication and shared<br>
memory.<br>
<br>
<br>
----------------------------<br>
Using the server from Wombat<br>
----------------------------<br>
<br>
Now we have a functional hello server we will use it from the<br>
para-virtualized Linux. We will do so using a new entry in /proc.<br>
<br>
&nbsp;1 Library<br>
&nbsp;---------<br>
<br>
The first thing to do is to link the kernel to our client library<br>
libhello.a. To achieve this we simply add a -lhello flag to the kernel<br>
Makefile.<br>
<br>
$ cat linux/kernel-2.6.11-v2/arch/l4/Makefile<br>
[...]<br>
libs-y += &nbsp;-lvtimer -lvserial -ll4e -lll -liguana -ll4 -lgcc -lmutex<br>
-lcircular_buffer -lnaming -lhello<br>
[...]<br>
<br>
&nbsp;2 A new module<br>
&nbsp;--------------<br>
<br>
We will now create a new kernel module to allow use interacting with the<br>
server using a /proc entry.<br>
We will work directly in a hello folder in the kernel root in order to<br>
make things fast and easy.<br>
<br>
$ mkdir linux/kernel-2.6.11-v2/hello<br>
$ touch linux/kernel-2.6.11-v2/hello/Makefile<br>
$ touch linux/kernel-2.6.11-v2/hello/my_l4_hello.c<br>
$ ls &nbsp;linux/kernel-2.6.11-v2/hello<br>
Makefile &nbsp;my_l4_hello.c<br>
<br>
We need to modify the global Makefile :<br>
$ cat linux/kernel-2.6.11-v2/Makefile<br>
[...]<br>
core-y &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= usr/ hello/<br>
[...]<br>
and create a new one for our source file.<br>
$ cat linux/kernel-2.6.11-v2/hello/Makefile<br>
obj-y += my_l4_hello.o<br>
<br>
Now here is the code for our module :<br>
<br>
$ cat linux/kernel-2.6.11-v2/hello/my_l4_hello.c<br>
#include &lt;linux/module.h&gt;<br>
#include &lt;linux/kernel.h&gt;<br>
#include &lt;linux/proc_fs.h&gt;<br>
#include &lt;linux/string.h&gt;<br>
#include &lt;linux/vmalloc.h&gt;<br>
#include &lt;asm/uaccess.h&gt;<br>
<br>
#include &lt;hello/hello.h&gt;<br>
<br>
/* Defines the license for this LKM */<br>
MODULE_LICENSE(&quot;GPL&quot;);<br>
MODULE_DESCRIPTION(&quot;L4 Hello Wrapper&quot;);<br>
<br>
static struct proc_dir_entry *proc_entry;<br>
<br>
int hello_read( char *page, char **start, off_t off,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int count, int *eof, void *data )<br>
{<br>
 &nbsp;say_hello();<br>
 &nbsp;return 0;<br>
}<br>
<br>
int my_module_init( void )<br>
{<br>
 &nbsp;int ret = 0;<br>
<br>
 &nbsp;proc_entry = create_proc_entry( &quot;hello&quot;, 0644, NULL );<br>
 &nbsp;if (proc_entry == NULL)<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp;ret = -ENOMEM;<br>
 &nbsp; &nbsp; &nbsp;printk(KERN_INFO &quot;fortune: Couldn&#39;t create proc entry\n&quot;);<br>
 &nbsp; &nbsp;}<br>
 &nbsp;else<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp;proc_entry-&gt;read_proc = hello_read;<br>
 &nbsp; &nbsp; &nbsp;proc_entry-&gt;write_proc = hello_write;<br>
 &nbsp; &nbsp; &nbsp;proc_entry-&gt;owner = THIS_MODULE;<br>
 &nbsp; &nbsp; &nbsp;printk(KERN_INFO &quot;&lt;===== Hello Module Started =====&gt;\n&quot;);<br>
 &nbsp; &nbsp;}<br>
 &nbsp;hello_init();<br>
 &nbsp;return ret;<br>
}<br>
<br>
void my_module_cleanup( void )<br>
{<br>
 &nbsp;remove_proc_entry(&quot;hello&quot;, &amp;proc_root);<br>
 &nbsp;printk(KERN_INFO &quot;&lt;===== Hello Module Unloaded =====&gt;\n&quot;);<br>
 &nbsp;return;<br>
}<br>
<br>
module_init( my_module_init );<br>
module_exit( my_module_cleanup );<br>
<br>
This module creates a new entry in /proc (/proc/hello) and calls say_hello<br>
on each reading access.<br>
<br>
We can see that using our server is pretty simple, three line are<br>
concerned :<br>
#include &lt;hello/hello.h&gt;<br>
To include user library headers<br>
hello_init();<br>
In order to initiate the communication.<br>
say_hello();<br>
To interact with our server.<br>
<br>
&nbsp;3 Final test<br>
&nbsp;------------<br>
<br>
We compile and test :<br>
<br>
$ ./tools/build.py machine=ia32_pc99 project=iguana wombat=True<br>
toolprefix=i686-unknown-linux-gnu- simulate<br>
[...]<br>
&lt;===== Hello Module Started =====&gt;<br>
[...]<br>
&lt;===== Hello Server Started =====&gt;<br>
[...]<br>
Please press Enter to activate this console.<br>
<br>
BusyBox v1.00 (2008.03.28-14:47+0000) Built-in shell (ash)<br>
Enter &#39;help&#39; for a list of built-in commands.<br>
<br>
/ # &nbsp;cat /proc/hello<br>
I say hello<br>
/ #<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Remy Gottschalk - <a href="mailto:rgottschalk@linagora.com" target="_blank">rgottschalk@linagora.com</a><br>
Ingénieur informatique embarquée<br>
Groupe LINAGORA - <a href="http://www.linagora.com" target="_blank">http://www.linagora.com</a><br>
Tél.: +33(0)1 58 18 68 28 - Fax : +33(0)1 58 18 68 29<br>
<br>
<br>
<br>
_______________________________________________<br>
Developer mailing list<br>
<a href="mailto:Developer@okl4.org" target="_blank">Developer@okl4.org</a><br>
<a href="https://lists.okl4.org/mailman/listinfo/developer" target="_blank">https://lists.okl4.org/mailman/listinfo/developer</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>