9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9fans@9fans.net
Subject: Re: [9fans] prototyping device drivers in user space
Date: Thu,  6 Mar 2014 23:38:26 +0100	[thread overview]
Message-ID: <bd4966f9da6ee6050bbec9a6df9199f0@felloff.net> (raw)
In-Reply-To: <fe03d2be52d470f7b07532a923ea4d74@quintile.net>

this depends on the device you'r interfacing with.
plan9 already does exactly this with aux/vga on the pc for
example.

you cant receive or disable interrupts in userspace,
or do dma (you have to physical address mapping, well
you could have fixed segments for that as well and some
way for the kernel to tell you the physical address but
dude...).

the kernel has the great advantage that it can guard
and serialize/multiplex access to a device in a sane way.

and you can idealize the hardware in the kernel so that
accessing a device remotely over exportfs will be
efficient and machine idependent.

you can't do this when you just expose device registers.

the amount of fs code for kernel and lib9p is arround the same.
and writing kernel driver seems to be the better approach
in the long run. but for experiments, some backdoor driver
that lets you access registers directly might be fine as well.

really depends...

--
cinap



      reply	other threads:[~2014-03-06 22:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 22:16 Steve Simon
2014-03-06 22:38 ` cinap_lenrek [this message]

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=bd4966f9da6ee6050bbec9a6df9199f0@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).