7

cusexmp, the example of CUSE program, works.

Is there real programs that makes use of it?

For example, a thing that just mirrors other character device or thing that allows networked character devices.

3 Answers 3

5

How about this one:

http://userweb.kernel.org/~tj/ossp/

It emulates OSS (Open Sound System) /dev/dsp e.t.c. device nodes and forwards all operations to pulseaudio. I believe this was (one of) the first applications, if not the motivation, for CUSE.

4

I'd be interested to use CUSE to make a virtual serial port that connects to an RFC-2217 serial-over-network server. That would be a really good use of CUSE.

See:

I found mhuxd — Device Router for microHam Keyers and Linux which uses CUSE to create a virtual serial port.

I also found utty on GitHub which has some CUSE code for a TTY (terminal), although it's not clear to me whether the ioctls for serial port support are functional.

2
  • Did you manage writing your serial driver with cuse ? which best example do you recommend as a start point ? I looked at the links and it seems complex.
    – ransh
    Feb 7, 2019 at 18:53
  • I haven't, sorry. I don't have a compelling need either at home or at work, and there's not enough time in life to do everything I'd like. I'll most likely do it if I have a work project that would benefit from it. Feb 7, 2019 at 23:07
3

I maintain a Linux kernel-space serial-port-over-network driver, and have been wanting to move it to userspace for 15 years. I've looked into using ptys, but they only provide support for a subset of the operations that need to be implemented for a serial port. On several occasions I've proposed extending the Linux pty driver so that it could be used as a way to implement user-space serial port drivers, but have never gotten any response from the maintainers -- so CUSE looks like it might finally provide a way to do what I want. :)

I have found references to people using CUSE from Python, and cusepy seems to be the most popular way to do it:

There's a quantumrandom package on PyPI that appears to use it.

And osspd is another OSS emulator that uses CUSE.

That might be the same as the one mentioned a a few posts up, but I can't tell because that link doesnt work.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .