Showing posts with label getting started. Show all posts
Showing posts with label getting started. Show all posts

Friday, July 2, 2010

Compiling ctb

1) First setup your environment:
source /usr/local/poky/eabi-glibc/arm/environment-setup

2) Pick your machine
export MACHINE_NAME=dr1000s
or
export MACHINE_NAME=dr800sw

3) Then prepare for configure:
autoreconf --install
intltoolize

4) For configure you need to use the following options:
./configure --host=arm-poky-linux-gnueabi --sysconfdir=/etc --prefix=/usr

5) Then build it:
make

6) and copy to target:
scp src/ctb root@qemu:~/

7) To reduce the size of the ctb binary use:
arm-poky-linux-gnueabi-strip src/ctb
which will reduce the binary from anout 300K to 90K. (copy again)
8) login to the emulator
ssh qemu

9) and copy it to the correct place (it is not possible to do this directly via scp)
(Note that this only copies the ctb-binary and assumes that all files it depends on are already on the emulator, which is true if you did not do any strange things)
cp /usr/bin/ctb ~/ctb.org <-- only do this once :-) cp ~/ctb /usr/bin/

10) Now restart the qemu
shutdown now
and then restart via Anjuta (or any other way)
11) By pressing Ctrl-Alt-3 you can see the system logging of qemu, use Ctrl-Alt-1 to go back.

And by now you have spend a lot of time and changed nothing :-)

Hello World 2

Since (I think it was) R1.6 an extra step is needed to build the hello-world example.
Before the first configure of any of the irex components (like hello-world) a call to intltoolize is needed.

Sunday, August 2, 2009

Hello World

The hello-world from R1.6 has some problems, so I will use the version from R1.5, which is not that much different from R1.6.
You can find the example program hello-world here. Unzip it somewere and double-click the hello-world.anjuta icon, Anjuta will be started and at the left-side show the files from hello-world. The first thing to do now is to enable the Poky Plug-in, see also section 3.3.2 of the 'iOn Development Environment'-document which explains nicely how to do this. You will now have an extra Tools-menu. If you have not yet configured the Poky Anjuta PlugIn, follow the instructions from the iRex document.
The steps to follow after starting a Anjuta project are always the same:
1) Choose Builds->Autogenerate to update the makefiles
2) Choose Builds->Configure to update the configure file. As a parameter use --prefix=/usr. This will put the generated program and its data in /usr/bin and /usr/share.
Watch for the 'Completed Sucessfully'.
3) Choose Build->Build Project to generate the applciation and the resources it needs.
4) Start the emulator using Tools->Start QEMU. (This will take some time and ask you for the su password.)
5) Deploy to target: Tools->Deploy, this will prepare everything and copy it to the emulator into the location that was indicated with the Configure call (--prefix=/usr). It will ask you for the qemu-password which is empty.
6) Start a new Terminal window and open a connection with the emulator: 'ssh root@qemu' it will prompt for the password, which is empty.
7) Start the application: In the terminal window first type 'export DISPLAY=:0.0' (0=zero, not so obvious in this font) and then type 'hello-world' it will print a lot of logging in the terminal window and start the hello-world application in the emulator.
The procedure explained in the iRex develoment document, using Tool->Debug Remote, did not work well for me, so you will have to experiment yourself with that.

The application does not do that much (at least not that you can see). You can select 'Close Application' from the menu to close the application. That's that, first application build, downloaded and started on the emulator.

Getting Started

I did only have limited experience with linux, but that was enough for me to get started. People at MobileReader already made it easy to start developping/porting programs for the DR1000.
- First you will need the correct development environment. Since I wanted to use my 'down-stairs' PC for development I needed the environment to work under windows. Fortunately Adam B. created a VMWare-image that is easy to install and use.
- Next you need to update the VMWare-image with the lastest development tools that are supplied by iRex (The original VMWare image contains the V1.03 tools). On the website of iRex a document explains how to start development for the DR1000.
This document very well explains how to get started. It also explains how to start if you do not want to use the VMWare image, but use a linux installation. (I think it is wise to use the recommended Ubuntu 8.04 and not another/newer version.)

Now it is time to look at HelloWorld...