4 ms·
Here is what I thought after reading an article: Linux should provide an API for drivers. So that the drivers can be reused by other OS like FreeBSD or Plan9. I
by codedokode 5y ago
Here is what I thought after reading an article: Linux should provide an API for drivers. So that the drivers can be reused by other OS like FreeBSD or Plan9. If you are making a new OS, it is prohibitively expensive to reinvent the USB stack, write your own ACPI interpreter or port millions of lines of code. There should be an API, otherwise these drivers don't differ much from proprietary drivers.
Other OS like Windows, Android or MacOS implement such an API. Therefore it is possible. I think that truly open source drivers should be available for everyone, not only to the users of one specific kernel.
- coliveira 5y agoI also wonder why other OSs don't implement a Linux binary interface for drivers, so they can reuse at least some Linux drivers.
- kryptiskt 5y agoThere already is an example of such an API, it's possible to use NetBSD drivers outside the NetBSD kernel with its rump kernel feature: https://research.csiro.au/tsblog/using-rump-kernels-to-run-unmodified-netbsd-drivers-on-sel4/ https://research.csiro.au/tsblog/using-rump-kernels-to-run-u...
- ori_b 5y agoThe millions of lines of code aren't inherent to the problem. Here's the 9front ACPI interpreter: http://git.9front.org/plan9front/plan9front/HEAD/sys/src/libaml/f.html http://git.9front.org/plan9front/plan9front/HEAD/sys/src/lib... And the USB stack, user and kernel side: http://git.9front.org/plan9front/plan9front/HEAD/sys/src/cmd/nusb/lib/f.html http://git.9front.org/plan9front/plan9front/HEAD/sys/src/cmd... http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/port/devusb.c/f.html http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/p... http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/port/usbxhci.c/f.html http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/p... Even the complex drivers, like wifi, are relatively small: http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/pc/etheriwl.c/f.html http://git.9front.org/plan9front/plan9front/HEAD/sys/src/9/p... Linux code is unpleasant. I don't want to deal with it. Give me clear, well-written docs instead. Of course, since that never happens, we just end up reading the linux code and reimplementing it in a way that's acceptably clean.