2007-12-05 06:29:34

by Jaursch, Bill

[permalink] [raw]
Subject: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

I have am in the process of writing a driver that is software only.? I would like to avoid the caveats of a kernel mode installable module.? I found FUSD (http://svn.xiph.org/trunk/fusd/), but would like to know if this is a stable project.

If you have any other suggestions on projects, articles, etc. on Linux User Space Device Drivers, I would greatly appreciate the information.

Please cc: me on your responses.

Thanks,
Bill


2007-12-06 11:49:25

by Adrian Bunk

[permalink] [raw]
Subject: Re: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

On Wed, Dec 05, 2007 at 01:29:23AM -0500, Jaursch, Bill wrote:
> I have am in the process of writing a driver that is software only.  I would like to avoid the caveats of a kernel mode installable module.
>...

What is "a driver that is software only"
(all kernel code is also software only...)?

You must describe what you want to do for people being able to actually
help you.

> Thanks,
> Bill

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2007-12-06 12:22:24

by Leon Woestenberg

[permalink] [raw]
Subject: Re: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

> If you have any other suggestions on projects, articles, etc. on Linux User Space Device Drivers, I would greatly appreciate the information.
>

A suggestion:

UIO: user-space drivers, since kernel version 2.6.21

http://lwn.net/Articles/232575/

Regards,
--
Leon

2007-12-06 12:38:47

by Stefan Richter

[permalink] [raw]
Subject: Re: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

Adrian Bunk wrote:
> On Wed, Dec 05, 2007 at 01:29:23AM -0500, Jaursch, Bill wrote:
>> I have am in the process of writing a driver that is software only.
>> I would like to avoid the caveats of a kernel mode installable module.
>>...
>
> What is "a driver that is software only"
> (all kernel code is also software only...)?
>
> You must describe what you want to do for people being able to actually
> help you.

Although "software only" is a wrong term here, it's certainly clear from
context what he meant. However, what's missing is information about the
kind of device he plans to support. Is it a USB device or is it sitting
behind a similar bus? Or is it a device on a local bus like PCI? In
the latter case, is DMA involved?

>> I found FUSD (http://svn.xiph.org/trunk/fusd/), but would like to know
>> if this is a stable project.

This question should be directed to the authors or maintainers of FUSD.
Note, AFAIU from its documentation, FUSD is not a means to implement
arbitrary kinds of device drivers in userspace. It allows for "proxying
*device file* callbacks into user-space, allowing *device files* to be
implemented by" userspace programs (emphasis is mine). I.e. FUSD gives
userspace programs only the ability to supply a character special file
to other userspace programs. In order to drive real hardware, the FUSD
client would additionally need to access other userspace interfaces of
the kernel, provided by actual kernelspace drivers.
--
Stefan Richter
-=====-=-=== ==-- --==-
http://arcgraph.de/sr/

2007-12-06 19:29:44

by Stefan Richter

[permalink] [raw]
Subject: Re: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

Jaursch, Bill wrote:
> The reason to even consider a driver for this "Software only" driver
> was to start the work of writing a kernel space driver (loadable
> module). So more specifically, I wanted to know if there is a way
> to use calls to the kernel to access a loadable module that is
> running code in User Space (to take advantage of libraries, tools,
> prevention of kernel crashes, etc.).

Since you plan to use this for a PCI device eventually, it sounds like
UIO would be of help.

> I am running 2.6.20, so many of the new User Space Driver features
> don't appear to be available (UIO, User Space API, etc.). And at
> this point I don't expect my end users to upgrade to a newer kernel.

Perhaps you can backport UIO or can get someone to do it for you.
--
Stefan Richter
-=====-=-=== ==-- --==-
http://arcgraph.de/sr/

2007-12-06 19:34:15

by Jaursch, Bill

[permalink] [raw]
Subject: RE: FW: Guidance on resources for User Space Device Drivers on 2.6 kernel

Your point is well taken.

I will probably end of with a system daemon (User Space), but pass
communication via a Kernel module (Kernel Space). The application can
call the kernel module, passing data back to the daemon (User Space).
Once I have hw, I may just use the kernel module.

Thanks again.

-----Original Message-----
From: Stefan Richter [mailto:[email protected]]
Sent: Thursday, December 06, 2007 11:29 AM
To: Jaursch, Bill
Cc: Adrian Bunk; Leon Woestenberg; [email protected]
Subject: Re: FW: Guidance on resources for User Space Device Drivers on
2.6 kernel

Jaursch, Bill wrote:
> The reason to even consider a driver for this "Software only" driver
> was to start the work of writing a kernel space driver (loadable
> module). So more specifically, I wanted to know if there is a way
> to use calls to the kernel to access a loadable module that is
> running code in User Space (to take advantage of libraries, tools,
> prevention of kernel crashes, etc.).

Since you plan to use this for a PCI device eventually, it sounds like
UIO would be of help.

> I am running 2.6.20, so many of the new User Space Driver features
> don't appear to be available (UIO, User Space API, etc.). And at
> this point I don't expect my end users to upgrade to a newer kernel.

Perhaps you can backport UIO or can get someone to do it for you.
--
Stefan Richter
-=====-=-=== ==-- --==-
http://arcgraph.de/sr/