Thursday, May 5, 2011

QNX, Native Binaries, and the BlackBerry PlayBook...

So as you may already be aware of, RIM just released their take on how tablets should be, also known as PlayBook. The PlayBook currently runs QNX as it's operating system, with which its apps are currently built in conjunction with the Adobe AIR 2.5 SDK. Just recently at the BlackBerry World Conference, the native SDK was unveiled (it was previously seen with their Quake 3 port).

Personally, I see the Native SDK as the most interesting, as it allows one to use the device to its full potential alongside its realtime operating system (RTOS), so I started to do some digging. I poked around with the simulator for a bit, when @stroughtonsmith suggested I download QNX's desktop environment, otherwise named the Neutrino SDP (software development platform). What's interesting here, is the fact that it's equipped with an arm cross-compiler. What this means, is that one can already create native applications for the PlayBook, which end up being very similar to those produced with the native SDK, as well as being sandboxed.

So after installing QNX from the DVD (can be to a virtual machine, or an actual desktop), boot it up, and login as root (no password is needed). Afterwards, simply write up an application in C/C++, and, when ready to compile, invoke the cross-compiler like so (help info here):
qcc -Vgcc_ntoarmle -o nativeapp nativeapp.c

To actually get this compiled application on the device, however, does require a little extra legwork... With the AIR SDK, we're given the ability to SSH into the device as "devuser", with Developer Mode enabled. First off I copied the compiled binary to the downloads folder (plug in the PlayBook, and access its shared folders). Now, even though this is on the PlayBook, it's unusable, since it doesn't have the proper permissions. Since devuser is sandboxed and limited, it can't set permissions. However, you can get around this by first setting the binary as executable, and then zipping it up:
chmod +x nativeapp
zip nativeapp.zip nativeapp

Once you've copied that zip over to the downloads folder, copy it to somewhere on the device and unzip it (I used /tmp). From there you can run the binary!

I do recommend that you guys check this out, give it a go, and at the same time, get a little practice in before the Native SDK's release. Let me know how it goes! QNX is looking to be an awesome system to develop with!

Download the Source here.
Download the Binary (zipped) here.


7 comments:

  1. Excellent find, I've been doing some digging along these lines myself recently.

    ReplyDelete
  2. Great work! I didn't know about the qnx compiler at all. You can actually use scp to transfer files over too which might make it a bit quicker.

    If anyone is interested in working on rooting/jailbreaking the playbook, I'm trying to organize an irc channel to share progress. Check out #playbook-root on irc.freenode.net.

    ReplyDelete
  3. Good Job!
    Btw I want to be a native app programmer. I know little bit of C/C++ and woud really need a beginner guide for c/c++ development until professional programming. I would really love it if someone would guide me with links and step by step guide with pdfs whatever so I can participate. I might also invest in this platform so I am really serious about it.
    Anyone who would like to help please send whatever to my email khd4ever@gmail.com thanks in advance!

    Btw, I found that there is a full VLC client for QNX and the source code is available in http://www.videolan.org/vlc/download-sources.html

    ReplyDelete
  4. Great work. Have you looked to see if the headers and libs can be pulled out of the QNX install (and/or off the Playbook) so code can be cross-compiled directly rather than from inside a QNX VM. (Downloading QNX now to look myself)

    ReplyDelete
  5. I set up a wiki and repo here:

    https://github.com/Proberts/TabletOS-Unofficial-Native-SDK/wiki/TabletOS-Unofficial-Native-SDK

    Please contribute! Let's all get a head-start on native Playbook development!

    ReplyDelete
  6. awesome job proberts9999! And there are SDPs available for Windows and Linux (no Macintosh support yet), so you can use those without the VM if you wish.

    ReplyDelete
  7. hi i need normal root or devuser console or terminal or ssh client
    i see that all packages is in file system
    can you help me to run console or terminal
    because its really to use it like unix terminal
    but i havent some packages
    please help Adam

    ReplyDelete