Character devices in user space (CUSE)

Posted on

I was planning to write a loadable kernel module that runs on the latest RHEL and creates character devices for my application to use.

Now I'm thinking about whether or not I can accomplish that instead in user space. I'm just now researching the concept of character devices in user space (CUSE). I am wondering if RHEL specifically (1) makes that difficult or impossible, (2) explicitly supports that in some way, (3) or really has no impact either way and it remains up to me to get it working.

Note that my primary reason for interest in this is that I have a legacy system that makes named pipes, and a different legacy application that uses a single character device (application such as putty). I need to bridge the bi-directional communication of the named pipes over to a single character device. My research says the kernel shouldn't open the named pipes; instead, that should be done from user space. But my experience says that the character device should be created and handled from kernel space. This leaves me creating a sequence of TWO bridges, one in user space to bridge to an interim character device, and another bridge in kernel space that connects the interim with the originally intended character device.

But if I can put the driver of the originally intended character device in user space, then I need just one user space driver to bridge from the named pipes to the character device.

Note that I believe pty's won't work for this. The details have to do with setting baud rate and other control events, as well as interrupt like events.

Responses