kernel driver vs userspace program

Simon turner25 at gmail.com
Tue Feb 12 11:38:40 EST 2013


Thanks for the reply!

I have to say because I'm so much interested in doing some kernel
programming, that I didn't pay too much attention to your suggestions,
although I did find them very good.

[...good information stripped...]
> versus kernel is the proper fit for your application.  But in general,
> you want to try to keep it in userspace (where things are more protected
> in case of a stray pointer, etc) if at all possible.

This last suggestion, however, was a truly convincing point on what
should or should not be in kernel.  I realize now that the
segmentation faults I see once in a while, when I do something silly
in my usual programs, will turn into complete denial of service
requiring physical access to the machine for a reboot.

I now see your other arguments as much more sensible, even for someone
who's "really interested in doing some kernel programming"!  I think
my approach will be to make a first proof of concept completely in
userspace, then move some parts of that program into kernel space.
This also allows performance comparison and correct optimization of
code (as opposed to the premature type).  This also convinces me to
use FUSE for my filesystem trials.  My personal preference is to avoid
FUSE, but I prefer much more to avoid rebooting often!  ;)

Thank you so much Valdis!
  Simon



More information about the Kernelnewbies mailing list