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 via email to