Sunday, February 20, 2011

Playing With The BlackBerry Playbook Simuator

So I have downloaded the BlackBerry PlayBook Simulator and I am currently playing with it.   What has really peaked my interest in the BlackBerry PlayBook is the fact that it uses QNX.   For those of you who haven't heard of QNX, it is a "commercial unix-like real time operating system aimed primarily at embedded systems", Wikipedia Entry.   QNX, is currently primarily used for systems that need real-time capabilities (automative, industrial, security+defense, etc..) and markets that may have mission critical needs with OS that needs high availability.   So basically its used places, that the OS just has to work, and literally work all the time (almost no down time), the like OS your car's computer runs, the OS needs to handle things very well and get them right; cause the chance of being down or unavailable, might cost someone their lives.   So in these cases we need a really reliable and highly available OS that can process events in real time.

So the question is, a tablet isn't really a mission critical device or has the need for a real time operating system.   Will something like a tablet that is meant fo the CE industry really benefit from having a real time operating system.  Just like anything in life there are trade off's, and we might soon see what the down side is of a real time operating system in a tablet.   Only time will tell; given that BlackBerry and QNX might have made heavy customizations or no customizations since QNX is said to be a light weight OS.  White Paper on QNX Architecture .  Some of the main features of QNX as stated by QNX marketing QNX

Realtime

The QNX Neutrino RTOS provides deterministic response times at the application level and in all subsystems. Thread priority inheritance eliminates priority inversion problems.

Self-healing systems

Thanks to the microkernel architecture of the QNX Neutrino RTOS, virtually any component — even a low-level driver — can fail without damaging the kernel or other components. What's more, failed components can be restarted quickly and intelligently.

Adaptive partitioning

With the QNX Neutrino RTOS, spare CPU capacity is used when available. If resources are constrained, processes get their budgeted share. If, however, a system has spare cycles, processes can exceed their budget limits.

High availability

If a device driver, protocol stack, or application experiences a problem, it does not take other components down with it. The QNX Neutrino RTOS high availability manager can terminate and restore the faulting component in isolation — often in just a few milliseconds without a reboot.

Networking

Supported networking technologies include IPv4, IPv6, IPSec, FTP, HTTP, SSH and Telnet. Unique transparent distributed processing enables an application to access resources on any node in a network for seamless peer-to-peer resource sharing.

Filesystems

QNX filesystems execute outside the microkernel in memory-protected user space. Developers can start, stop, or upgrade filesystems on the fly without having to reboot. Multiple filesystems can run concurrently on the same target and even work in concert to extend one another's capabilities.

Portability

Extensive support for POSIX standards facilitates application portability and rapid migration from Linux, Unix, and other open source programs.
Runtime support and BSPs for popular chipsets, including ARM, MIPS, PowerPC, SH-4, and x86, lets designers select the best hardware platform for their embedded system, then quickly get their systems up and running.

So on the PlayBook, QNX handles all the low level stuff, and the Application things seems to handled by Adobe Air.   I don't know Air at all, but looking through the .as files, it seems pretty easy to pick up.  I am that writing in it will be cake walk.  However writing, really innovating, groundbreaking, apps and games; that has yet to be seen.

So the Playbook simulator, really only comes with one app installed, the browser.  There might be more apps in the sdk that blackberry has provided; samples or something.   The Playbook Simulator is basically a vmware image.   Which is cool, a little more heavy and intensive on the system than lets  say the iOS simulator but its all good.

I was really interested more in QNX than the Adobe Air.  My current dev environment of the PlayBook is 3.06 Ghz Core 2 Duo MacBook Pro.   BlackBerry did it right and supported 3 major dev environments, Windows, OS X, and Linux.

PlayBook Simulator and SDK Installation:
Follow the instructions on the blackberry website Simulator and SDK Installation

Some screen shots of the simulator.









































Being curious about QNX I tried to use VMDKMounter (located in /Library/Application Support/VMware Fusion - comes with VMware Fusion for OS X) a tool to mount VMDK files on OS X, so I could explore the QNX OS.  Unfortunately the file system was not recognized and even tried to install MacFuse.

So on the BB forums, I found an thread where people were able to SSH to the Playbook Simulator.  SSH to Playbook.  So on the OS X to find blackberry-connect just look in {$BB_SDK_INSTALL_DIRECTORY}/bbwp/blackberry-tablet-sdk/bin















You'll need to generate an RSA public/private key using "ssh-keygen -b 4096".  It runs straight from the command line.  I called my keys temp_key1, temp_key1.pub.















To find your BB simulator ip address just go to Settings->About, it will be in there.  Next you can then use blackberry-connect to connect to the system.  Then port 22 on the simulator will be open for you to ssh.  You can also change the password on the simulator, I changed it to "h", not sure but the default might be "x"; you can do it through the settings in the simulator.  So now you can run the command with the public key (temp_key1.pub in my case).

./blackberry-connect -targetHost 172.16.11.128 -devicePassword h -sshPublicKey temp_key1.pub















So now keep that window running.  Just create another terminal window, and then ssh to it.   So the blackberry-connect passed in our public key.   Now we can ssh to the blackberry simulator using our private key.  SSH using devuser.

ssh devuser@172.16.11.128 -i temp_key1















BAM! SSH access to the BlackBook, can now play around, look at all the commands and hopefully somehow figure out how to gain root access.