Live data from Hacker News

Building a QNX 7 Desktop

membarrier.wordpress.com

81–90 of 94 posts

Re: Building a QNX 7 Desktop

#81

Nice to see QNX getting some love on HN. QNX is one of the most ground breaking OSs that I've seen in real life and had the pleasure to work with for a good five years as my 'day job'. It was so good that everything else felt (and still feels) both sluggish and cumbersome by comparison. Imagine an OS that never freezes, one that allows you to restart device drivers and upgrade them on running systems. Use remote reso…

> Imagine an OS that never freezes, one that allows you to restart device drivers and upgrade them on running systems.

I'm curious how much of this depends on the driver behaving sanely at load and unload time, cleaning up after itself, gracefully handling unexpected initialization-time state, etc.

Graphics drivers on Linux are a particularly sad example of what I mean - for example while tinkering with an old PC with I-don't-remember-exactly-what onboard graphics chipset a little while ago, I noted how the framebuffer driver boasted that upon unload it would switch back to 80x25 (which it did! :D).

At the other end of the spectrum, while doing some KMS/DRM debugging on my old ThinkPad X61 at one point, unloading the driver would result in a frozen display - but not a frozen system, so my test cycle became "make; rmmod ...; cp .....; insmod ...". It worked absolutely perfectly (with just a ~250ms screen freeze), but it's kind of sad that this inelegance is the current state of affairs.

> Use remote resources as if they are local.

I am particularly frustrated by Linux's lack of IPC in practice. The fact that I can CONFIG_SYSVIPC=y - that that option exists - means nothing: nothing I know uses it, and I have no idea how to use it. OS-level IPC is not common knowledge. It's maddening.

It's sad the best option here is Erlang: that results in "yay message-passing" being restricted to large monolithic systems. I have wanted a message-passing/IPC-based command shell since forever. That's the one thing I wish I knew how to build.

> Control hardware in real time from the same machine that runs your desktop.

:) you know what this reminds me of? The real-world version of Symbolics Lisp machines. With those you could do anything you wanted, literally - they had no MMU, and I think (I might be guessing...) the memory map was static. Not quite Commodore-64, but the same ideas were there.

> So, in about 2 years I wrote a kernel that lifted the userland mostly from minix and linux. Added a network stack and if not for some unfortunate affairs it would have been released as open source.

Very very nice. Hopefully my question is answerable if I phrase it like this: is your code still in use out there, and if so, what sorts of things would I be doing (banking, using electricity, etc etc) if I were indirectly using it?

More directly, if you can actually provide more info about this kernel, I'm very curious.

> In a way I'm happy that never happened because I would have been the slave of the rest of the world maintaining that. It's one thing to push an application into the world, those things have a life-span. But an operating system will easily outlive its creators. (...)

I think I should mention AtheOS here - this was a little hobby x86 OS one guy did in his spare time. Everything, kernel up, all the way to a desktop with applications. Sound, video, I/O... file system... SMP... C++ GUI... POSIX... threads. Took 6 years (1994-2000). https://en.wikipedia.org/wiki/AtheOS

Eventually the project was abandoned, but in 2002 a small group of enterprising developers took AtheOS' GPL'd codebase (\o/) and built Syllable from it: https://en.wikipedia.org/wiki/Syllable_Desktop, https://syllable.org. They tidied up the UI a bit, added USB support and other things, and make slow progress forward.

Now, Syllable is certainly not QNX. But I wanted to say this: the person (or group) who does the sprint and gets to the point of "ok, it's out there now" doesn't have to be the same group that eventually maintains everything. It's an interesting idea to weigh up, because it instantly puts an upper bound on total development time. That time might be years, but 5-6 years is not eg 20 years. (Methinks it'll be interesting to hear Linus reflect on kernel development after he's retired and can say what he really wants to, and can step back far enough to consider all of his ~40+ years of involvement.)

Now, sure, with a "sprint then step back" approach it's impossible that there won't be disappointment and frustration with the way some things end up being done by the new gatekeepers, but if the implementation is sketched out sufficiently well and the time is taken to get the fundamentals (and the thousands of little things) correct, that could well mitigate the worst of that problem.

The reason I say all this is because I noticed https://news.ycombinator.com/item?id=14230456 which pointed to https://lobste.rs/s/ensbd6/building_blackberry_qnx_7_desktop..., which said at the bottom:

> I’m with Animats that it’s surprising that nobody is cloning QNX in these microkernel projects given it’s architecture is open. Past any patent protection, too, if they had any.

Such an approach would bring many benefits.

Being able to pick the license is the clear winner, of course. It would be an interesting nut to crack, because license changes (at least after public releases) are inelegant, and always run the risk of compromising confidence. This would take some interesting discussion: I personally hate the GPLv3, for example, but "GPLv3 or contact us" might be attractive to interests that need to draft a license from scratch (at least ideologically - of course a commercial license template would be filed away).

Another very attractive benefit I see is that everyone would be able to debate the finer points of QNX's existing design as implemented, and debate what parts of the design are worth copying and what should be reconsidered. Benchmarking different workload types as well as collecting anecdotes could be useful here.

I won't deny that QNX as a whole is huge, and that while building rebuilding the kernel in 4350 LOC (https://news.ycombinator.com/item?id=9477947) might be fairly trivial, building everything else (http://www.anandtech.com/show/4266/blackberry-playbook-revie... says the kernel is 100K LOC, I presume this probably includes all the drivers and possibly some of userspace) is going to take, well, a while.

Haiku (https://www.haiku-os.org/) has been in slow development since 2001, and only got to R1 in 2012. So, 11 years - for a small team of enthusiasts.

I guess the next question would be, is an open reimplementation of QNX a sane idea?

QNX is associated with a bunch of different ideas. When you say "open-source reimplementation of QNX that does X, Y and Z," you get to run with the existing context. So, rebuilding QNX could be sane in that regard.

But... Haiku's binary compatibility almost feels like a committee meeting for the sake of meeting now. Haiku is locked to GCC 2.95 (and had to backport a bunch of critical fixes in order for that to be viable), doesn't support BeOS R5 on PPC aka the BeBox (which is understandable, but notable), a bunch of private APIs aren't going to be implemented, and for all that, only a handful of applications work. (https://en.wikipedia.org/wiki/Haiku_(operating_system)#Compa...)

The question is, how set-in-stone are QNX's various APIs - ie, how much of a non-moving target are they, how well-documented is everything, how well-known are the bugs?

Obviously binary compatibility itself would be a good idea for an open-source reimplementation of QNX, there are quite a few more apps for QNX than BeOS. But the kind of apps running on QNX are the kind that you generally want to be able to leave running for a few years knowing there won't be a scheduling glitch anytime soon - the margins with QNX are a lot tigher than BeOS ever was.

:v

I need to go out now and I want to post this now instead of when I get back in a few hours, so I'll leave it there.

I can envisage that redoing QNX might be a "...dude. No. Too much work. Don't go there." in terms of the investment/reward, with all the details taken into account, but I don't know what all the details are, and with the little I do know it sounds like it could be well worth it.

Re: Building a QNX 7 Desktop

#82
post #24

Transparent IPC over the network was the reason I set up QNX a long time ago (back when it was freely available for a bit). I can't help but wonder how a Raspberry Pi Port would fare - the thing would be tremendously efficient, and it would certainly increase their popularity. Edit: well, apparently someone ported QNX 6, but licensing requirements seem to curtail its use for hobbyists - https://github.com/varghes/Ras…

They'll never get it. They could really own the space and be a serious competitor to RedHat. Especially with all the self-driving car research and other real time tasks QNX would rock if it were open source.

Yup. Completely agree. I worked on a project that moved off of qnx because dealing with cost and maintainability issues was too much of a pain.

I don't mean maintainability as in the system itself didn't work. I mean the pain of updating, upgrading, and adding to our system. Maybe the shop I was at just didn't have things set up well, but as a result we were trapped on a specific version of neutrino while trying to interface with modern networked and front end systems. When we can easily upgrade a Linux kernel, apt/yum/pacman install a package, and have more modern versions of our toolchains, it was easy to justify the switch. Not to mention not having to port 3rd party packages we decide to use, which is out of the question for the closed source ones and frankly just a lot of work for the open source ones.

It honestly felt like we were always stepping back 10-15 years in time trying to do something on QNX. And unless there is some hidden community I never discovered in my short stint as a qnx oriented dev, anytime I would stumble upon a forum for qnx stuff it seemed like the last post was from 2008 or so. And don't get me started on their online docs. "Oh this web documentation for is deprecated. Click this link (that dumps you on the front page of multi-page, hard to search HTML docs) to go to the up to date documentation."

It really is a shame too, because their IPC setup was insanely powerful. And I don't think I ever actually experienced an OS crash. The whole OS boiled down to its IPC concept, and that's what made it so cool and so useful: - Kernel module? IPCs under the hood to 'plug in' to the system. - POSIX? Thin wrapper over the IPC stuff. - Need to talk between your processes? Sure you could use sockets or shared memory like Linux, but those QNX IPCs work fine (and I'd argue they were way easier to use, too). - Networked processes? Just use that same IPC setup. - Networked/distributed OS stuff? The OS is built on those IPCs you just networked in the previous bullet.

Re: Building a QNX 7 Desktop

#83
post #14

Earlier quoted context omitted.

> It's what home routers and similar devices ought to be running instead of Linux. The bummer is that it's not FOSS.

Funny there doesn't seem to be an OSS attempt of something like it... ( Or my google-fu is weak )

> "google-fu"

nice combination!

Re: Building a QNX 7 Desktop

#84
post #20

> QNX was cautiously courting the open source concept and venturing in the direction of shared source (with some code already available), when BlackBerry bought them and threw all of that out the window. Biggest yanked opportunity. D: I said that ^ last time QNX got brought up: https://news.ycombinator.com/item?id=12777520 Quick UNix (QUnix, which became QNX "after a brief infestation of AT&T lawyers" - https://news.…

I've gone that road, even had financing lined up for a 'ransomware' style buy-out. Nobody even wanted to talk. Very frustrating. I completely share your sentiment and your vision.

Wow. That's quite something. For the whole OS?! :D

It seems that BB bought QNX for $200M: http://blog.vdcresearch.com/embedded_sw/2010/04/update-2-rim...

If I may ask, I'm very curious (and I suspect others may also be interested in this datapoint) - what sort of ballpark......? And what were you requesting?

Also, I have to admit that I'm unsure what you mean by "'randomware' style buy-out" - the only definition of ransomware I'm finding on Google (searching for "randomware buyout", heheh) throws back info about malware. I'm not as well-versed in business to be able to intuit what you're getting at there :)

You've probably noticed that I also replied to your top-level comment.

Re: Building a QNX 7 Desktop

#85
post #10

That's nice, but sad. Until QNX 6.5, there was a full windowed desktop environment, with the Photon window manager. I used QNX on the desktop when developing a DARPA Grand Challenge vehicle from 2003-2005. Back then, at QNX 6.21, you had the window manager, the Eclipse development environment, Firebird (Firefox before the name change), and Thunderbird. Then QNX marketing cut off the free version, and all the free sof…

> It's much simpler and saner than Windows or Linux.

So true. This is why Genode OS is grabbing my interest these days.

Re: Building a QNX 7 Desktop

#86
post #24

Transparent IPC over the network was the reason I set up QNX a long time ago (back when it was freely available for a bit). I can't help but wonder how a Raspberry Pi Port would fare - the thing would be tremendously efficient, and it would certainly increase their popularity. Edit: well, apparently someone ported QNX 6, but licensing requirements seem to curtail its use for hobbyists - https://github.com/varghes/Ras…

Blackberry Pi?

Re: Building a QNX 7 Desktop

#87
post #24

Transparent IPC over the network was the reason I set up QNX a long time ago (back when it was freely available for a bit). I can't help but wonder how a Raspberry Pi Port would fare - the thing would be tremendously efficient, and it would certainly increase their popularity. Edit: well, apparently someone ported QNX 6, but licensing requirements seem to curtail its use for hobbyists - https://github.com/varghes/Ras…

[deleted]

Re: Building a QNX 7 Desktop

#88

Earlier quoted context omitted.

They'll never get it. They could really own the space and be a serious competitor to RedHat. Especially with all the self-driving car research and other real time tasks QNX would rock if it were open source.

Yup. Completely agree. I worked on a project that moved off of qnx because dealing with cost and maintainability issues was too much of a pain. I don't mean maintainability as in the system itself didn't work. I mean the pain of updating, upgrading, and adding to our system. Maybe the shop I was at just didn't have things set up well, but as a result we were trapped on a specific version of neutrino while trying to i…

Sounds like the OP would have been the guy to help you.

Re: Building a QNX 7 Desktop

#89
post #84

Earlier quoted context omitted.

I've gone that road, even had financing lined up for a 'ransomware' style buy-out. Nobody even wanted to talk. Very frustrating. I completely share your sentiment and your vision.

Wow. That's quite something. For the whole OS?! :D It seems that BB bought QNX for $200M: http://blog.vdcresearch.com/embedded_sw/2010/04/update-2-rim... If I may ask, I'm very curious (and I suspect others may also be interested in this datapoint) - what sort of ballpark......? And what were you requesting? Also, I have to admit that I'm unsure what you mean by "'randomware' style buy-out" - the only definition of r…

> If I may ask, I'm very curious (and I suspect others may also be interested in this datapoint) - what sort of ballpark......?

Well, you already supplied a number. I figured since they had not done QNX any favors they should be happy with a bit of a discount, especially because I did not care for the branding.

> And what were you requesting?

Open source the complete OS as it was available at that time, without the brand. Perpetual license (they'd already done a release-and-retract once before). Other deal parameters to be negotiated.

Anyway, as it is I strongly suspect that QNX will go under with BB at some point, or that it will get sold to the highest bidder in some kind of bankruptcy proceedings. Which likely will be quite a bit cheaper :)

I already wrote one QNX clone for 32 bits, it should not be too hard to make another for 64 bit mode and it would be a lot cheaper too so maybe that's a better way to go about it. It really isn't all that difficult, the fact that it starts off with an extremely simple kernel makes the whole problem far more tractable than it would be for a comparable macro kernel, the scope that needs inspecting to home in on a bug is a very small fraction of what you get with a macro kernel and if a device driver crashes you can simply inspect the core dump of that device driver.

And with VMs as a test bed that job got so much easier.

Re: Building a QNX 7 Desktop

#90
post #81

Nice to see QNX getting some love on HN. QNX is one of the most ground breaking OSs that I've seen in real life and had the pleasure to work with for a good five years as my 'day job'. It was so good that everything else felt (and still feels) both sluggish and cumbersome by comparison. Imagine an OS that never freezes, one that allows you to restart device drivers and upgrade them on running systems. Use remote reso…

> Imagine an OS that never freezes, one that allows you to restart device drivers and upgrade them on running systems. I'm curious how much of this depends on the driver behaving sanely at load and unload time, cleaning up after itself, gracefully handling unexpected initialization-time state, etc. Graphics drivers on Linux are a particularly sad example of what I mean - for example while tinkering with an old PC wit…

Wow, that's quite the comment :)

Ok, from the top:

> I'm curious how much of this depends on the driver behaving sanely at load and unload time, cleaning up after itself, gracefully handling unexpected initialization-time state, etc.

Well, drivers are just processes. So as long as they don't leave the hardware in a totally borked state a re-start of that process should re-initialize the driver and as long as that works I see no reason why the driver would not be able to restart and function.

> It's sad the best option here is Erlang: that results in "yay message-passing" being restricted to large monolithic systems.

And Erlang is soft real-time as opposed to QNX's hard real-time. For non-interactive backend stuff it doesn't matter that much but for front-end or hardware control it matters a lot.

> is your code still in use out there, and if so, what sorts of things would I be doing (banking, using electricity, etc etc) if I were indirectly using it?

I never released other than some very fancy routers where it was used under the hood without anybody being the wiser, but just about every industrial plant runs QNX somewhere, and quite possibly still the 16 bit version on ancient Compaqs.

> I guess the next question would be, is an open reimplementation of QNX a sane idea?

You're asking the guy whose front page post reads 'how to sort 2 tons of lego'? :)

I'm not always the best in making decisions when it comes to what makes economic sense. But I think the world of computing would be a much better place if we went microkernel. Stability and reliability and real time in my book easily trump performance.

> how set-in-stone are QNX's various APIs - ie, how much of a non-moving target are they, how well-documented is everything, how well-known are the bugs?

QNX is incredibly simple at the core. The hard part was to get the interrupt handlers work right, after that it was a walk in the park. But I do recall having a footswitch connected to the reset button because I got tired of diving under the table to reset the machine. No VMs back then...

> Obviously binary compatibility itself would be a good idea for an open-source reimplementation of QNX, there are quite a few more apps for QNX than BeOS.

I would not care about that at all, but I'm sure you could do a ABI layer if you really wanted to.

> "...dude. No. Too much work. Don't go there." in terms of the investment/reward, with all the details taken into account,

Fortunately when I started that trick I didn't know just how hard it was. And eventually QNX did come out with a 32 bit version (2 years later or so).

But an open source version of it would make big inroads into all kinds of embedded systems. But good luck getting the likes of NVIDIA to make a driver.

Post reply on HN