What are the advantages of the Hurd over Linux/BSD? (2013)
gnu.org
gnu.org
HURD might have user filesystem servers, but they're nowhere near Plan9's "each process gets a mount table, and then things like environment variables are just exposed process-local mounted filesystems."
Interestingly, given all the cgroups work put into the Linux kernel, you can almost achieve this postmodern "every process gets its own VFS, and uses it as scratch-space" effect with the one-two punch of:
fusermount ... /mnt/env/1
docker run -v "/mnt/env/1:/env" ubuntu
This, admittedly, still takes root-esque privileges somewhere along the line (either fusermount is SUID and run on the host, or the container must be run -privileged so you can mount inside it), but this isn't a fundamental restriction, just a historical artifact of Docker being designed before user-namespaces were finished. It's perfectly possible with raw unshare(2) to spawn a process as an unprivileged user, in which the process is acting with alternate-namespace UID0 privileges, and can mount whatever filesystems it likes in its alternate-namespace VFS.It seems like the main thing that makes true plan9-style namespacing unrealistic is the security implications, since the filesystem is used extensively to control privilege escalation. Whether it's through setuid flags or through /etc/sudoers or /etc/groups, at some point a privileged program (su or sudo) might be running in an unknown or untrusted namespace where the facts visible to that program make a solid case for allowing the escalation.
I'm not sure this tension can ever really be resolved without also adopting a plan9-style out-of-process escalation mechanism. Which is a huge departure from POSIX in and of itself, as far as I know.
I'm really not sure how HURD deals with this, to be honest, or if it does at all.
Catching up to what? A 24 year old kernel with no userbase and uses IRC logs as the majority of documentation? Is Hurd useful as anything other than a research project? I would be interested to see what people here who have used Hurd have to say.
Bear in mind that a research project can be interesting in its own right, not everything has to be about large scale use.
Now if HURD is an interesting research, that's an entirely different subject...
HURD uses Mach, which is a mid-90s academic microkernel that's not so good in practice. Particularly, it's so slow at IPC (which is critical to performance in a pure microkernel system) that those using it (Darwin/OSX/IOS, HURD) had to compromise and use a hybrid architecture: Running drivers and some other components of the system with kernel privileges; A popular design choice in the 90s (also BeOS, Windows NT) due to the immaturity of microkernels.
In late 90s/early 2000s, L4 happened. It went to great lengths to actually make achieving performance with a pure microkernel architecture possible. Afterwards, there were a lot of followup microkernels implementing the L4 interface, so these days when we say L4 we generally mean the interface, or any microkernel that implements it.
The HURD was watching, and sometime early 2000s they realized that the hybrid architecture was dead and they needed to move on if they wanted to stay relevant. There was a serious attempt at porting HURD to L4. It was already working, but the people behind it became disillusioned with the HURD, after realizing flaws on the architecture. I recommend reading the papers the L4 port people wrote on this. Back then, there were some ten to twenty HURD developers active.
After that, the HURD should have rethought its architecture and moved on with L4. Instead, they didn't continue the L4 effort nor fix the architecture. What they did was abandon it and start an entirely new port to a different microkernel, Coyotos, which didn't bear fruit, either. Throughout all this, the HURD was losing developers as they became disinterested.
Fast forward to 2005, Andrew Tanenbaum and his students released the first version (a mere skeleton, without even virtual memory support) of Minix3, and continued working from there http://wiki.minix3.org/MinixReleases , going a long way and bringing us to its current state. Right now, Minix3 has 20-30 active developers any given day, a few of which are working on it full-time, supported by funds coming from European Union research programs, as the reliability aspect http://www.minix3.org/other/reliability.html to Minix3 has been deemed important.
Meanwhile, the HURD has 0-3 active developers depending on the day, none of which working full time, and with no roadmap or organization whatsoever. Last I've heard, they introduced userspace driver support, which is a step in the right direction, but a bit silly as the real problem (they're still using Mach) is yet to be solved.
Minix3 next version, 3.3.0, is weeks away. Here's some insider info: It breaks ABI to adopt NetBSD types, skyrocketing compatibility with pkgsrc software. The system will for the first time be built dynamic, as mmap() is finally working and the dynamic library support has been adapted to actually do shared libraries using it.
As lack of proper dynamic library support was holding back X (which already ran, but with barely any software for it), I expect we'll have a lot of WMs, DEs and GUI programs from here on, and interest will pick up.
If you ask me about the HURD, I'd say it's not worth continuing. Just take along whatever salvageable ideas and concepts and move on. Working on a system that isn't at a dead end is one suggestion. Escape https://github.com/Nils-TUD/Escape , HelenOS and Minix3 are three such systems. Genode is not exactly a system but it is interesting in its own way, and Plan9Front http://ninetimes.cat-v.org/ is very interesting even though it is not currently a pure microkernel system (it can be made so without breaking anything thanks to the awesome design). All these systems I suggested are Free Software, interesting, promising and actually active.
And I think gaius is right. Burroughs did it before.
The only concern for me is performance. Though I believe the service server provided by the Hurd would outperform FUSE, I'm not sure that it is worth the overhead of all other parts in the entire system. If the performance decrease is negligible, I'll be happy to use the kernel.
QNX, Symbian, L4, PikeOS are just some examples of operating systems with micro-kernels that achieved success on the market.
Only the desktop/server OSs still lag behind due to compatibility with existing software.
I run software that (thanks to poor design, IMO) manages to bottleneck context switching on Linux's monolithic kernel. I can't imagine this not being worse with more of the OS pushed out into userspace, though I'd love to be proven wrong!
It can potentially be even better, since you can potentially get more direct access to whatever resource you're contending on.
The Mill CPU design doesn't have a user/kernel mode split, and it's also single-address-space (still with the same level of protection, just a different mechanism). Protection domain switching is done through portal calls, which are essentially shared library-like indirect calls with metadata for the CPU. Further, saving and restoring things like registers is done asynchronously. That should remove any remaining performance difference (and make monolithic designs faster too).
Their forum has some good responses from the team on follow up questions asked by the community as well.
i also tried installing the debian port on an old desktop but had some driver issues. i guess most people run it in a hypervisor.
there are a lot of architectural advantages to putting all drivers in user space. the hurd isn't really totally comparable to plan 9 (because it runs on a microkernel) or minix (because it's thought of as being independent of the any partciular microkernel). but it seems like the community/political issues -- plus the amount of cruft that's bound to accumulate in a codebase that old -- has nearly slowed to project to a grinding halt, which is a kind of a shame.
We are still very far from other industries where reliability is taken seriously.
That is, yes there was a cost to this. However, leaving aside the unknowns of whether there would still be millions in tooling necessary for security even with microkernels, you have to provide some sort of reasonable argument that the current market (> billions) would still exist. You can't just take that for granted.
The difference isn't that IT has some dangerous crap in it. The difference is that you know some of these dangers. And, you feel that it doesn't belong for some reason.
Consider, you probably have highly charged electrical wiring to your house. Fairly high pressure water. Possibly gas. Literally explosive. Several drawers of sharp instruments in your kitchen. Possibly power tools that are literally spinning blades. Of sizes from less than a centimeter to upwards of a meter.
Think of a computer less as a safe device that only gives good results, and more as an extremely powerful tool that does what you tell it to do. Very fast. And then be thankful that it won't take your fingers off if you slip while pushing a board across it.
* Who am I kidding? We still do a fair bit of it. :)
Also... apropos of what? I'm not sure how this followed from my parent post.
Per another comment on this thread the Docker as P9 process is pretty close. But it doesn't share services per se across users in the space. Spring (Sun's research OS) looked at cutting the penalties down for moving kernel/user with some nice 'doors' kinds of things. At the time there was discussion that with enough address space (so that you're VM system got the benefit of warm caches and no page remapping) you could really do some interesting things. Were I retired I would probably spend some time playing with that stuff on a modern 64 bit architecture :-)
five transitions (user->kernel->user->kernel->user)
three (user->kernel->user)
Aren't these 4 vs. 2 transitions?I wonder if it couldn't be accelerated with hardware support...
guestfish -N test1.img=fs
guestmount -a test1.img -m /dev/sda1 /tmp/mnthttps://www.gnu.org/software/hurd/hurd/translator/wishlist.h...