News for hackers. Stuff that matters.
Re:Whatever happened to the Hurd? (2012) by digi_owl on Friday August 26, 2016 @01:28PM (#12367801)
I think QNX is more famous as a real time kernel than a microkernel.
Re:Whatever happened to the Hurd? (2012) by Animats on Friday August 26, 2016 @02:26PM (#12368226)
QNX is a microkernel done right. For three years I used it as a desktop OS while doing real time development. Firebird (a predecessor of Firefox) and Thunderbird ran, so I had browsing and mail. Running QNX on a desktop is a smooth experience. There's no paging, so there are no paging delays. It has real-time responsiveness, so there are none of those brief stalls you get with Unix and Linux.

QNX's problem is the ownership. The business has been sold twice (to Harmon, an audio company, and to RIM/Blackberry). The code has gone from closed source to free version available to closed source to open source to closed source with no free version. Third party developers were so fed up they stopped developing for it. Now QNX no longer supports itself as self-hosted; you have to cross-compile from Windows.

The problem with the Hurd is that they tried to take a big OS, Mach or BSD, and make a microkernel out of it. Mach itself started with BSD and tried to make a microkernel out of it. Wrong approach. You have to start from nothing and build a minimal microkernel.

All QNX has in the kernel is CPU dispatching, memory management, timers, and message passing. Everything else is in user space. To get things started, the boot image can contain user programs which are loaded during boot and then started. That's how the initial drivers and file systems get loaded. For many embedded applications, that's all that gets loaded - there may not be a file system. For bigger systems, the initial drivers are just enough to allow loading more stuff from disk.

It's annoying that nobody else, with the possible exception of the L4 people, seem to be able to get this right. The QNX kernel is only about 60K bytes of code.

Re:Whatever happened to the Hurd? (2012) by jacquesm on Friday August 26, 2016 @03:28PM (#12368703)
QNX is famous as a real time kernel because it is a microkernel.

All the scheduling power of QNX derives directly from having all non-essential code in user processes rather than in the kernel, which does only one thing and does that very well (message passing).

I've re-implemented a 32 bit version of QNX long ago, maybe one day I'll attempt to move it to the 64 bit era if I can figure out a way to automatically convert linux device driver source code to an 'administrator' (QNX parlance for a daemon). That should take the sting out of re-writing each and every driver under the sun.

I strongly believe that Linux not being micro kernel based (and not in a 'minix' sense but a real micro kernel with all services as user processes) is one thing that is currently holding us back.

Many real world interactions require hard real time and with monolithic kernels you are just not going to be able to meet your guarantees.

Re:Whatever happened to the Hurd? (2012) by wolfgke on Friday August 26, 2016 @06:42PM (#12369810)
> Many real world interactions require hard real time and with monolithic kernels you are just not going to be able to meet your guarantees.

Lots of hard realtime systems (e.g. on microcontrollers) use a RTOS where there is even no distinction between user and system mode, thus one cannot even talk about microkernels vs. monolithic. From a software engineering architectural perspective this is not a good design, but it is very fast (thus the time guarantees you can give are smaller) and sometimes easier to guarantee runtime guarantees. And it is easier to write a RTOS where all things run in system mode (which does not imply it is easier to debug bugs or to maintain).

Re:Whatever happened to the Hurd? (2012) by jacquesm on Saturday August 27, 2016 @03:36AM (#12371441)
It is much easier to develop drivers and system processes for a micro kernel because they run in isolation, you can hot re-load any one of them and if it is designed properly you can even upgrade the kernel on a running system without a reboot.
Re:Whatever happened to the Hurd? (2012) by viraptor on Friday August 26, 2016 @06:15PM (#12369680)
What do you think it's holding us back from?
Re:Whatever happened to the Hurd? (2012) by jacquesm on Saturday August 27, 2016 @03:33AM (#12371428)
A much higher level of responsiveness from applications and operating systems. This is hard to quantify but if you've used a system like QNX as your desktop machine the continuous irritation at small 'freezes' of your machine would evaporate, you could control hardware directly from user processes without dedicated CPUs to drive time-critical stuff and so on.

Hard real time seems like a luxury until you've worked with it in practice and then you wonder why it isn't a basic requirement of any half decent operating system.