News for hackers. Stuff that matters.
Re:L4 microkernels: The lessons from 20 years of research an... by Animats on Tuesday September 20, 2016 @02:41PM (#12542074)
The paper doesn't mention QNX at all. QNX is similar to early L4, but they've taken slightly different paths.

L4 got rid of "long message passing", in favor of shared memory and interrupt-like IPC. This is great for the kernel - no copying delays and no buffering problems. But it means that communicating processes have to share some memory pages and cooperate properly. If the shared memory page is something like a chain of linked buffers, one side may be able to screw up the other side. If that's how you talk to the file system, it may be possible to attack the file system process that way. This won't crash the kernel.

Because L4's API is so limited, it's used mostly as a VM, with the usual bloated Linux kernel on top. QNX has only a few more kernel features than modern L4, but it can implement the POSIX API with just support in the C library. When you call "write()" from C/C++ in QNX, the C library makes a MsgSend request which is directed to a file system service, device service, or network service. The code for this is tiny. When you call "write()" from C/C++ on L4, you're usually just making a Linux system call to an ordinary big Linux in a VM. Eventually that Linux talks to other processes which do the physical disk I/O. The problem is that the giant Linux kernel is still there, just a bit more isolated from the hardware. The total amount of code that can break has not been reduced significantly.

Re:L4 microkernels: The lessons from 20 years of research an... by cvwright on Tuesday September 20, 2016 @06:03PM (#12543792)
There are efforts to build OSes directly on L4 kernels as well. Most notably Genode. http://genode.org/

They recently added support for running on seL4 too: https://sel4.systems/pipermail/devel/2016-August/000967.html

Re:L4 microkernels: The lessons from 20 years of research an... by tptacek on Tuesday September 20, 2016 @04:39PM (#12543180)
L4 can be used that way, but in purpose-built systems it can also just be used as a simple stratum on which to build applications directly. If you were using L4 to build a baseband package, for instance, you probably wouldn't run a full OS on top of it.

My intuition, not carefully checked:

I'd rather be using QNX than Linux on L4, but I'd rather be using just L4 than QNX.

Re:L4 microkernels: The lessons from 20 years of research an... by derefr on Tuesday September 20, 2016 @02:50PM (#12542154)
How do these compare to Mach IPC in OSX?
Re:L4 microkernels: The lessons from 20 years of research an... by Animats on Tuesday September 20, 2016 @03:26PM (#12542506)
Here's a Linux/L4/QNX comparison.[1]

My favorite table:

    Kernel         Source Lines of Code (SLOC)

     OKL4                 13.8k
     QNX Neutrino v6.3.2  23k
     Linux Kernel 2.6.0   5.2M
     Windows XP           Kernel size unknown but totals at approx 40M
     Windows Vista        Kernel size unknown but totals at approx 50M
Modern microkernels are so small that they can be thoroughly debugged, or formally verified.

[1] http://www.gelato.unsw.edu.au/IA64wiki/JamieLennox/QNXvL4?ac...

Re:L4 microkernels: The lessons from 20 years of research an... by ori_b on Wednesday September 21, 2016 @01:07AM (#12545557)
On a related note, QNX was open source for a while, before it was bought by Blackberry. Do you know if anyone managed to snag a copy of it?
Re:L4 microkernels: The lessons from 20 years of research an... by pjmlp on Wednesday September 21, 2016 @03:36AM (#12546123)
It was available for free on a floppy, but never open source.
Re:L4 microkernels: The lessons from 20 years of research an... by wolfgke on Wednesday September 21, 2016 @09:36AM (#12547997)
It was never open source in the sense of the OSI (Open Source Initiative) definition, but the source code was available to the public for a while:

> https://en.wikipedia.org/w/index.php?title=QNX&oldid=7308275...

"In September 2007, QNX Software Systems announced the availability of some of its source code. [http://www.qnx.com/news/pr_2471_1.html]

On April 9, 2010, Research In Motion announced they would acquire QNX Software Systems from Harman International Industries. On the same day, QNX source code access was restricted from the public and hobbyists."

Re:L4 microkernels: The lessons from 20 years of research an... by ori_b on Wednesday September 21, 2016 @10:27PM (#12553892)
Exactly this -- So, someone must have grabbed a copy of the source at that time, and I'd love to have a read through it one day.
Re:L4 microkernels: The lessons from 20 years of research an... by Animats on Wednesday September 21, 2016 @01:12PM (#12550165)
Yes, and much of the QNX development community abandoned QNX when they did that.
Re:L4 microkernels: The lessons from 20 years of research an... by pawadu on Wednesday September 21, 2016 @04:15AM (#12546308)
Kind of off-topic, but where can I find the OKL4 source code?

All I have found is a really old version that doesn't seem to have much in common with the current one.

Re:L4 microkernels: The lessons from 20 years of research an... by bicolao on Wednesday September 21, 2016 @05:31AM (#12546632)
This is from 2015, not sure if it's that old.

https://github.com/tomga/genode/commit/c8a64b5c3465cde1723b2...

Re:L4 microkernels: The lessons from 20 years of research an... by pawadu on Wednesday September 21, 2016 @06:03AM (#12546773)
I think the latest version is 5 or 6. The one you pointed to seems to be pretty old:

    OKL4 Release 2.1
    ================
    
    Date: 15 April 2008
Re:L4 microkernels: The lessons from 20 years of research an... by nickpsecurity on Tuesday September 20, 2016 @03:12PM (#12542370)
L4 was created partly due to how much Mach failed in performance and such. The first generation by Liedkte was something like 5 times faster in overhead than Mach solutions hosting Linux. I haven't timed the recent ones but there's numbers of Mach vs L4 in here:

http://ts.data61.csiro.au/publications/papers/Heiser_10:iids...

Re:L4 microkernels: The lessons from 20 years of research an... by rayiner on Tuesday September 20, 2016 @04:27PM (#12543075)
Note OS X mostly doesn't use Mach IPC for anything. Calling, e.g., write() results in a system call into the BSD portion of the XNU kernel, not all that different from what happens on Linux.
Re:L4 microkernels: The lessons from 20 years of research an... by simscitizen on Tuesday September 20, 2016 @06:45PM (#12544020)
That is completely untrue. While the BSD syscalls are supported, Mach syscalls and Mach IPC are also heavily used, especially internally at Apple.

Just one simple example: run "sample <process>" (where <process> is any Cocoa application) on OS X. Pretty much every thread will have an event loop powered by CFRunLoop, and they'll all be stuck in mach_msg_trap waiting for an event to occur.

Also, pretty much any sort of semi-complicated IPC on OS X is done over Mach IPC (e.g. passing a large bitmap copy-on-write from one process to another). Take a look at the ipc directory in the Chromium source, for example.

Re:L4 microkernels: The lessons from 20 years of research an... by rayiner on Tuesday September 20, 2016 @09:42PM (#12544846)
Yes, I'd assume it's more heavily used in the higher-level application layer. I was talking about basic UNIX functions.
Re:L4 microkernels: The lessons from 20 years of research an... by swolchok on Tuesday September 20, 2016 @10:30PM (#12544991)
Even Unix signals are delivered as Mach exceptions first. If the process doesn't have a Mach exception handler set up, the kernel's exception handler converts them to Unix signals and tries delivery that way: https://github.com/opensource-apple/xnu/blob/27ffc00f33925b5... and https://github.com/opensource-apple/xnu/blob/27ffc00f33925b5...
Re:L4 microkernels: The lessons from 20 years of research an... by tptacek on Tuesday September 20, 2016 @05:02PM (#12543396)
OS X doesn't use Mach IPC to emulate POSIX, but it uses (or did last I checked, which was a while ago) Mach IPC directly for things like launchd.
Re:L4 microkernels: The lessons from 20 years of research an... by indolering on Wednesday September 21, 2016 @03:52PM (#12551629)
I would really love to see more commentary from high-level systems people on how suitable SEL4 is as the basis for a general purpose OS. It seems like it's security guarantees would be driving a lot more outside investment than it has received.