From: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
To: Jan Kiszka <kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] RTDM mmap alternative
Date: Tue, 07 Feb 2006 23:15:24 -0300 [thread overview]
Message-ID: <43E9543C.8040906@domain.hid> (raw)
In-Reply-To: <43E8FD05.5060600@domain.hid>
Jan Kiszka escreveu:
> Rodrigo Rosenfeld Rosas wrote:
>
>> Hi Jan, thank you for your precious code! :)
>>
>> But, while it is executed in Linux context, ie, in a non-rt context, I could
>> register a normal Linux file descriptor and call mmap on it. Or I could mmap
>>
>
> You still need the back-end, i.e. some Linux device being registered and
> catch your mmap call. That's how /dev/rtheap e.g. works.
>
I know. I would register as something like "/dev/rtvideo".
>> the device /dev/mem for mapping the memory region I would need. I can obtain
>> the absolute address from a RTDM ioctl call.
>>
> /dev/mem is all or nothing: once you allow access, you cannot control
> which memory region gets mapped. Closing this loop in kernel space
> produces safer code with the option to get it even secure one day
> (current Xenomai APIs do not address the latter aspect yet).
>
I know it is better but it will require extra effort from my part and
will be only temporary...
>> Anyway, I'll be missing the V4L2 compatibility but that is not a great issue.
>>
> You mean some kind of rt_dev_mmap(..., rt-fildes, ...) (or wrapped mmap
> in the posix skin)?
Yes, I would like to use rt_dev_mmap... But I would be fine if I just
could do it anyway in RT-context...
> We could define a standard RTDM-IOCTL and write the
> user-space lib functions so that interested drivers can receive such
> requests in a canonical way.
I really don't need the user-space lib functions and don't think others
will need it too... I would be just fine with a RTDM-IOCTL if it was in
RT-context...
> The implementation in the driver would
> still be different to Linux (just rtdm_mmap_to_user, no page-on-demand
> e.g.).
>
It will be different anyway as I'll be using rt_dev_open etc, but it
will be analogue to the ones used by V4L2. And I think very few people
would need the page-on-demand feature...
>> But since I only need to call this on initialization, I don't need to be in
>> RT-context in my specific application. But since I'm also developing a
>> robotic programming framework it would be nice to have this mmap capability
>> in real-time context.
>>
> Dynamic mmap'ping in RT is contradictory: Touching your current process'
> mm creates dependencies on a lot of kernel code paths that can modify it
> as well - if such modifications can be made deterministic at all in
> Linux.
Unfortunately my knowledge of how linux deals with vma is very
limited... Actually, my knowledge of how memory access is made by the
processor is very limited too. I know that there are protected memory
and virtual memory but I'm not confortable with how it is achieved nor
by the processor nor by Linux. If it is too difficult to make it
deterministic, so I won't expect mmap to be made RT soon... Fortunately
I don't really need it for now.
> But I guess you don't means this.
Actually I did. But, as I said, I don't really need it. It would just be
nice to provide this option in my framework...
> Even V4L2 mmap's only during
> init and not during the critical capturing process - it's far to slow.
>
I was not thinking in doing the mmap during the critical capturing
process, but maybe during a reconfiguration of the system by some reason...
> You know that, due to Xenomai's automatic mode switching, you would be
> free to call such rt_dev_mmap even from RT tasks? It would just switch
> you temporarily over.
>
Yes, but I couldn't use it in hard real-time tasks... It is dangerous to
switch to secondary mode by a task of high priority... As I've said, I
don't know, from the moment, some real case where it would be necessary
to do so, but since I'm developing a framework, it would be nice to
provide this option...
Thank you for your concerns,
Best wishes,
Rodrigo.
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html
next prev parent reply other threads:[~2006-02-08 2:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-03 19:27 [Xenomai-help] RTDM mmap alternative Rodrigo Rosenfeld Rosas
2006-02-04 9:07 ` Jan Kiszka
2006-02-04 12:44 ` Rodrigo Rosenfeld Rosas
2006-02-04 12:41 ` Jan Kiszka
2006-02-04 14:19 ` Rodrigo Rosenfeld Rosas
2006-02-06 21:00 ` Rodrigo Rosenfeld Rosas
2006-02-07 17:38 ` Jan Kiszka
2006-02-07 19:22 ` Rodrigo Rosenfeld Rosas
2006-02-07 20:03 ` Jan Kiszka
2006-02-08 2:15 ` Rodrigo Rosenfeld Rosas [this message]
2006-02-08 12:43 ` Rodrigo Rosenfeld Rosas
2006-02-08 13:14 ` Jan Kiszka
2006-02-08 18:03 ` Rodrigo Rosenfeld Rosas
2006-02-08 18:26 ` Jan Kiszka
2006-02-08 19:35 ` Rodrigo Rosenfeld Rosas
2006-02-08 19:07 ` Rodrigo Rosenfeld Rosas
2006-02-08 21:28 ` Rodrigo Rosenfeld Rosas
2006-02-09 8:53 ` Jan Kiszka
2006-02-09 16:04 ` Rodrigo Rosenfeld Rosas
2006-02-09 16:53 ` Jan Kiszka
2006-02-09 17:58 ` Rodrigo Rosenfeld Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E9543C.8040906@domain.hid \
--to=lbocseg@domain.hid \
--cc=kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.