Live data from Hacker News

Userland PCI drivers

wiki.netbsd.org

31–40 of 55 posts

Re: Userland PCI drivers

#31
post #2

I remember seeing the PCI userspace option in the Linux kernel menuconfig and wondered why anyone would do that, and then a few years ago at Kiwicon I saw my first use case. A presenter was trying to hack a Cisco router. Older Cisco routers ran IOS directly on proprietary hardware. At some point, Cisco decided to switch to Intel hardware but didn't port their kernel. They use a Linux kernel and ran IOS as a huge 50MB…

It may be equal parts GPL avoidance. Broadcom switch ASIC PDKs are a kind of hybrid kernel and userland application with no legacy reason, so I assume it is just arbitrarily about working around a restrictive license.

Re: Userland PCI drivers

#32

I guess monolithic kernels have gone full-circle now.

Most real life implementations of "microkernels" end up being hybrids. NT started out as a micro, but Microsoft have been moving things (the graphics subsystem in particular) in and out of kernel space in the hunt for the optimal tradeoff between stability and performance. Similarly i think the Mach kernel powering Apple's OSs are a "fat micro" where various things that should be in userspace, if one followed the mic…

There is Minix running in most Intel CPUs.

L4 running on most GSM radio chips.

Many embedded RTOS targeted at critical systems, are microkernels as well. For example the offerings from Green Hills.

Re: Userland PCI drivers

#33
post #27

Earlier quoted context omitted.

See Tannenbaum et al's paper on reliability/security mechanisms for a nice intro: http://cs.furman.edu/~chealy/cs75/important%20papers/secure%... The main benefit is reliability. Driver code is usually lower-quality than other code that runs in kernels. The hardware itself can act weird in a way that messed the drivers up. The infamous Blue Screen of Death on Windows was usually driver errors. Isolating them in their…

Note that Windows Vista onwards has UMDF too (user-mode driver framework). NT6.0 was a very big step.

UMDF was available for XP too, and printer drivers had been user space for a long long time.

Re: Userland PCI drivers

#34
post #33
post #27

Earlier quoted context omitted.

Note that Windows Vista onwards has UMDF too (user-mode driver framework). NT6.0 was a very big step.

UMDF was available for XP too, and printer drivers had been user space for a long long time.

I see, was a backport there

Re: Userland PCI drivers

#35
post #33
post #27

Earlier quoted context omitted.

Note that Windows Vista onwards has UMDF too (user-mode driver framework). NT6.0 was a very big step.

UMDF was available for XP too, and printer drivers had been user space for a long long time.

iirc you can have kernel-mode GDI printer drivers, and the printer port drivers are in the kernel as well

Re: Userland PCI drivers

#37
post #10

Reminds me of this 34C3 talk: https://media.ccc.de/v/34c3-9159-demystifying_network_cards

I heartily recommend this talk. It and the corresponding proof-of-concept Intel userland packet processing driver[1] went a long way for me in removing a lot of the magic from low-level network packet handling and device management in Linux.

[1] https://github.com/emmericp/ixy

Re: Userland PCI drivers

#39
post #2

I remember seeing the PCI userspace option in the Linux kernel menuconfig and wondered why anyone would do that, and then a few years ago at Kiwicon I saw my first use case. A presenter was trying to hack a Cisco router. Older Cisco routers ran IOS directly on proprietary hardware. At some point, Cisco decided to switch to Intel hardware but didn't port their kernel. They use a Linux kernel and ran IOS as a huge 50MB…

For those who are confused, this is not Apple's IOS, but Cisco's OS that was once (not sure about now) called IOS.

True, because Apples OS is called iOS.

Re: Userland PCI drivers

#40
post #12

Isn't the advantage of running hardware drivers in userspace to limit the attack surface of a driver being exploited?

See Tannenbaum et al's paper on reliability/security mechanisms for a nice intro: http://cs.furman.edu/~chealy/cs75/important%20papers/secure%... The main benefit is reliability. Driver code is usually lower-quality than other code that runs in kernels. The hardware itself can act weird in a way that messed the drivers up. The infamous Blue Screen of Death on Windows was usually driver errors. Isolating them in their…

Somewhat related, Minix3 finally fixed the release blocker for 3.4.0.

Expect a release soon, for the first time in years. And it's a major one.

Post reply on HN