* [Xenomai-help] rtdm driver development
@ 2007-09-26 19:52 Bachman Kharazmi
2007-09-30 15:51 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Bachman Kharazmi @ 2007-09-26 19:52 UTC (permalink / raw)
To: Xenomai
Hi
I've implemented a ringbuffer which will buffer strings between a
pipe-read-task=>[buffer]=>rtdm-rtserial-writetask
The buffer has been implemented in userland and it works.
But in kernelspace (everything in a loaded in a kernel-module) things
doesn't work. It's the put(token) which doesn't work.
The function is put(char* c){ ... }
I've heard that there's an address difference. But how do I handle that?
http://www.xenomai.org/documentation/trunk/html/api/group__util.html#g9ce418051ccb7dd2366128efb8674262
is rtdm_strncpy_from_user() something I should use?
exactlly what is: rtdm_user_info_t * else than a pointer?
Where do I declare it? There's no clickable link in the api for that that type..
The description sais: "User information pointer as passed to the
invoked device operation handler"
...
/B
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] rtdm driver development
2007-09-26 19:52 [Xenomai-help] rtdm driver development Bachman Kharazmi
@ 2007-09-30 15:51 ` Jan Kiszka
2007-09-30 16:23 ` Bachman Kharazmi
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2007-09-30 15:51 UTC (permalink / raw)
To: Bachman Kharazmi; +Cc: Xenomai
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]
Bachman Kharazmi wrote:
> Hi
> I've implemented a ringbuffer which will buffer strings between a
> pipe-read-task=>[buffer]=>rtdm-rtserial-writetask
>
> The buffer has been implemented in userland and it works.
> But in kernelspace (everything in a loaded in a kernel-module) things
> doesn't work. It's the put(token) which doesn't work.
> The function is put(char* c){ ... }
>
> I've heard that there's an address difference. But how do I handle that?
>
> http://www.xenomai.org/documentation/trunk/html/api/group__util.html#g9ce418051ccb7dd2366128efb8674262
> is rtdm_strncpy_from_user() something I should use?
>
> exactlly what is: rtdm_user_info_t * else than a pointer?
> Where do I declare it? There's no clickable link in the api for that that type..
>
> The description sais: "User information pointer as passed to the
> invoked device operation handler"
> ...
Please have a look at xenomai/examples/rtdm/driver-api. Those tutorial
may give you some ideas. Feel free to suggest better descriptions of
that field above.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] rtdm driver development
2007-09-30 15:51 ` Jan Kiszka
@ 2007-09-30 16:23 ` Bachman Kharazmi
2007-09-30 18:11 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Bachman Kharazmi @ 2007-09-30 16:23 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Xenomai
I've _solved_ my problem since a few days.
My code is available here: http://bachman.tor.lindesign.se/mthesis/code/comm/
What it does is that it makes it possible to write to a rtp0 device
file which then handles the periodic push and write to a rtser0.
Questions which still remain.
-Are there any problems setting a high value for the pipe task?
#define TASK_STKSZ_PIPETASK 50000
I use it when creating the task:
rt_task_create(&task3,"kernel_task3",TASK_STKSZ_PIPETASK,TASK_PRIO_PIPETASK,TASK_MODE);
Is it the size of data that the pipe can handle before it gets filled?
-Can I write data to the pipe( /dev/rtp0 ) using the outputstream from
java without any delays? In the example testa.java I do that, but I'm
working on getting that working from a data-generating thread. so that
there will be a continues quick write to the device.
-When is a outputstream.flush() needed? Is that after every single
command or just once at the end when all write():s are done?
/Bachman
On 30/09/2007, Jan Kiszka <jan.kiszka@domain.hid> wrote:
> Bachman Kharazmi wrote:
> > Hi
> > I've implemented a ringbuffer which will buffer strings between a
> > pipe-read-task=>[buffer]=>rtdm-rtserial-writetask
> >
> > The buffer has been implemented in userland and it works.
> > But in kernelspace (everything in a loaded in a kernel-module) things
> > doesn't work. It's the put(token) which doesn't work.
> > The function is put(char* c){ ... }
> >
> > I've heard that there's an address difference. But how do I handle that?
> >
> > http://www.xenomai.org/documentation/trunk/html/api/group__util.html#g9ce418051ccb7dd2366128efb8674262
> > is rtdm_strncpy_from_user() something I should use?
> >
> > exactlly what is: rtdm_user_info_t * else than a pointer?
> > Where do I declare it? There's no clickable link in the api for that that type..
> >
> > The description sais: "User information pointer as passed to the
> > invoked device operation handler"
> > ...
>
> Please have a look at xenomai/examples/rtdm/driver-api. Those tutorial
> may give you some ideas. Feel free to suggest better descriptions of
> that field above.
>
> Jan
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] rtdm driver development
2007-09-30 16:23 ` Bachman Kharazmi
@ 2007-09-30 18:11 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2007-09-30 18:11 UTC (permalink / raw)
To: Bachman Kharazmi; +Cc: Xenomai
[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]
Bachman Kharazmi wrote:
> I've _solved_ my problem since a few days.
> My code is available here: http://bachman.tor.lindesign.se/mthesis/code/comm/
> What it does is that it makes it possible to write to a rtp0 device
> file which then handles the periodic push and write to a rtser0.
>
> Questions which still remain.
> -Are there any problems setting a high value for the pipe task?
> #define TASK_STKSZ_PIPETASK 50000
>
> I use it when creating the task:
> rt_task_create(&task3,"kernel_task3",TASK_STKSZ_PIPETASK,TASK_PRIO_PIPETASK,TASK_MODE);
> Is it the size of data that the pipe can handle before it gets filled?
The pipe buffer is configure through the pipe API, not via the task that
fills it. Above, you are setting the task stack size, that's something
different. Please read the fine API documentation.
>
> -Can I write data to the pipe( /dev/rtp0 ) using the outputstream from
> java without any delays? In the example testa.java I do that, but I'm
> working on getting that working from a data-generating thread. so that
> there will be a continues quick write to the device.
>
> -When is a outputstream.flush() needed? Is that after every single
> command or just once at the end when all write():s are done?
I least I can't help you with Java-internal questions. How Java uses
that devices is not in the hands of Xenomai.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-30 18:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26 19:52 [Xenomai-help] rtdm driver development Bachman Kharazmi
2007-09-30 15:51 ` Jan Kiszka
2007-09-30 16:23 ` Bachman Kharazmi
2007-09-30 18:11 ` Jan Kiszka
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.