PS: Version that I am using now

xenomai-3-655dda153fbaba31246963f3011fff194fbecaa8.tar.bz2
<http://git.xenomai.org/xenomai-3.git/snapshot/xenomai-3-655dda153fbaba31246963f3011fff194fbecaa8.tar.bz2>

PS: Version that compiled ok:

xenomai-3-9b8fa963ae6c4751602c00f6be81861b620822af.tar.bz2
<http://git.xenomai.org/xenomai-3.git/snapshot/xenomai-3-9b8fa963ae6c4751602c00f6be81861b620822af.tar.bz2>


On 23 March 2015 at 10:59, Helder Daniel <[email protected]> wrote:

> Ok,
>
> but now I am compiling a module to write for an I/O port (code below)
> With the previous version of next branch I can compile it without any
> error, insert it check that it is working fine by reading te I/O port from
> an user space app, but with this new version, when compiling the module, I
> get:
>
>  CC [M]  /mnt/hgfs/apps-3.x/10-portAccessSyncKernel/writeportK.o
> In file included from include/xenomai/rtdm/driver.h:43:0,
>                  from
> /mnt/hgfs/apps-3.x/10-portAccessSyncKernel/writeportK.c:8:
> include/xenomai/cobalt/kernel/init.h:24:33: fatal error:
> cobalt/uapi/corectl.h: No such file or directory
>  #include <cobalt/uapi/corectl.h>
>                                  ^
> compilation terminated.
>
> The makefile is just:
>
> obj-m += writeportK.o
>
> $(eval EXTRA_CFLAGS := $(shell xeno-config --kcflags))
>
> all:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
>
> And the code of the module:
>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <rtdm/driver.h>   //defines: rtdm_task_t, rtdm_sem_t, ... (also
> includes rtdm.h)
>
> #define TASK_PRIO  20 //99 is Highest RT priority, 0 is Lowest
>
> #define us 1000 //1000 ns = 1 us (micro sec)
> #define ms 1000000ll //1000000 ns = 1 ms
> #define TASK_PERIOD 500*ms //0.5 secs period
>
> #define COUNT 0x80
> #define DATA  0x81
>
> rtdm_task_t td_pw;  //RTDM task descriptor
> rtdm_sem_t  semA;   //RTDM semaphore descriptor
>
> void writeport (void *arg) {
> static unsigned char count=0;
> int err;
>
> for (;;) {
> err = rtdm_task_wait_period(); //deschedule until next period
> if (err<0) {
> rtdm_printk("writeportK: rtdm_task_wait_period, error %d\n", err);
> break; //avoid kernel corruption when removing module
> //trying to execute code of killed thread
> }
> outb (count, COUNT); //outb takes aprox. 1 Micro sec.
> outb (count%4, DATA); //outb takes aprox. 1 Micro sec.
> rtdm_printk("writeportK: count = %d\n", count); //check with dmesg
> if (++count == 100) count=0;
> }
> }
>
>
> int init_module(void) {
> int err;
>
> err = rtdm_task_init (&td_pw, "writeportK", writeport, NULL, TASK_PRIO,
> TASK_PERIOD);
> if (err < 0) rtdm_printk("writeportK: rtdm_task_init, error %d\n", err);
> else {
> err = rtdm_task_set_period(&td_pw, TASK_PERIOD); //set period
> if (err < 0) rtdm_printk("writeportK: rtdm_task_set_period %d\n", err);
> else rtdm_printk("writeportK successfully loaded\n");
> }
> return err;
> }
>
> void cleanup_module(void) {
> rtdm_task_destroy(&td_pw);
> rtdm_printk("writeportK unloaded\n");
> }
>
> MODULE_LICENSE("GPL");  //To have access to Xenomai symbols
>
>
>
>
>
>
> On 19 March 2015 at 18:29, Philippe Gerum <[email protected]> wrote:
>
>> On 03/19/2015 06:23 PM, Philippe Gerum wrote:
>> > On 03/17/2015 06:19 PM, Helder Daniel wrote:
>> >> ok
>> >>
>> >> On 17 March 2015 at 17:10, Philippe Gerum <[email protected]
>> >> <mailto:[email protected]>> wrote:
>> >>
>> >>     On 03/17/2015 06:06 PM, Helder Daniel wrote:
>> >>     > I am sorry I just found now.
>> >>     > It still happens with Mercury (with the configuration described
>> in the
>> >>     > previous email)
>> >>     >
>> >>     > When I compiled another app and try to run it I got the same
>> error:
>> >>     >
>> >>     > root@debian:~/09-portAccessSyncTwoAppsC++# ./writeport
>> >>     > sysregd:
>> create_directory_recursive("/var/run/xenomai/anon/system"):
>> >>     > Transport endpoint is not connected
>> >>     > sysregd:
>> create_directory_recursive("/var/run/xenomai/anon/system"):
>> >>     > Transport endpoint is not connected
>> >>     > sysregd:
>> create_directory_recursive("/var/run/xenomai/anon/system"):
>> >>     > Transport endpoint is not connected
>> >>     >    3"012.188| WARNING: [main] cannot connect to registry daemon
>> >>     >    3"012.188| BUG: [main] initialization failed, EAGAIN
>> >>
>> >>     Ok. This one is different from the ENOMEM issue, which is
>> >>     Cobalt-specific. The problem with mounting the anon/system root is
>> a
>> >>     FUSE issue, which still needs a work around it seems.
>> >>
>> >
>> > The ENOMEM issue is now fixed in -next. I'll tackle the C++ parsing
>> > problem with libtrank next.
>> >
>>
>> This commit in -next fixes the link stage for the readport/writeport test.
>>
>>
>> http://git.xenomai.org/xenomai-3.git/commit/?h=next&id=f537649c1b69a4f7b6d8f22ef344faf3414fe079
>>
>> --
>> Philippe.
>>
>
>
>
> --
> Helder Daniel
> UALG - FCT
> DEEI
>
> http://w3.ualg.pt/~hdaniel
>



-- 
Helder Daniel
UALG - FCT
DEEI

http://w3.ualg.pt/~hdaniel
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to