Developing on the Nokia N800 Internet Tablet
Posted: June 28, 2007 Filed under: NEZzen Leave a comment »One of the best features of the Nokia N800 Internet Tablet is that it runs Linux – and Debian GNU/Linux at that! This makes it great for being able to develop your own homebrew applications to run on it. Nokia acknowledges this fact and provides an online community and SDK for their Maemo and Scratchbox development environments. Without these, this tutorial would not be possible.
Note: This tutorial is written using Maemo 3.2 “Bora”. Version 3.1 will be installed first and then upgraded to the latest.
The first step to developing on the N800 is to install the Maemo SDK on your computer, but before that you will need to install Scratchbox (a cross-compilation toolkit for embedded Linux development) so that the Maemo SDK has a “fake” N800 to run on.
Enter the following commands to download and install Scratchbox 3.1 on a Debian-based Linux system (such as Ubuntu). You will need to have certain basic Unix utilities already available, as well as an Internet connection.
$ wget http://repository.maemo.org/stable/3.1/maemo-scratchbox-install_3.1.sh
$ chmod +x ./maemo-scratchbox-install_3.1.sh
$ sudo ./maemo-scratchbox-install_3.1.sh -d
After Scratchbox installs itself, we will need to set up user accounts and then restart your login shell. Replace “brian” with your username. (Note: If you are running in an X11 session, you will have to logout/login.)
$ sudo /scratchbox/sbin/sbox_adduser brian yes
$ logout
Now that Scratchbox is installed and configured, you can proceed with installing the Maemo SDK.
$ wget http://repository.maemo.org/stable/3.1/maemo-sdk-install_3.1.sh
$ chmod +x ./maemo-sdk-install_3.1.sh
$ ./maemo-sdk-install_3.1.sh
During this process you will be prompted to review and accept the licensing terms of the Nokia Maemo SDK.
For some reason, Maemo doesn’t properly set up networking, so we have to manually configure our nsswitch.conf file.
$ su
Password:
# echo "hosts: files dns" > /scratchbox/etc/nsswitch.conf
# exit
Now that networking is configured, we need to ensure that the Scratchbox enviornment has the most up-to-date packages installed.
$ /scratchbox/login
Welcome to Scratchbox, the cross-compilation toolkit!
Use 'sb-menu' to change your compilation target.
See /scratchbox/doc/ for documentation.
[sbox-SDK_X86: ~] > apt-get update
[sbox-SDK_X86: ~] > sb-conf select SDK_ARMEL
[sbox-SDK_ARMEL: ~] > apt-get update
To describe the above a little more, here is what’s happening. The first command will put you into the Scratchbox environment. You are greeted with a welcome message and a command prompt starting with “sbox” and the target architecture.
The next command updates apt (the package manager) with the latest package information from the internet. You then switch into the ARMEL architecture with the third command (notice the prompt changes), and update apt there too.
Since we are going to need a simulated N800 to develop on, we have to install the Nokia-licensed packages in our Scratchbox.
[sbox-SDK_X86: ~] > fakeroot apt-get install maemo-explicit
[sbox-SDK_X86: ~] > sb-conf select SDK_ARMEL
[sbox-SDK_ARMEL: ~] > fakeroot apt-get install maemo-explicit
After the lines that invoke apt, you will need to enter y (for “Yes”) to run through the installer.
The SDK you have installed right now is version 3.1. As of writing, the latest is version 3.2, which can only be obtained via an upgrade from within version 3.1. Here is how to upgrade to version 3.2 of the SDK. You should notice how similar it is to the previous steps.
$ wget http://repository.maemo.org/stable/3.2/maemo-sdk-nokia-binaries_3.2.sh
$ chmod +x ./maemo-sdk-nokia-binaries_3.2.sh
$ ./maemo-sdk-nokia-binaries_3.2.sh
$ /scratchbox/login
[sbox-SDK_X86: ~] > apt-get update
[sbox-SDK_ARMEL: ~] > PAGER=less fakeroot apt-get dist-upgrade
[sbox-SDK_X86: ~] > sb-conf select SDK_ARMEL
[sbox-SDK_ARMEL: ~] > apt-get update
[sbox-SDK_ARMEL: ~] > PAGER=less fakeroot apt-get dist-upgrade
You have reached a breathing point in this long process. The Maemo SDK should now be installed and ready to go! However, you may be wondering how you will be able to “see” what the user of an N800 is seeing. The next few steps demonstrate how to install and set up a special Xnest server on a Debian-based Linux distribution.
First you will need to install the Xephyr server with the following command. (Note: This assumes it is already in your distribution’s apt repositories.)
$ sudo apt-get install xserver-xephyr
You can launch the Xephyr X-server in an N800-compatible resolution with the following command. You may add an & symbol to the end of the command to fork Xephyr into the background.
$ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac
Now I will show you how to start your “virtual” N800′s Application Framework.
$ /scratchbox/login
[sbox-SDK_arch: ~] > export DISPLAY=:2
[sbox-SDK_arch: ~] > af-sb-init.sh start
Ta-da! You now have the perfect environment to begin developing application on the Nokia N800 Internet Tablet.
I hope you have enjoyed my tutorial, which is based off the the Install Notes included with the Bora release. If you find any errors in my writing, please leave a comment.