From: Philippe Gerum <rpm@xenomai.org>
To: Renner Johannes <rennj1@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Writing from user space direct to IO Ports without mode switches
Date: Wed, 18 Jul 2007 10:22:56 +0200 [thread overview]
Message-ID: <1184746976.6562.62.camel@domain.hid> (raw)
In-Reply-To: <760425846A1BC44B8BD24361EF2E3451A69749@domain.hid>
On Wed, 2007-07-18 at 00:23 +0200, Renner Johannes wrote:
> Hello everyone,
>
> The outb functions to control parallel ports in my user mode RT task
> causing inacceptable jitter and make the task unstable(-110) at
> higher(10khz) output frequencies. I believe this is due to mode
> switches form Primary to the Secondary mode.
You can check this by dumping /proc/xenomai/stat periodically when your
task runs. If the "MSW" value increases regularly, then there are indeed
unwanted mode switches.
If so, this looks like an issue with reinstating the iobitmap for the
incoming RT thread; seems strange since we fixed it a while ago, but we
may be impacted by vanilla kernel changes here, so checking this again
is needed. Please send a simple code exhibiting the problem; we need to
know how you get the IOPL, and if you can reproduce it with a simple
periodic thread. Kernel version, Xenomai version and kernel config used
would help too.
> I tried to access the ports via /dev/mem and mmap() (method from
> xenomai/examples/common/hw_direct_io.c) but thus mapping is
> successful, writing -whatever- to the mapped pointer does not set any
> IO's on my x86.
You can't r/w ioports using mmapped memory on x86; those are in a memory
space following a different access logic than plain MMIO. The example
you referred to was written for ppc, and uses an MMIO space.
> I have read that some Xenomai RT testing with the Parallel port at
> frequencies above 200khz showed excellent results. Which functions are
> used for such precise timings and are they only available in kernel
> space?
native skin: rt_timer_tsc(), posix skin: clock_gettime().
Both are usable in kernel and user-space contexts. To have direct access
to the x86 TSC from user-space, you need to make sure your kernel is
compiled for a CPU type providing TSC support (i.e. anything beyond 486
would do). User-space should be built with the --enable-x86-tsc option
too, but this is the default setting if you don't pass any opposite
option to the "configure" script.
> Thanks in advance
>
> Johannes
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
next prev parent reply other threads:[~2007-07-18 8:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 22:23 [Xenomai-help] Writing from user space direct to IO Ports without mode switches Renner Johannes
2007-07-18 6:47 ` Gilles Chanteperdrix
2007-07-18 10:19 ` [Xenomai-help] Writing from user space direct to IO Ports withoutmode switches Renner Johannes
2007-07-18 8:22 ` Philippe Gerum [this message]
2007-07-18 10:12 ` [Xenomai-help] Writing from user space direct to IO Ports without mode switches Renner Johannes
2007-07-18 10:47 ` Philippe Gerum
2007-07-19 21:10 ` Vincent Levesque
2007-07-20 7:47 ` Jan Kiszka
2007-07-20 19:28 ` Vincent Levesque
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=1184746976.6562.62.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=rennj1@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.