Pages

Thursday, February 21, 2013

From the car to your phone: How BlackBerry ported over QNX for its new OS It's a real-time operating system and it's the brains behind BlackBerry 10.


By now, you know all about BlackBerry 10, with its myriad gestures, its bustling notifications Hub, and the BlackBerry Balance mode, which separates work-centric applications and accounts from personal ones. You may also be aware that BlackBerry is hedging its bets on these features, which are the main attractions behind the newly overhauled mobile operating system. All of these features are made possible by QNX’s real-time operating system—one that the Canada-based company takes great pride in.
BlackBerry (née RIM) acquired QNX Systems in April 2010 with the intention of gaining a major foothold in the automotive industry. Although QNX has its hand in several automotive projects—the QNX Car Platform 2.0 is featured in the Bentley Continental GT, for instance, and the software has historically been embedded in the control systems of other high-end luxury vehicles—BlackBerry’s focus, for now, remains on its mobile devices, and it’s using this acquisition to hold on to its relevance in the mobile operating system wars.
While BlackBerry 10 still hasn't officially debuted in the United States, we thought we'd take a look at the framework behind BlackBerry 10 and see how the company's acquisition of this real-time operating system has been implemented in its new OS.

It started with the PlayBook

The seven-inch PlayBook was the initial debut of the QNX kernel on a BlackBerry device. It had been designed with a custom user interface to work in conjunction with a tethered BlackBerry handset (the tablet didn't even have its own native e-mail client) but the PlayBook wasn't exactly a bestseller.
Regardless, it was still the beginning of the QNX revolution for BlackBerry and was essentially a test subject for the company to discover how it would move forward with its new acquisition. In October 2011, BlackBerry announced that it would fuse together the best parts of its BlackBerry OS with the QNX operating system featured on the PlayBook. Then-CEO Mike Lazaridis had said that the software, initially dubbed BBX, was intended to make it easier for developers to write applications that work interchangeably on both BlackBerry phones and tablets, and that “the whole company is aligning behind this single platform and single vision.”
PlayBook was a big step in that journey [to BlackBerry 10],” said Sebastien Marineau, senior vice president of QNX Engineering and BlackBerry OS, in a phone interview with Ars. “It was more than just QNX—it was really a reinvention of the software platform for RIM.”

QNX: How does it work?

 The default UI in QNX 6 desktop. 
First released in 1982, QNX is a real-time operating system that is used mostly in the embedded systems market. Over the years, it's been implemented into things like in-car dashboards, medical devices, and routers. QNX employs what is called a micro-kernel architecture, which is decidedly different from software like UNIX, Mac OS, and Windows, which use kernels that are, to a greater or lesser extent, monolithic. With a monolithic kernel, all the traditional kernel tasks, such as the scheduling of processes and threads, the arbitration of access to hardware and the device drivers for that hardware, the provision of file systems, and the enforcement of system security, run in a single shared address space and use the processor's most privileged mode, so if any one of those things crashes, the entire system crashes.
With such a microkernel architecture used by QNX, each of these kernel tasks is broken out into its own address space, and most of them are run in the processor's least privileged mode. With this design, one thing can crash—a device driver, for example—without bringing down the rest of the system. In general, the crashed process can simply be restarted, and operation can continue as normal. This provides greater robustness and protection against programming errors. The operating system itself shares similar APIs and programming methodology with other UNIX and Linux frameworks, but according to Marineau, it was built from the ground up with a different underlying architecture.
Multitasking is something that’s well monitored in BlackBerry 10. As CrackBerry points out, everything runs as an individual process. The thumbnails that are seen on the running applications screen, for instance, use what BlackBerry calls “live covers,” which resemble something like widgets on the Android operating system. Most of the time they’re just intermittently grabbing data in the background—like the Gallery app, for instance, which refreshes every so often with a slideshow of the latest photos. When the frame goes out of view, the app is still running, but it isn't rendering anything to the screen because it's rendering to something else.
To keep them from running rampant, however, BlackBerry has included “knobs” in the operating system that put a container around each individual application so that it can continue to execute where it makes sense, while balancing that with power and CPU consumption. If an app wants to run in the background, the developer can request permission from within the app, but only within a finite CPU budget. This is all to prevent any application from being too aggressive and exhausting the battery. In some cases, apps are frozen in a “ready to run” state.
In spite of being used in a wide range of custom applications, QNX is not open source. BlackBerry does offer up portions of its frameworks for others to tweak, but they are typically things that its customers can take to modify and adapt them to various hardware. BlackBerry has also spent time evolving the software so that it's not tied down to particular hardware; this way, it can easily run on different form factors. "We've spent a lot of time abstracting the operating system and the applications from the hardware, which means we can take the same software platform and the applications and run them on a variety of different processors, different form factors, and so on," explained Marineau. He later used the aforementioned Bentley as a prime example of this. "[It] runs an automotive stack, QNX car, which probably shares 90 percent of the code and the lineage with BlackBerry 10 on a handset." All that needed to be tweaked was the user interface.
"The whole ubiquitous computing vision that we all share...is really easy to do when you have the same software running on a handset, on a tablet, in a car," Marineau said. He then added that BlackBerry's user base has always tended to be very focused on communication, efficiency, and getting things done very quickly. While that may still hold true, our biggest hope for BlackBerry yet is that BlackBerry 10 takes off so it has a chance to eventually execute that ubiquitous computing dream.

No comments:

Post a Comment

Let us know your Thoughts and ideas!
Your comment will be deleted if you
Spam , Adv. Or use of bad language!
Try not to! And thank for visiting and for the comment
Keep visiting and spread and share our post !!
Sharing is a kind way of caring!! Thanks again!