LWN: Comments on "User-space device drivers" https://lwn.net/Articles/66829/ This is a special feed containing comments posted to the individual LWN article titled "User-space device drivers". en-us Wed, 01 Oct 2025 22:49:20 +0000 Wed, 01 Oct 2025 22:49:20 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Event-driven API https://lwn.net/Articles/238858/ https://lwn.net/Articles/238858/ Jel This all sounds pretty horrible. Back in '83 or '84, the Amiga came out, <br> with a much nicer, event-driven device API. At least from the client <br> side, it was just a matter of sending events. So, say, for the narrator <br> device, you would send something like { SET_PITCH, ..., 2000 }, and it <br> would set the pitch of the speaker's voice. This was asynchronous of <br> course, so it worked really well with devices like SCSI units/buses.<br> <p> Presumably the server side was basically just registering a message queue, <br> and waiting for instructions.<br> <p> This wasn't a memory-protected kernel, but if we're talking userspace <br> anyway, then it shouldn't matter. The OS was fully multitasking, and <br> fairly real-time for the day, as I understand it.<br> <p> Why not use a model like this?<br> Tue, 19 Jun 2007 08:35:47 +0000 User-space device drivers https://lwn.net/Articles/74823/ https://lwn.net/Articles/74823/ PeterChubb When a userland driver fails, just kill it and start again. You may lose a few packets (for a network device) or any transactions that are halfway throough (for a disc device), but in most cases, this can be recovered from.<p>In the case of a kernel mode driver, the same faults often require a reboot... Tue, 09 Mar 2004 03:13:24 +0000 User-space device drivers https://lwn.net/Articles/68846/ https://lwn.net/Articles/68846/ joib IIRC the Plan 9 operating system allows user-space device drivers. They reason they did that was to bring the development advantages of microkernels described in this article, and then by loading the hopefully debugged driver into the kernel proper the speed benefits of a monolithic kernel are available. I think the point was that the same device driver code could be used for both, though a recompile is almost certainly needed? Fri, 30 Jan 2004 16:16:38 +0000 User-space device drivers https://lwn.net/Articles/68832/ https://lwn.net/Articles/68832/ forthy <p>The interrupt delivery part is something that has been necessary for years, because X still can't give you any way to syncronize to VBL interrupts (except OpenGL).</p> <p>On the other hand, I don't feel too happy with user land directly accessing IO ports. This is still dangerous, and buggy X drivers often can hang the machine, too. Memory mapped IO pages should be ok, given that the kernel would allow to map the PCI memory per device, not from /dev/mem. I suggets to keep the IO port part of a device driver inside kernel space.</ p> Fri, 30 Jan 2004 14:20:17 +0000 USB is different https://lwn.net/Articles/68657/ https://lwn.net/Articles/68657/ HalfMoon <p>This Gelato approach would seem to be focussed on a particular style of userspace driver, which works on non-virtualized devices. Specifically, it aims for PCI (or ISA) style devices, where the device driver needs to touch "real hardware". <p>USB is a good example of a different style driver, one where the device driver can't touch the hardware. In fact you can view USB drivers as the clients in a client/server framework, with the "server" being the device. The bus is really a special purpose network link, used to exchange packets between device and host. (And always initiated by the host, not the device/"server".) So userspace USB drivers work with virtualized devices ... they start with a formalized protocol to talk with the hardware, which doesn't involve register access, IRQs, or memory mapping except indirectly. <p>There are two approaches right now to userspace USB drivers. <ul> <li>The original "usbfs" (or "usdevfs"), which is in sore need of replacement. It's ioctl-heavy, and multiplexes I/O streams (up to 32 per device) into one file descriptor. And it defines its own async I/O primitives. So while a Java API exists, it's awkward. <li>"gadgetfs" runs inside USB devices. It's got hardly any ioctls, and uses one file descriptor per I/O stream. Current versions of gadgetfs (not yet in Linux 2.6) use standard AIO calls to support data streaming from userspace. </ul> <p>There are discussions underway to create "usbfs2", which should eventually replace "usbfs". It'll look much more like gadgetfs than "usbfs", with few ioctls and using the standard AIO framework. <p>So that's something else to keep in mind. This Gelato framework doesn't seem like it'd work well with USB, or with other device models that have already upleveled and virtualized their hardware. Thu, 29 Jan 2004 16:04:23 +0000 User-space device drivers https://lwn.net/Articles/67714/ https://lwn.net/Articles/67714/ jonabbey <a href="http://www.intersectalliance.com/">Snare's</a> userland audit daemon works in the same way Gelato does.. it loops reading audit events from /proc/audit. This method has the very great virtue of simplicity and it can actually be quite fast and efficient. It'll be neat to see where this goes for user mode drivers, but I wonder what happens if a user mode driver fails? Would the kernel be smart enough to stop preparing the data for the driver? I know when the Snare audit daemon closes /proc/audit, the kernel notices that it has been closed, and amends its behavior to avoid queueing up additional audit events. Fri, 23 Jan 2004 20:45:48 +0000 User-space device drivers https://lwn.net/Articles/67657/ https://lwn.net/Articles/67657/ aleXXX You can find some information about the kioslave-fuse bridge at: <br>http://kde.ground.cz/tiki-index.php?page=KIO+Fuse+Gateway <br> <br>And yes, it works, loading and saving files via konqueror in OOo or gimp <br>using ioslaves and fuse :-) <br> <br>You can also contact me directly: neundorf@kde.org <br> <br>Bye <br>Alex Fri, 23 Jan 2004 17:44:28 +0000 User-space device drivers https://lwn.net/Articles/67466/ https://lwn.net/Articles/67466/ scripter <a href="http://uservfs.sourceforge.net/">http://uservfs.sourceforge.net/</a> <p> <a href="http://sourceforge.net/projects/avf">http://sourceforge.net/projects/avf </a> <p> <a href="http://www.freenet.org.nz/python/lufs-python/">http://www.freenet.org.nz/python/lufs-python/</a> Thu, 22 Jan 2004 21:22:26 +0000 User-space device drivers https://lwn.net/Articles/67448/ https://lwn.net/Articles/67448/ stuart2048 What fun! Back in the days of "who's got the fastest IPC" my master's thesis project, the <a href="http://www.cs.ubc.ca/cgi-bin/tr/1993/TR-93-36">Raven Kernel</a>, was based on a user level approach (for as much as I could get away with...). <br><br> I did interrupt dispatching quite differently than Gelato. In Gelato, a user thread "reads" interrupts from an open file descriptor. In Raven, I took a more asynchronous approach: the kernel interrupt handler upcalls into the user driver (essentially interrupting the user code), where it then directly executes the handler code to service the device. <br><br> My motivation here was to make the user handler code execute with as low latency as possible. There were some tricky corner cases to implement, but I eventually got it working. ;-) <br><br> But after all that, I much prefer the simplicity of Gelato's approach and will stay tuned to their progress! <br><br> --Stuart Thu, 22 Jan 2004 19:53:54 +0000 User-space device drivers https://lwn.net/Articles/67345/ https://lwn.net/Articles/67345/ rjw Google for FUSE and LUFS for the most active user space FS projects. FUSE even has a bridge allowing the use of KDE IO slaves as a mountable filesystem. Thu, 22 Jan 2004 12:37:40 +0000 User-space device drivers https://lwn.net/Articles/67267/ https://lwn.net/Articles/67267/ danshearer There are several threads hanging out of the &quot;drivers in userspace&quot; tangle.<p>One of them is filesystems, which are a very logical thing to do in userspace. Peter's work doesn't address that at all. Years ago (back in 2.0) Jeremy Fitzharding (sp?) from Sydney did userfs, which let you do things like mount an ftp site. Some obvious fs candidates such as imapfs involve very long strings and according to (a) people who really know what they are doing and (b) my bumbling experiments, 64k strings are a *really* bad idea in kernel modules.<p>Another one is virtualisation. Read Jeff Dike on pushing User Mode Linux into kernel space for some clues on where this might be going. Jeff articulates advanced architecture and design better than most, so it is worthwhile looking for his stuff. His idea in this case is to port UML from the current libc interfaces at the backend to kernel interfaces, something like a module. Think of it like IBM's VM with OSs running underneath that, and the kernel of each OS is in true kernel space but within that applications (drivers, in this case) are completely protected. <p>--<br>Dan Shearer<br>dan@shearer.org Thu, 22 Jan 2004 05:54:08 +0000