4 ms·
If its compatible with linux then the linux drivers would work right?
by andrewchambers 2y ago
If its compatible with linux then the linux drivers would work right?
- raggi 2y agoIn short: no. Longer: there is no such thing as "compatible with linux drivers", linux has a stable(ish, very ish) userspace, but it does not have a stable HAL or driver interface. All of the drivers in Linux are GPLv2, so there are constraints to "borrowing code" from them, if you'd even be able to or want to. On the "ish" about userspace, while the POSIX layer is pretty stable, the deeper you go beyond that, extended ioctls for devices and drivers, some stuff on netlink, etc are not nearly as stable as the "never break userspace" mantra would imply too. Running a subset of userspace software is pretty easy (https://fuchsia.dev/fuchsia-src/concepts/components/v2/starnix https://fuchsia.dev/fuchsia-src/concepts/components/v2/starn..., https://docs.freebsd.org/en/books/handbook/linuxemu/ https://docs.freebsd.org/en/books/handbook/linuxemu/) but getting much further is extremely hard, and probably practically untenable as Linux is a moving target, even in userspace.
- snvzz 2y agoIn such a scenario, it makes sense to design a sane, stable driver api and move drivers to it. Such drivers would require little maintenance and would thus be much more valuable than Linux drivers. They would be free from the insanity that is Linux's lack of internal structure.
- raggi 2y agoandroids gki is an effort in this direction which has been helping android vendors. it has a number of limitations which would need to be overcome for broader use, but definitely is a good direction https://source.android.com/docs/core/architecture/kernel/generic-kernel-image https://source.android.com/docs/core/architecture/kernel/gen...
- snvzz 2y agoIt would indeed make a lot of sense for Google to untie drivers from Linux, as it could mean drivers that work on both Linux and Fuchsia.
- raggi 2y agoI don't know if KMI is all that stable (I've not looked), and some of the modules may be constrained to that symbol space (though not boot drivers), and they'll still likely encode assumptions about being in a single kernel address space. KMI alone is likely not sufficient for driver portability. The original goal of this Android project was to reduce the cost and complexity of vendor forks, which as explained in the docs, sometimes ran up to 50% patched code prior to GKI.
- estebank 2y agoThe Linux kernel is stable for userspace only. Drivers are expected to be merged up stream and the internal APIs change often with no regard for out of tree drivers. So there's no interface that an alternative kernel can target that doesn't constantly change.
- andrewchambers 2y agoPretty sure you could just choose an LTS abi and use that.