Live data from Hacker News

QNX is now free for anything non-commercial, plus there's an RPi image

blackberry.qnx.com

81–90 of 380 posts

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#81

With all due respect, I’ve never spent so long clicking through a website trying to figure out what it actually was. What is QNX haha

QNX is a microkernel-based real time operating system. The kernel is tiny; it was about 60KB (not MB) twenty years ago. All the kernel does is message passing, timers, CPU dispatching, and memory allocation. Everything else is in user space, including file systems.

Everything is a message, rather than being a file. Messaging works like a function call - you send a block of data to another process, wait, and get a reply back. Processes which receive messages act like servers - they have a thread or threads waiting for incoming requests, and when a request comes in, it's handled and a reply is sent back. It's a microservices architecture.

Unlike Linux, it's a fast microservices architecture. Message passing and CPU dispatching are integrated. When a process sends a message to a service process, the sender blocks. (Timeouts are available.) If the service process isn't busy, control immediately transfers to the service process without a trip through the CPU dispatcher. When the service process replies, the reverse happens, and control goes back to the original sender. With most inter-process communication systems, there's queuing delay for this kind of operation. QNX got this right. This is the core insight behind QNX.

Yes, there is message passing copying overhead. In practice it's under 10%. I've sent video through the message system. Copying is less of a problem than you might expect, because, with today's large CPU caches, the data being copied is probably warm and in cache.

All this is real-time aware. Higher priority processes get their messages through first. If you call a service, it inherits the caller's priority until it replies. This prevents priority inversion, where a high priority process calls a low priority one and gets preempted by lower priority work. This works so well that I was able to do compiles and web browsing on a single-CPU machine that was also running a robot vehicle.

There's a tool for building boot images. You put in the kernel, a standard utility process called "proc", and whatever else you need available at startup. For deeply embedded systems, the application might go in the boot image. It's all read-only and can execute from ROM if needed, which is good for applications where you really, really want startup to always work.

Files and file systems are optional. For systems with files, there are file system and disk drivers to put in the boot image. They run in user space. There's a standard startup program set that creates a Unix-type environment at boot time. This is all done in user space. The file system is accessed by message passing.

System calls look like POSIX. Most of them are implemented in a library, not the kernel. Service processes do the work. When an application calls POSIX "read", the library makes an interprocess function call to the file system or network service server. Program loading ("exec") is done in user space. The boot image can contain .so files. "Exec" is done by a .so file that loads the image. So the kernel doesn't have to worry about executable format, and program loading is done by untrusted code.

Because it uses POSIX, most command line UNIX and Linux programs will compile and run. That's QNX's big advantage over L4. L4 is a good microkernel, but it's so stripped down it's just a hypervisor. Typically, people run Linux on top of L4, so all the bloat comes back.

There is no paging at the OS level. That would kill real-time. There's a paging to disk library that can be used by programs such as compilers with big transient memory needs, but most programs don't use it. The effect is that responsiveness is very consistent. I miss using QNX desktop. There's no lag.

So that's an overview. Microkernel done right.

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#83
post #45

If only you could believe them. QNX has been "opened" twice before. Each time, there was a rug pull, and it went closed again. Before the first rug pull, open source groups routinely added QNX to their target list. There was a Firefox for QNX. Eclipse had QNX as a target. GCC and most of the Gnu command line tools could be built for QNX. There was a desktop environment, Photon. I used that as a primary desktop for th…

Even getting the licensing right isn't sufficient. They could license it as MIT today, close source it again tomorrow, and within a few releases no one would be using the MIT version.

Unless someone is interested in maintaining a full fork. It's the same reason Google can do whatever they want with Chromium even though it's technically open source. No one else has the resources/will to maintain it so there's no credible threat of a fork.

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#84
post #70

Earlier quoted context omitted.

They are the brains of a ton of cars on the market, like all Ford cars. Used for complex calculations like automatic transmissions.

> They are the brains of a ton of cars on the market, like all Ford cars. Used for complex calculations like automatic transmissions. I would seriously doubt that QNX or anything like it resembling a "real OS" is running on the automatic transmission. If the transmission controller is running any OS at all it's likely a microcontroller running a much more specialized RTOS. QNX is very common in automotive application…

> Ford's "Sync 3" and "Sync 4/4A" infotainment systems run on QNX as well, though being just infotainment they didn't really care about the realtime aspect (though I'm sure stability was a big thing compared to their Windows CE based predecessors).

I've got a Sync 2 car, and I can't say I've noticed instability. The UI toolkit is slow, but the story on that is someone's cousin did something some Macromedia stuff that barely worked and they shipped that. I've got some issues with GPS offset, but that's pretty stable. I had worse stability with the Chrysler UConnect in my 2017 Pacifica, and that was reportedly based on QNX; it would sometimes crash and restart, or the screen would not come on at all unless you knew the magic buttons to hold to force reboot.

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#85

Oh cool, does this also include the unfortunately discontinued desktop version of QNX? I've always wanted to try out a real time OS

Why not real-time Linux? It's even been accepted into mainline now.

Is that a true RTOS though? I thought it was only a partial implementation

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#88

To add some details - the source code for QNX was available from 2007 until the takeover by RIM/Blackberry in 2010. So do you plan to offer access to QNX source code again in the future? https://www.qnx.com/news/pr_2471_1.html

Don't hold me to timelines, but we're definitely headed in the direction of being more open and transparent. We're hearing that this is important to our customers and the community alike. Stay tuned!

You are not John "patent troll" Chen right? Your ceo suck

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#89
post #45

If only you could believe them. QNX has been "opened" twice before. Each time, there was a rug pull, and it went closed again. Before the first rug pull, open source groups routinely added QNX to their target list. There was a Firefox for QNX. Eclipse had QNX as a target. GCC and most of the Gnu command line tools could be built for QNX. There was a desktop environment, Photon. I used that as a primary desktop for th…

Also I wonder how many applications really need more real time responsiveness than you can get out of Linux. We even have

https://arstechnica.com/gadgets/2024/09/real-time-linux-is-o...

If I use Linux I know I won't have to have a discussion about licensing, I know I won't get rug pulled, etc.

Also the ban on commercial use is heinous. I am going through this with Arangodb right now. I love the product, but I have no budget for a cloud instance they manage and I have no budget to talk with their sales people about a commercial license. I have several systems that use it (including one that's about 80% of a way to a "too big for free" database) and I don't know if their fate will be (a) open sourcing, (b) a product or (c) a system that makes money for me directly but for me the short path is to switch to postgres, not talk to people whose business model doesn't necessarily allow my business model.

Re: QNX is now free for anything non-commercial, plus there's an RPi image

#90
@JohnAtQNX can you remove the "everybody needs an account" restriction from your website downloads, and also remove the license mechanism from qcc? That would go a long way towards encouraging hobbyists to try it out.

Your money comes from high-volume licensing deals, where you presumably get a per-unit license fee. That revenue stream is jeopardized by pissing off the CI/CD teams that have to support QNX product lines.

Post reply on HN