Showing posts with label n770. Show all posts
Showing posts with label n770. Show all posts

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:

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.