rtnet code in rtai_24.1.12 (from denx)

Paolo Mantegazza mantegazza at aero.polimi.it
Tue Oct 26 11:00:23 CEST 2004


deepa.vijayaraghavan at mbtech-group.com wrote:
> 
> 
> 
> Hello Paolo,
>    Thanks a lot for your reply. LXRT is not supported for power PCs, and I
> use an IBM 440 GP power PC based board.
> I just need a socket interface to send out data to the outside network, in
> my RT task of lesser priority. The higher priority task does some kind of
> data acquisition. I do not really need the features of RTNET, as my
> realtime requirements are not very stringent in terms of data
> routing(sending it out to the outside world, I mean).
>    The call to set_fs(KERNEL_DS) is the one that fails, when called from
> the RT task. I do not understand why. Do you have any example code, that
> uses the netrpc.h(that you'd sent) to make socket calls from RT tasks?
> 

I told you already" you cannot do that from and RTAI proper tasks. You 
have just to use a standard Linux kernel thread and call the socket 
functions I passed you from there. No problem in sharing data in kernel 
space with any real time activity. If you need some synchronisation then 
you can use RTAI srqs, e.g. your kthread sleeps (down) on a kernel 
semaphore and when data are available a request is pended 
(rt_pend_linus_srq) and the srq handler signals (up) the kernel threads.
Furthermode you could use hard disabling/enabling of interrupts in both 
for short atomic guarranty. Another approach is the use/adapt the 
support provided in rtai_scb.h for nolocks circular buffers. I'll stop 
here as I think i gave you many choices already, more will likely be 
confusing.

Can you sketch more precisely what you want to do? Just a sketch please!

Paolo.





More information about the Rtai mailing list