This (short) tutorial concerns Dingux development, from a Linux (on Intel) platform. First we go through the installation of the toolchain (the cross compiler and all the stuff that goes along), and then an example of compilation.

Note: I use mostly the command line, but you can of course use equivalent graphical tools if you prefer.


Contents

Installing the toolchain

 tar -jxvf dingux_toolchain_20091022.tar.bz2
 sudo cp -r mipsel-linux-uclibc /opt/
 export PATH="${PATH}:/opt/mipsel-linux-uclibc/usr/bin/"

(you might want to add this line to your shell's config file so that you don't have to retype it every time you open a new terminal. For instance if you use bash, add it at the end of .bashrc in your home folder) And we're done. Now let's check that it works.

Using the toolchain

We use the cross-compiler exactly as we would use the regular GCC, except that instead of invoking gcc, g++, ld, etc., we use mipsel-linux-gcc, mipsel-linux-g++, mipsel-linux-ld, etc.

If using a makefile, you can for instance put

 CC = mipsel-linux-gcc
 CXX = mipsel-linux-g++

in the beginning.

Or when porting existing software that use the configure script:

 ./configure --host=mipsel-linux --target=mipsel-linux


Hello Dingoo

Let's check that the toolchain works, with the traditionnal 'Hello World' program.

 #include <stdio.h>

 int main(void)
 {
	printf("Hello Dingoo\n");
 	return 0;
 }
 mipsel-linux-gcc -o hello hello.c
 [email protected]:~/Dingoo/hello$ ftp 10.1.0.2
 Connected to 10.1.0.2.
 220 Operation successful
 Name (10.1.0.2:tenoch): root
 230 Operation successful
 Remote system type is UNIX.
 Using binary mode to transfer files.
 ftp> cd local 250 Operation successful
 ftp> put hello
 local: hello remote: hello
 200 Operation successful
 150 Ok to send data
 226 Operation successful
 5767 bytes sent in 0.00 secs (46162.6 kB/s)
 ftp> exit 221 Operation successful
 [email protected]:~/Dingoo/hello$ telnet 10.1.0.2
 Trying 10.1.0.2... Connected to 10.1.0.2.
 Escape character is '^]'.
 / # cd usr/local/
 /boot/local # ./hello
 Hello Dingoo

Success!

Second choice: from the Dingoo's interface with gmenu2x, go to the tab "Applications", select "Explorer", navigate to "hello" and launch it. The screen will flash to the terminal, and if you're fast enough, you can read "Hello Dingoo" at the bottom before gmenu2x comes back. To check that, go to the tab "Settings" and choose "Terminal". It will display for 5 seconds the last things written to the standard output.

Notes

The convention is apparently to use the ".dge" file extention for Dingux executables, but it is not necessary. gmenu2x might rely on this when doing automatic scanning, though (to check ?).


Problems

lsmod | grep -i cdc_ether