All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ignacio García Pérez" <iggarpe@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] user mode vs. kernel module
Date: Fri, 10 Mar 2006 09:52:09 +0100	[thread overview]
Message-ID: <44113E39.1010902@domain.hid> (raw)

Hi,

So far I've had my application implemented entirely as a kernel module 
with some user mode helper programs. I've had in mind changing to user 
mode but never felt compelled enough.

Now, having a new requirement to implement, I think it's the moment to 
give it a try, and I'm porting it. I have a couple of questions:

1- How significative, in real world terms, is the overhead involved in 
operaing in user mode?. As far as I know all operations are executed via 
"pods" which involve one or more system calls and context switches. I'm 
using a Geode board right now but there are plans to move to a more 
low-end platform (486).

2- ioperm. This is a true headache. I've spent countless hours debugging 
this and banging my head agaist the wall. I'm not 100% sure of what's 
going on here, but it looks like the ioperm call must be issued from 
primary mode if you are doing the I/O from primary mode. Something like 
this would segfault:

ioperm(0x443, 0x01, 1);
rt_mutex_lock(...)
outb(0x01, 0x443)

While this works fine:

rt_mutex_lock(...)
ioperm(0x443, 0x01, 1);
outb(0x01, 0x443);

While leads me to think that the rt_mutex_lock puts the task in primary 
mode and then both ioperm and outb are executed in the same mode so 
everything works.

Is this right?. If so, I find this extremely inconvenient...

Nacho.






             reply	other threads:[~2006-03-10  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-10  8:52 Ignacio García Pérez [this message]
2006-03-12 11:18 ` [Xenomai-help] user mode vs. kernel module Philippe Gerum
2006-03-12 17:09   ` Philippe Gerum
2006-03-14  9:10   ` Ignacio García Pérez

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=44113E39.1010902@domain.hid \
    --to=iggarpe@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.