5 ms·
Linux user here, not NetBSD. My exposure to NetBSD is infinitesimal. But ... I saw a video on "rump" kernels awhile back. I also heard that Andrew Tanenbaum po
by blippage 5y ago
Linux user here, not NetBSD. My exposure to NetBSD is infinitesimal. But ...
I saw a video on "rump" kernels awhile back. I also heard that Andrew Tanenbaum ported/is porting Minix to NetBSD. NetBSD has an "anykernel" approach which separates the kernel for the drivers. So you can impose your own flavour of kernel on a bunch of pre-written drivers.
This struck me as a potentially mind-blowing win for NetBSD. Why isn't every RTOS, embedded system OS, toy OS,experimental OS etc. based on NetBSD? I don't know the reason for this. Maybe it's part NIH, part open secret that nobody's heard about, and a large part to do with getting over the hump of integration.
- mapgrep 5y agoThat is super interesting. I will say the package manager (pkgsrc) seems to be very portable as well. It’s default on netbsd, smartos/illumos, and minix, but also available for macOS, Linux, and other operating systems. I use it routinely on smartos and it’s a breeze.
- tomxor 5y ago> This struck me as a potentially mind-blowing win for NetBSD. Why isn't every RTOS, embedded system OS, toy OS,experimental OS etc. based on NetBSD? I think it is used a lot as a starting point for porting other OS, but it doesn't necessarily persist. Supposedly Apple started with NetBSD when porting OS X to x86, not that x86 is exactly esoteric, but NetBSD lends itself to being a starting point. From what I read nothing remains of NetBSD in OSX, the current BSD userland is from FreeBSD but is pretty old still.
- wahern 5y agoApple Base Station and related firmwares (e.g. Extreme) ran NetBSD. BSD-based products are more common than believed, but because of the liberal licensing they seem to mostly fly under the radar, not unlike various proprietary options like VxWorks and TRON.
- snowwindwaves 5y agoJust to be clear vxworks is not bsd based that I could tell from Wikipedia. I work with Schneider electric plcs and sometimes vxworks errors bubble up.
- codetrotter 5y agoI think they meant to say that BSD-based stuff is common but unknown to most, and that the same goes for VxWorks and TRON, in that both open source BSD and proprietary solutions have licenses that make their inclusion in other software products not noticed by many people.
- tomxor 5y agoSame for Minix3... until someone dug it out of IntelME no one knew it was one of the most ubiquitous deployed OS.
- rjsw 5y ago> NetBSD has an "anykernel" approach which separates the kernel for the drivers. So you can impose your own flavour of kernel on a bunch of pre-written drivers. As a NetBSD developer, I don't recognize what you mean by this.
- mapgrep 5y agoMaybe read this whitepaper: https://www.netbsd.org/gallery/presentations/justin/2015_AsiaBSDCon/justincormack-abc2015.pdf https://www.netbsd.org/gallery/presentations/justin/2015_Asi... “ The rump kernel has been used as a way to supply device drivers in other new operating systems, which do not yet have a full set of device drivers. For example, Genode[4] is a framework for building microkernel operating sys- tems using the L4 family of microkernels. Genode uses the rump kernel to provide file system support, so that it does not have to develop its own file systems.” Here’s a 362 page dissertation on rump kernels which has a netbsd focus: http://lib.tkk.fi/Diss/2012/isbn9789526049175/isbn9789526049175.pdf http://lib.tkk.fi/Diss/2012/isbn9789526049175/isbn9789526049... There’s also the Wikipedia entry. https://en.m.wikipedia.org/wiki/Rump_kernel https://en.m.wikipedia.org/wiki/Rump_kernel
- rjsw 5y agoThat isn't how device drivers are used in NetBSD though, it is a different way of compiling them for other targets.
- mapgrep 5y agoFrom the white paper published on netbsd.org: “ An implementation that does this ships with NetBSD, allowing the NetBSD drivers to be run in NetBSD userspace… The first major PCI driver developed was the In- tel Centrino 7260 driver developed for NetBSD and OpenBSD by Antti Kantee. The commit message said “This is probably the world’s first Canadian cross device driver: it was created for OpenBSD by writing and port- ing a NetBSD driver which was developed in a rump ker- nel in Linux userspace.”[13] Further, just another example, from page 149 in the dissertation is an extended many page discussion of how the rump kernel was used to provide usb support in netbsd. http://lib.tkk.fi/Diss/2012/isbn9789526049175/isbn9789526049175.pdf http://lib.tkk.fi/Diss/2012/isbn9789526049175/isbn9789526049... “ We implemented a host controller called ugenhc. When the kernel’s device autocon- figuration subsystem calls the ugenhc driver to probe the device, the ugenhc driver tries to open /dev/ugen on the host. If the open is successful, the host kernel has attached a device to the respective ugen instance and ugenhc can return a successful match. Next, the ugenhc driver is attached in the rump kernel, along with a USB bus and a USB root hub. The root hub driver explores the bus to see which devices are connected to it, causing the probes to be delivered first to ugenhc and through /dev/ugen to the host kernel and finally to the actual hardware. Figure 3.24 con- tains a “dmesg” of a server with four ugenhc devices configured and one USB mass media attached.” ¯\_(ツ)_/¯
- yjftsjthsd-h 5y agoYeah, rump kernel tech seems like it should be taking the world by storm - in particular, it looks to me like NetBSD should be a "universal donor" of drivers to other systems. So for instance, as I understand it, with minimal shims, you should be able to use NetBSD hardware drivers on Linux and Illumos and HURD and Redox and [your hobby project here]. It'd be worse than "native" drivers, but especially for smaller projects it'd save a ton of work. > I also heard that Andrew Tanenbaum ported/is porting Minix to NetBSD Kernel, or userspace? Last I paid attention, MINIX 3 used pkgsrc for packages and I think base/coreutils in userspace, but I hadn't heard anything about kernel space. Though, as I mentioned above, it does seem like the obvious way to get drivers for a lot of hardware cheaply, especially if you're already a microkernel.
- the_only_law 5y agoNot NetBSD, but iirc a lot of the network drivers in Haiku were taken from FreeBSD.
- rekado 5y ago> with minimal shims, you should be able to use NetBSD hardware drivers on [...] HURD The Hurd is already using rumpkernel for some servers, e.g. for audio and work is underway for disks.
- II2II 5y agoThere was a time when NetBSD's portability was impressive. A handful of open source operating systems supported a handful of architectures, then there was NetBSD (and OpenBSD). Then Linux started to look beyond the x86 and started gathering steam on other architectures. NetBSD couldn't really compete for developers and it began stagnating. It probably didn't help that a lot of the "Unix" userspace also became more tightly coupled to Linux. Don't get me wrong: I was enormously enthusiastic about NetBSD in the mid-1990's and I still prefer the idea of a unified core OS. The thing is, it's a lot easier to deal with one operating system than multiple. If you're developing under Linux, it's going to be easier to develop code for an Arm based system under Linux because it defines your expectations.
- danieldk 5y agoLinux probably supports more platforms these days. But it often requires vendor-specific kernel forks, specific distributions, etc. NetBSD is impressive because it can be (cross-)compiled for many systems using the stock distribution without much effort (build.sh script). Disclaimer: I haven't used or looked at NetBSD since 2006-2007 or so, but I think this is still accurate.
- anthk 5y agoThis. Linux under ARM is a nightmare, NetBSD for ARM it's just a single distribution per subarch.
- nix23 5y agoLinux is just a Kernel NetBSD is a System.
- anthk 5y agoLinux doesn't even properly work on legacy non-x86 devices. NetBSD for m68k runs much better than GNU/Linux. EDIT: Downvote me if you want, but the reality is that hard. You have to use specific distros and hard patches to get things running well. For example under PPC32 there's no support for common distros. Don't let me start on Mips, Sparc or Alpha, where NetBSD runs on it just fine.
- jschwartzi 5y agoQNX RTOS uses netbsd userspace applications, actually. And a lot of the drivers in QNX are from NetBSD. It’s more properly a “microkernel” which means the drivers run as userspace applications with a defined interface to the kernel for memory maps to underlying hardware.
- unixhero 5y agoAre new versions of QNX available on X86?
- detaro 5y agoyes. (newest one might just be x86_64, not 100% sure on that)
- unixhero 5y agoThat's cool, I can emulate 32 if necessary :) How might one obtain it?
- touisteur 5y agoI'm guessing, call blackberry and prepare to break your piggybank?
- touisteur 5y agoAnnnnd please let us know how many limbs you had to sell. I'm actually interested in ballpark numbers for this, as I have very fond memories of QNX as the OS where my 100us timers did fire even under heavy IO, threading churn, etc. I miss that.
- deleted 5y ago[deleted]
- nix23 5y agoGo there: http://www.qnx.com/download/group.html?programid=29178 http://www.qnx.com/download/group.html?programid=29178 Download: QNX Software Center Register a free Non-Commercial/Academic License: http://www.qnx.com/download/feature.html?programid=51624 http://www.qnx.com/download/feature.html?programid=51624
- 1vuio0pswjnm7 5y agoPublic release of RUMP predated Docker by at least two years, maybe it was more. I just remember when all the Docker hype began I was thinking "WTF, this is not even half as good." But that's what's different about NetBSD. No hype. To answer the question of why it isn't more widely used, IMO, besides absence of hype, it's lack of hardware support, and comfort among those who use it with notions like DIY and minimalism. Often you have to put in some effort to get some hardware feature to work.1 With Linux, chances are someone else has done that work for you. 1 First time I ever tried NetBSD, the audio did not work on the laptop I was using. I added a couple of lines in a kernel header file, recompiled and voila, I had audio. That simplicity made me want to keep using it.
- qwerty456127 5y ago> I added a couple of lines in a kernel header file, recompiled and voila, I had audio How did you figure out what to add?
- 1vuio0pswjnm7 5y agoIIRC, dmesg. It was probably pure luck that it worked.
- anthk 5y agoClose to my change to the BTTV drivers for a Conceptronic TV card. Most of hardware use common devices and chipsets.
- swiley 5y agoIMO: NetBSD might be superior but the lack of GPL means less work on it is published. The net effect is that everyone puts up with Linux because it actually runs on everything.
- anthk 5y ago>Linux because it actually runs on everything. Good joke. Linux barely runs on some legacy arches, having to use really old kernels and making a lot of current software useless. NetBSD just /runs/ new releases on older hardware such as m68k machines with no crazy tweaks. >but the lack of GPL means less work on it is published. You realize a lot of the components on the graphics substack on Linux are non-GPL, right? Not just X, but the backends on the kernel. Also Linux is full of propietary drivers and blobs. Check Linux-Libre's changelog if you don't believe me.