You haven't to use FIFO to pass address if you use mbuff to share memory...

A little example :


You can create a structure like this to share it later from the 2 sides (RT and Linux) 
:
struct StructDataShared
{
   char PictureData[xxxx];
   int FlagNewPicture;
}


- In Linux process, you have :
-----------------------------------------------
volatile StructDataShared * PtrDataShared;
At the start:
        PtrDataShared = (StructDataShared *) mbuff_alloc("example",yyyy);

At the end :
        mbuff_free("example",(void *)StructDataShared);
For use, fill the PictureData, then when done :
PtrDataShared->FlagNewPicture = 1;   /* to tell RT side, there is a new picture 
available */


- In RT, you have :
------------------------------
volatile StructDataShared * PtrDataShared;
In init_module()
        PtrDataShared = mbuff_alloc("example",yyyy);
In cleanup_module()
        mbuff_free("example",PtrDataShared);
Then you look the flag PtrDataShared->FlagNewPicture to see if there is a new picture 
available, when read
PtrDataShared->FlagNewPicture = 0;   /* To indicate RT process 've read the new 
picture */


>>> [EMAIL PROTECTED] 12/06/01 15h33 >>>
Now , how i understand, the things will be like following. 
-First i push my image in linux space, locating it in shared memory by
mbuff.
-After, i pass with a FIFO the adress of the image in memory to the
rttask. Please tell me if it's the good way.
-Now, the rttask can work. In fact there is a doubt that i have here.
The rttask will be in memory waiting for the data in the FIFO. When it
recives this data, it will be start to work. How i have to do to work 
by this way. 
I am not clear in this way. One example easy that i want to do is for
example to acces from the rttask to the image and pass it to negative,
and after the linux task could access to it. The image will be
actualized often, because is video acquisition. If someone knows any
similar application or the way i can make , i will be agreed.



Marc LE DOUARAIN escribio:
> 
> To share data between RTTask and ClassicTask the easiest is using MBUFF.
> It's already given whith RTLinux3 (in drivers/) and it's really easy to use. Look at 
>examples !
> 
> >>> [EMAIL PROTECTED] 11/06/01 15h41 >>>
> I have an image in a buffer in a linux program. I would like to access
> it with a rtlinux program for treating it. How i could make it?
> How the rttask could access to the sam e buffer as the linux
> task?(passing only the adress number with a fifo or something like this)
> or maybe it's necessary to push it in a array?
> Please answer if somebody knows.
> Thank you..
> 
> ----- End of forwarded message from [EMAIL PROTECTED] -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] 
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/ 
> 
> ----- End of forwarded message from [EMAIL PROTECTED] -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] 
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/ 

----- End of forwarded message from [EMAIL PROTECTED] -----
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] 
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/ 

----- End of forwarded message from [EMAIL PROTECTED] -----
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to