[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Marc LE DOUARAIN" <mledouarain@garbarini.com>] (fwd)



>From owner-rtl Wed Jun 13 05:27:59 2001
Received: from fayat-genest.fr (mailhost.fayat-genest.fr [213.56.199.1])
	by hq.fsmlabs.com (8.11.2/8.11.2) with SMTP id f5DBRub08014
	for <rtl@fsmlabs.com>; Wed, 13 Jun 2001 05:27:56 -0600
Received: from GROUPE#032#FAYAT-GENEST#032#SEC-Message_Server by fayat-genest.fr
	with Novell_GroupWise; Wed, 13 Jun 2001 13:21:31 +0200
Message-Id: <sb2768db.081@fayat-genest.fr>
X-Mailer: Novell GroupWise 5.5.2
Date: Wed, 13 Jun 2001 13:41:30 +0200
From: "Marc LE DOUARAIN" <mledouarain@garbarini.com>
To: <rtl@fsmlabs.com>
Subject: =?ISO-8859-1?Q?Re:=20R=E9p.=20:=20[rtl]=20memory=20in=20rtlinux?=
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by hq.fsmlabs.com id f5DBRxb08015

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 */


>>> domingue@lasmea.univ-bpclermont.fr 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 !
> 
> >>> domingue@lasmea.univ-bpclermont.fr 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 owner-rtl@fsmlabs.com -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org 
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/ 
> 
> ----- End of forwarded message from owner-rtl@fsmlabs.com -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org 
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/ 

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

----- End of forwarded message from owner-rtl@fsmlabs.com -----