9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] prototyping device drivers in user space
@ 2014-03-06 22:16 Steve Simon
  2014-03-06 22:38 ` cinap_lenrek
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Simon @ 2014-03-06 22:16 UTC (permalink / raw)
  To: 9fans

I was thinking of prototyping a Raspberry pi device driver
in user space.

As I boot it as a terminal I am hostowner so I should have access to
/dev/mem, alternatively I could write a little toy device driver to
create a named segement that I could segattach() to - this has the
advantage that the code I write will be more directly transferable
to a real kernel driver.

anyone tried this? is it just silly, the kernel boot time being
so low that its not worth it?

what do you think?

-Steve



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] prototyping device drivers in user space
  2014-03-06 22:16 [9fans] prototyping device drivers in user space Steve Simon
@ 2014-03-06 22:38 ` cinap_lenrek
  0 siblings, 0 replies; 2+ messages in thread
From: cinap_lenrek @ 2014-03-06 22:38 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-06 22:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 22:16 [9fans] prototyping device drivers in user space Steve Simon
2014-03-06 22:38 ` cinap_lenrek

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).