15 December 2007

wxGTK working on Maemo

Reading the official WxWidget blog, I discovered that one of their developer was working to hildonize WxWidgets. I wanted to know if that was just a test or if this library could work in Maemo, so I followed his suggestion and I grabbed the latest SVN sources:

svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets

and I compiled it in this way:

cd wxWidgets
./configure --with-hildon
make
make install


then I grabbed a simple "HelloWorld" from the official documentation. You can find the complete source code here.

I compiled the source code in this way:

g++ hworld.cpp `wx-config --libs` `wx-config --cxxflags` -o hworld

then I ran it in the usual way:

run-standalone.sh ./hworld

The result? I think that a screenshoot is better than thousand words :)


N.b: I tested this inside Scratchbox, using CHINOOK_x86 target, so I think it will work fine on Os2008. This could be a good thing to help other developers porting some interesting applications (uhm... aMule for example ;) ) to Maemo.

14 December 2007

Nokia N810 available in Italy!

For the joy of all italian people, the internet tablet Nokia N810 is available in the italian Nokia shop.

You can find it here. The price is 459 €.

N.b: the discount code doesn't work yet.

13 December 2007

Lower price for N800 in Italy...maybe N810 coming closer?!

I was looking in the Italian Nokia official shop, and I noticed that the N800 price was decreased to 259 € instead of 289 € You can verify it on the official website.

Maybe the N810 is coming closer? Who knows ;)

10 December 2007

Skype on N770 (using Os2007 HE)

Great news for all N770 users! Someone discovered that is possible to make Skype run on N770 with Os2007 HE.

All you have to do is follow these steps:

1. Install skype-ui through Application Manager

2. Download this package in your PC and extract the file named skyhost

3. Find a way to copy the file skyhost to your maemo device in /usr/bin

4. execute this from root on your device: chown user:users /usr/bin/skyhost

That's all! You can find more information on the original post.

20 November 2007

Alternative way to generate .deb packages for Maemo

Thanks to Mohammed Hassan now I know an alternative (alternative to the official howto) way to generate a .deb package for Maemo.

If the package already exist in the Debian repositories, you can get the .dsc file (for example in an ftp like this: http://ftp.debian.org/debian/pool/non-free/s/spim/ ) and execute the following commands:

dget -x DSC_FILE_URL

It will download the package and will unpack it in the current folder. You have to enter in the created folder and edit the debian/* files to personalize settings, mantainer data, add deps ecc...

When you're done, you can generate the package with the usual command:

dpkg-buildpackage -rfakeroot

16 November 2007

Installing qemu-arm-eabi patch into Scratchbox

Using Scratchbox and in particular the Maemo SDK with ARMEL target, very often when we try to execute some application we can get into this kind of errors (for example):

sem_post: Function not implemented

This happens because not all the functions have been implemented in the emulated environment. Lauro VenĂ¢ncio has created a patched version of qemu-arm called qemu-arm-eabi.

Thanks to Marcelo Lira, we have a simple howto to install the patch into the Scratchbox environment. Note: you have to execute these commands from outside the Scratchbox environment and you should not be logged into the environment at the same time.

1. You need gcc 3.4, SDL dev library and Zlib dev:

sudo apt-get install gcc-3.4 libsdl1.2-dev zlib1g-dev


2. Get the patched qemu-arm. Notice that the patches are already applied, everything is here, and you don't need to get the qemu sources.

svn co https://qemu-arm-eabi.svn.sourceforge.net/svnroot/qemu-arm-eabi qemu-arm-eabi

cd qemu-arm-eabi

./configure --target-list=arm-linux-user --static

make

3. Copy qemu to the cputransp dir on scratchbox

sudo cp arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2


4. Add it to the list of cputransp methods. Open the file

sudo vim /scratchbox/devkits/cputransp/etc/cputransp-methods


and add this line:

qemu-arm-eabi-sb2

5. Configure the target to use the patched qemu as transparency method. Edit the file:

vim /scratchbox/users/USERNAME/targets/CHINOOK_ARMEL.config


and change this line:

SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2



That's all! You're now ready to log again into your Scratchbox environment

The UNOFFICIAL way to get Os2008 into Nokia N800

Since Os2008 for N810 is out, a lot of people were asking about the possibility to install it on their N800. Nokia will relase Os2008 for N800 too, but at the moment they don't offer the possibility to download it since the N810 firmware it's not 100% compatible with the old N800.

The only way to download a Nokia tablet firmware is being the owner of a tablet. The user has to enter it's own MAC-address to be able to download the file. To download a N810 firmware you need to have a valid N810 MAC-address.

A post on News.com describes the exact procedure to follow if you want to try this in your N800:
  1. Go to the N810 software download page.
  2. Enter the serial number for a valid N810 device. To get one of these, pick any number between 001d6e9c0000 to 001d6e9cffff. Pick any random 4 digits (between 0-9 and a-f hex) as the last 4 digits.
  3. Download the file named "RX-44_2008SE_1.2007.42-18_PR_COMBINED_MR0_ARM.bin."
  4. Download the latest firmware-upgrading software, "flasher-3.0".
  5. Now that you have the firmware flasher and the 2008 N800 software update in the same directory, open up a terminal (on a Linux desktop/laptop), and type:

    chmod a+x ./flasher-3.0
    ./flasher-3.0 -u -F RX-44_2008SE_1.2007.42-18_PR_COMBINED_MR0_ARM.bin

  6. That will unpack the software, and it may take a few seconds. Once that is done, plug the N800 into your computer, using the included USB cable, then reboot the Nokia device while holding the home button. Now execute the following commands:

    sudo ./flasher-3.0 --enable-rd-mode
    sudo ./flasher-3.0 -k zImage -f
    sudo ./flasher-3.0 -n initfs.jffs2 -f
    sudo ./flasher-3.0 -r rootfs.jffs2 -f -R

  7. That should be it. Your device should now boot up with the new 2008 version of the Nokia Maemo operating system.
Note: Nokia DOESN'T SUPPORT this procedure in ANY way. You can follow this procedure at your own risk. Neither me or Nokia have the responsability of any damage caused to your device.

11 November 2007

Upgrading Maemo SDK 4 Beta to Maemo SDK 4 final release

The final version of Maemo SDK 4 is out. Like most other people I couldn't wait for the final release and I installed the beta version. The big question, when I did read about the final version was "how can I upgrade to the final version without installing it from scratch?!". Luckly one kind person helped me on maemo-developer mailing list, and suggested me to do a dist-upgrade from inside the Scratchbox environment. So, login into tour Scratchbox environment and execute this:

[sbox-SDK_BETA_X86: ~] > fakeroot apt-get update
[sbox-SDK_BETA_X86: ~] > fakeroot apt-get dist-upgrade

That's all! I don't know if this is the official method to do the upgrade, but it worked for me. I checked, after the upgrade, if I had the right packages installed, using this page: http://tablets-dev.nokia.com/4.0/4.0b_vs_4.0_content_comparison.html
and they were right.

09 November 2007

N810 maemo submission accepted

Me too :D

I'm too happy!!! Thank so much Nokia!!!

I hope to get it as soon as possible so I will write a good review about it and I'll begin to test some application :)

25 October 2007

Installing Maemo SDK 4 Beta

Introduction

Maemo is an opensource development platform for Linux based devices. Actually is the base for the operating system installed on Nokia N770, N800 and the upcoming N810 but it could be adopted, with few changes, even by other similar devices.

In particular, this version of Maemo SDK is the only one that allow developers to develop new applications for N810 and to start porting old application to this new platform.

The SDK is not only a set of libraries and compiler, it gives you a real environment that emulates the Nokia device, so the developer can write applications, debug them and test them. Both command line and gui application are supported in emulator.

Graphical environment is based on a real X server, a window manager and on GTK libraries, with a particular extension called Hildon.

With Maemo SDK you can:

  • Test Maemo applications using a normal PC with Linux.
  • Write and debug applications written by you.
  • Port existing applications written for Linux/GTK and verify if they work correctly.
  • Compile and build ARMEL package so you can install them in the device.

Requirements

These are the minimum requirements to work with Maemo SDK:

  • Intel compatible processor (x86), at least 500 Mhz
  • 256 Mb RAM
  • 2 Gb space on hard disk
  • A Linux distribution (I suggest Debian or Ubuntu)

You need the following software packages:

Starting from 4.x version, Maemo has a simple installer script, so all you need are these two files:

Installing Scratchbox

The first tool you have to install is Scratchbox. I suggest you to use the script provided but you could choose also to install it manually (in this case please refer to [this site] for detailed instructions).

Before beginning the installation of Scratchbox, you have to become root.

First of all set the permission of the script file:

chmod +x maemo-scratchbox-install_4.0beta.sh

Then run it with these parameters:

./maemo-scratchbox-install_4.0beta.sh -d -u andy80

Please note that -d tells the installer to install from Debian dpkg packages while -u specifies your username (in my case is andy80, you have to change it using your local username).

Scratchbox environment will be installed in /scratchbox/

Please note that you'll have to logout and login again to be able to log into you new Scratchbox environment. To test it you simply have to start Scratchbox from your local user:

andy80@noteboontu:~/download/maemo_4.0_beta$ /scratchbox/login

Welcome to Scratchbox, the cross-compilation toolkit!

Use 'sb-menu' to change your compilation target.
See /scratchbox/doc/ for documentation.

[sbox-SDK_BETA_ARMEL: ~] >

Installing Maemo SDK

When Scratchbox is correctly installed on your system, you can install the Maemo SDK. Please note that you have to do it from normal user (the user you specified in the installation of Scratchbox).

Simply run this command and follow instructions:

bash maemo-sdk-install_4.0beta.sh

At the end you should get this message:

Installation was successful!
----------------------------

IMPORTANT! Please read this.

You now have the maemo 4.0beta 'chinook' installed on your computer.
You can now start your maemo SDK session with /scratchbox/login and
then select your target with 'sb-conf select SDK_BETA_ARMEL' for the
armel target or 'sb-conf select SDK_BETA_X86' for the i386 target.

If you have any problems with targets' package databases, you can try
running 'fakeroot apt-get -f install' on your scratchbox target.
This command will try to fix any problems with the package database.

Happy hacking!

Installing Xephyr

Xephyr is an X11 server that provides a device screen for the developer so that you can see all the maemo application windows and visuals on your computer.

To install it in a Debian based distribution, simply execute this (from root):

apt-get install xserver-xephyr

Running Xephyr

To see if all works fine, you should start Xephyr and Maemo environment. Execute this from outside the Scratchbox environment:

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite

Now, from another shell, log into Scratchbox and execute this:

[sbox-SDK_BETA_X86:~] > export DISPLAY=:2
[sbox-SDK_BETA_X86:~] > af-sb-init.sh start

This should start the Hildon Application Framework inside the Xephyr window. That's all!

References

Here you can find a list of website where I took information from to write this guide:

Spim - MIPS Emulator for N770

Spim is a self-contained simulator that will run MIPS32 assembly language programs. It reads and executes assembly language programs written for this processor. spim also provides a simple debugger and minimal set of operating system services. spim does not execute binary (compiled) programs.

I made a port of spim for the Nokia 770/800 device just for fun and to start learning how to do ports.

Download

You can download spim for N770/800 from here: http://www.ptlug.org/download/packages/spim_7.3-1_armel.deb

References

To create the package i followed the guide lines in these websites:

04 February 2007

Installing Maemo SDK for Nokia 770

Introduction

Maemo is an opensource development platform for Linux based devices. Actually is the base of the operating system installed on Nokia 770 and 800, but it could be adopted, with few changes, even by other similar devices.

The SDK is not only a set of libraries and compiler, it gives you a real environment that emulates the Nokia device, so the developer can write applications, debug them and test them. Both command line and gui application are supported in emulator.

Graphical environment is based on a real X server, a window manager and on GTK libraries, with a particular extension called Hildon.

With Maemo SDK you can:

  • Test Maemo applications using a normal PC with Linux.
  • Write and debug applications written by you.
  • Port existing applications written for Linux/GTK and verify if they work correctly.
  • Compile and build ARMEL package so you can install them in the device.

Requirements

These are the minimum requirements to work with Maemo SDK:

  • Intel compatible processor (x86), at least 500 Mhz
  • 256 Mb RAM
  • 2 Gb space on hard disk
  • A Linux distribution (I suggest Debian or Ubuntu)

You need the following software packages:

The whole toolchain has been tested with particular versions of those two software, so you're suggested to use these packages:

Installing Scratchbox

Before you begin to install the SDK you need to become root on your machine and change the working directory to / before extracting files. To install Scratchbox you need to extract in / these packages:

su -
cd /
tar xfvz scratchbox-core-1.0.7-i386.tar.gz
tar xfvz scratchbox-devkit-debian-1.0.6-i386.tar.gz
tar xfvz scratchbox-libs-1.0.7-i386.tar.gz
tar xfvz scratchbox-toolchain-cs2005q3.2-glibc-arm-1.0.5-i386.tar.gz
tar xfvz scratchbox-toolchain-cs2005q3.2-glibc-i386-1.0.5-i386.tar.gz
tar xfvz scratchbox-devkit-cputransp-1.0.1-i386.tar.gz

Note: you don't have to extract the two Maemo_Dev* files. It will be explained later how to install them.

First of all you have to execute the initialization script:

root@notebuntu:/# /scratchbox/run_me_first.sh
Do you want to use sudo mode? [yes/no] (no):
Give the name of the scratchbox group (sbox):
The group 'sbox' does not seem to exist!
Would you like me to create the group 'sbox' for you? [yes/no] (yes):
Creating group "sbox"...
Stopping Scratchbox: umount, binfmt_misc.
Starting Scratchbox: binfmt_misc, mount.

Now you should add one or more users with /scratchbox/sbin/sbox_adduser

At this point you have to add your own user to Scratchbox, using this command:

/scratchbox/sbin/sbox_adduser username

where username is your user on Linux machine. It's ok if you leave the default values:

root@blackbull:/# /scratchbox/sbin/sbox_adduser andy80
Add user andy80 to group 'sbox'? [yes/no] (yes):
Adding user `andy80' to group `sbox' ...
Done.
Scratchbox user account for user andy80 added

Note: it's possible you have to logout from the current session and login again after you modify permissions/groups to make changes effective.

Scratchbox installation is complete. Open a terminal window on your Linux machine using your user and login inside Scratchbox with this command:

andy80@notebuntu:~$ /scratchbox/login

You dont have active target in scratchbox chroot.
Please create one by running "sb-menu" before continuing


Welcome to Scratchbox, the cross-compilation toolkit!

Use 'sb-menu' to change your compilation target.
See /scratchbox/doc/ for documentation.

sb-conf: No current target
[sbox-: ~] >

After you have logged into Scratchbox you have to create the file .bash_profile using vim and entering these lines:

export LANGUAGE=en_GB
export PAGER=less

Logout from Scratchbox and create this symbolic link that will initialize Scratchbox when your machine starts:

ln -s /scratchbox/sbin/sbox_ctl /etc/rc2.d/S20scratchbox

Installing Maemo SDK

First of all you have to copy the rootstrap files into the /scratchbox/packages/ folder:

cp Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz /scratchbox/packages/
cp Maemo_Dev_Platform_v2.2_armel-rootstrap.tgz /scratchbox/packages/

You have to do this outside from Scratchbox, without being logged into it. After you have copied these two files you have to login again into Scratchbox.

Configuring Scratchbox

Latest version of Scratchbox has and utility called sb-menu that permits you to configure the available toolchains in a very easy way. These are the main functions available once you execute this utility:

  • Setup: create a new toolchain or modify an existing one.
  • Install: install other packages into an existing toolchain.
  • Rootstrap: extract and install a new rootstrap inside a toolchain.
  • Select: select the active toolchain.
  • Reset: reset the active toolchain.
  • Remove: remove an existing toolchain. Note: you cannot remove an active toolchain. First you have to select another toolchain, then you can remove the previous one.
  • Show: show informations about the active toolchain.
  • KillAll: kill all processes in the active toolchain.

Configuring i386 toolchain

To configure the i386 toolchain you need to do these simple steps:

  • Select the function Setup
  • Select Create a new target
  • Set the name to: SDK_PC
  • Choose this as compiler: cs2005q3.2-glibc-i386
  • Choose debian as devkits, then select DONE
  • CPU Trasparency: select none
  • You're now prompted to extract the rootstrap for the current target, choose Yes and write the absolute path of the Maemo rootstrap 2.2 for i386. Note: the sb-menu version I tested has a bug that doesn't permit you to select the rootstrap browsing folders on your PC, so you have to type the complete path or copy-paste it.
  • At the end you're asked to install other files: choose Yes, then select all checkboxes available and confirm to complete the installation.

Configuring armel toolchain

To configure the armel toolchain you need to do these simple steps:

  • Select the function Setup
  • Select Create a new target
  • Set the name to: SDK_ARMEL
  • Choose this as compiler: cs2005q3.2-glibc-arm
  • Choose debian and cputrans as devkits, then select DONE
  • CPU Trasparency: select qemu-arm-0.8.1-sb2
  • You're now prompted to extract the rootstrap for the current target, choose Yes and write the absolute path of the Maemo rootstrap 2.2 for armel. Note: the sb-menu version I tested has a bug that doesn't permit you to select the rootstrap browsing folders on your PC, so you have to type the complete path or copy-paste it.
  • At the end you're asked to install other files: choose Yes, then select all checkboxes available and confirm to complete the installation.

Installing Xephyr

To run graphical applications written for Maemo you need to start a graphical interface and a mini X server that works as a box for our applications. We need Xephir to perform this job and it's already installed into Maemo rootstrap.

Per eseguirlo, occorre creare un file dall'esterno della Scratchbox, ovvero senza esserci loggati dentro. Il file deve chiamarsi start-xephyr.sh ed all'interno dobbiamo scriverci:

You need to create a script outside from Scratchbox called start-xephyr.sh, without being logged into it, and write these lines inside:

#!/bin/sh -e
prefix=/scratchbox/users/${LOGNAME}/targets/SDK_PC/usr
export LD_LIBRARY_PATH=${prefix}/lib; export LD_LIBRARY_PATH
exec ${prefix}/bin/Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac

Create this file inside the /scratchbox/ directory.

Give it the executable permission:

chmod +x start-xephyr.sh

To start it you have to execute this command outside from Scratchbox, without using your normal user:

/scratchbox/start-xephyr.sh &

you should see the Xephir window at this point.

Once Xephir is started, you have to start the Maemo graphical interface. Log into Scratchbox and execute these commands:

export DISPLAY=:2
af-sb-init.sh start

Maemo graphical interface should start. Now you can run graphical application and see them inside the Xephir window.

Note: first time you run it you could get errors about "Maemo Launcher". Restarting your PC these problems should disappear.

References

Here you can find a list of website where I took information from to write this guide:

25 January 2007

Nokia 770: Linux in the palm of a hand


I was looking for an handled device that allowed me to do things I could never do with other devices and with a good development kit.

After a long waiting, finally I choose Nokia 770.
Beyond the trust I've in Nokia for a long time, because of its good products, this device had a particular thing inside that convinced me to buy it: it's totally based on Linux and all its software (except for Opera, Flash and some drivers) is opensource.

Even if N770 is produced by Nokia, it's not a phone but an Internet tablet that can be used to browse the web, chat with friends, read emails, make VOIP calls, watch a video and listen to mp3.

Connectivity is one of the points of strenght of this device: it has Bluetooth and WiFi 802.11 b/g. Connection configuration is so easy that everyone can do it.

As I said before, the most interesting thing of this device is its operating system: Linux. More in details, it's an ad-hoc version called Maemo based on the Debian distribution. Maemo is developed and supported by Nokia and by a very large community of developers and geek users thatday by day develop new application or port existing one on this platform.

Nokia 770 graphical interface is based on Gtk library and it's called Hildon. You can develop application in C or Python language but recetly also other languages are available: Ruby, Mono/C#, Perl, ecc...

Developers have a real development kit that, thanks to the Scratchbox enviroment, gives you the opportunity to test application on the normal PC, then cross-compile them and finally install them on the device.

My next objective is to publish here in these pages a simpla tutorial that will explain how to install and configure the Maemo development environment on your PC.

I think Nokia and Maemo is a very good platform to develop applications. The release of N800, after the success of N770 gives us good news about Nokia future plans about opensource. I really hope it's not only a trend of this moment and that Nokia will move even more towards opensource.