LibOS – A library operating system for Linux
lwn.net
lwn.net
Rather than re-implement a new network stack and solve all the same problems again, this builds on the years of good work already done and leverages the existing time investment within the existing stack.
"Librarising" existing stacks to userspace, great idea, this is the way of the future.
Thats why it is important that this project becomes part of upstream so it can be maintained as the stack changes.
"An operating system is a collection of things that don't fit into a language. There shouldn't be one." --DanIngalls
What would a "no OS" system that equally supports multiple languages look like?
edit: Multiple languages that have nothing in common. Think about the insane variety of languages you have available on *nix.
Racket?
I know all these names, unfortunately only by reading and not by experience. Some lispers are also keen on bypassing OS interface and emit binary code on the go.
¹http://en.wikipedia.org/wiki/Bartok_%28compiler%29
² http://en.wikipedia.org/wiki/Singularity_%28operating_system...
IIRC the Lisp Machines (well, CADR at least) compiled code down to some pretty high-level machine code implemented in microcode. How many standard C idioms could actually be expressed in that kind of code?
I'm also not seeing how it would give a speed-up, which is the usual reason to code in C.
Was the C compiled to microcode?
You might still get a speedup by writing C in some areas, but I think the real reason for supporting it is that you have a bunch of legacy software and drivers written in C, and it's easier to get a C compiler working on that platform than to port all that software.
1) using the Genera development environment, where you could interactively/incrementally develop/debug C
2) using some C/Pascal software on a Lisp Machine. Examples were the MIT X11 server and TeX.
So that's several variants of lisp, as well as fortran, c, pascal, prolog and ada. Thats pretty much most of the languages in use in the 80s.
OSv is another option, it makes life easier by supporting Linux binaries modified to be dynamic libraries, and runs several languages too, although it was initially mainly targeted at JVM languages.
Anyone who's ever faced the daunting task of bolting TCP on top of custom datagram protocol can certainly confirm how useful a library like this is.
(This is not meant to be dismissive, just inquisitive. I'm sure it can't be anywhere near as easy as what I said, I'd just like to learn why.)
- It used to be impossible to implement securely. Until very recently, there was no hardware support for virtualizing the network buffers, which would mean emulating the network hardware in userspace. This would be very slow.
- Because even today, many devices don't have the required hardware virtualization support. For example, many (most?) ARM devices. If you give direct DMA access, you might be allowing anyone to splatter whatever code they want across whatever memory they want.
- Without kernel arbitration of some sort, there's no way to do load balancing across services, throttle, or firewall effectively.
- The kernel is designed to provide a uniform interface for all programs to the hardware. Putting networking in userspace gets rid of this abstraction, and means that every program has to be aware of the network hardware; software that works with file descriptors directly can't use the same abstraction for files and network.
- Because there are no hardware limitations on the amount of multiplexing. I don't remember how much muxing various hardware supports, but hardware has limits for this sort of thing. If you want more than N processes using the virtual network, you might be SOL with a virtualized userspace network stack.
For the latter, performance concerns would be a bigger issue.
"One could start arguing about it from the historical viewpoint where network packet creation was a holy operation."
Linux has unpriveleged icmp sockets but no one has ever used them apparently - IPPROTO_ICMP eg see [1]
[1] http://stackoverflow.com/questions/14018584/python-with-unpr...
https://lwn.net/Articles/637658/
in which case it sounds awesome!
Linux on a microkernel has been done before. The MkLinux projext is one example, though it also doubled as a port to PowerPC. I haven't heard of any exokernel attempts, though.
More seriously though, you're absolutely right in that it's a step in the direction of an "optional" microkernel architecture. That's actually how rump kernels on NetBSD started: running the kernel file system driver as a library in userspace on top of a FUSE-like subsystem. It's pretty useful functionality, since it allows you to handle untrusted file system images safely in userspace, while not imposing performance penalty on the trusted images which can be handled by the same driver running in the kernel. Unlike with FUSE-specific drivers, you don't run into issues with unsymmetric driver support in userspace vs. kernel.
I've always managed to learn something new from articles, all this to say that today is different... I really do not understand this library at all.
Could someone explain me different possible uses for this library? What would be the uses of this out of the box?
2. This isn't even really LWN content, it's a mailing list post. You can click "Archive-link" to see it on Gmane.
EDIT: I was referring to the kernel support, but it looks like you might have been talking about the code on Github which uses the LibOS API. That does indeed seem to be missing a license.
https://github.com/libos-nuse/net-next-nuse/blob/nuse/COPYIN... (GPLv2, taken from the kernel)