6 ms·
Read somewhere that it is relatively easy to adapt NetBSD's drivers into a custom kernel... maybe Serenity folks can go that way? Device drivers are huge obstac
by Santosh83 2y ago
Read somewhere that it is relatively easy to adapt NetBSD's drivers into a custom kernel... maybe Serenity folks can go that way? Device drivers are huge obstacle for any fledgling OS.
- ryukoposting 2y agoI believe it. Their libc is remarkably tidy, I've copied stuff out of it several times for various projects. Can't speak for the drivers, though.
- bboygravity 2y agoThe solution is to pick 1 good set of hardware (that the software authors sell themselves if possible) and build drivers for that and only that. It's basically what Apple does and has done from the start as far as I can tell. The only breakthrough consumer Unix-like thing out there. System76 is another example of (almost) that. Frame.work comes close although they don't focus on the OS as much.
- Kwpolska 2y agoApple used to sell Macs with Intel (integrated), AMD, and Nvidia GPUs. In other departments, they also had multiple vendors and chips. The Apple Silicon transition streamlined the product lines, but before, there were tons of drivers, and macOS had to support all of them for 5+ years after the product release.
- memsom 2y agoThey were still in complete control of the platform though. You couldn't just take a OS build and put it on another generic computer without a lot of hacking and/or picking hardware as close to the actual hardware that the OS could handle the differences. I know people did it - heck I had a hackintosh netbook back in the day, but it was not a trivial process and someone had to have done the work already for the "Average" consumer.
- lproven 2y ago> it is relatively easy to adapt NetBSD's drivers into a custom kernel AUIU NetBSD is implemented in C, and Serenity in C++. Would that work at all?
- mysterydip 2y ago> Device drivers are a huge obstacle for any fledgling OS. I've wondered if new/hobby OSes would fare better by starting out targeting a popular single board computer like a raspberry pi? A mostly fixed set of hardware to make/get drivers for and test your system on.
- junon 2y agoThat implies AArch64 support which many hobby OSes don't have, usually because the introductory osdev material is written largely for x86. But yes, raspi is a good platform if you are targeting arm. As I'm also designing an OS, my biggest piece of advice for anyone seriously considering it is to target two archs at once, in parallel. Then adding a third becomes much easier.
- kelnos 2y agoRaspberry Pi has a bizarre boot sequence and bringup process, much of it which is not open and not implemented in open source code. I think it's probably not a great platform for this sort of thing, despite it being decently well-documented. (And even then, its USB controller, for example, has no publicly-available datasheet. If you want to write your own driver for it, you have to read the Linux driver source and adapt it for your needs.)
- jazzyjackson 2y agoFor anyone that hasn't fallen into this rabbit hole yet it's a good one: raspberry pi started out as a kind of digital billboard appliance, so they chose a GPU with efficient 1080p decoding and strapped a CPU to the die. On power up the (proprietary) GPU boots first and then brings up the CPU. That's as far as I got before discovering the Armbian project could handle all that for me. Coincidentally that's also when I discovered QEMU because 512MB was no longer enough to pip install pycrypto once they switched to Rust and cargo. My pip install that worked fine with earlier versions suddenly started crashing due to running out of memory, so I got to use Armbians faculties for creating a disk image by building everything on the target architecture via QEMU. Pretty slick. This was for an Orange Pi.
- rogerbinns 2y agoRump kernel/anykernel is the concept. The drivers can run in user space with minimal underlying support. https://en.wikipedia.org/wiki/Rump_kernel https://en.wikipedia.org/wiki/Rump_kernel
- quux 2y agoOne of Serenity's philosophical decisions is that as much as possible they build everything themselves from scratch. So even if NetBSD's drivers would be easy to adapt and have a compatible license they probably wouldn't go that route and would instead write their own drivers.
- rollcat 2y agoThis is a noble and worthy goal in itself. Too much software development nowadays is just copying or gluing existing code. Clean-room implementations ensure we (collectively) still have the wits to rebuild and maintain the difficult parts.
- btreecat 2y agoIt also means we burn time and energy "rediscovering" the same knowledge we failed to better preserve and communicate. I'm all for greenfield when appropriate but I also get more quality work done standing on giants.
- rollcat 2y agoThe knowledge is already preserved. It's about keeping the muscles fit.
- quux 2y agoRediscovering the same knowledge has kind of been the point of Serenity OS since the project's inception.
- mrweasel 2y agoYou may also discover a new and better way to solve an old problem. For most things, build on the work of others, but every now that then, we should check if those "giants" actually found the best solution, so that we may chance direction if we're heading down the wrong path.