DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-03-06 14:21:40

vedeja
Member
Registered: 2008-02-21
Posts: 161

Creating/implementing software for the DNS-323

Hello!
Being a rather Linux newbie I sometimes find myself pretty lost in this forum. However, like many, I have funplugged my box and am running the regular stuff like lighttpd with php, custom fancontrol and mldonkey. I am a skilled programmer coming from non-linux environments and, of course, would like to expand my knowledge and start do my own programming (since this 323 gadget has given me an unplanned entrypoint to linux).

I am requesting very basic (and patient) step-by-step information on how to set up my own development environment. I know there is a wiki on how to cross-compile but it's above my head already at that level. Perhaps someone could begin by explaining things like:

* toolchain
* uclibc
* cross-compile
* ARM, etc

Yeah I know the basic meaning of most of the terms in this forum, but it's sometimes hard to understand how they apply to this particular subject.
For example, I have posted in another thread regarding X10 and would like to program om that subject but I don't know how to get there.

/Vedeja


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.50 ¤ FW 1.07 ¤

Offline

 

#2 2008-03-06 14:49:24

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Creating/implementing software for the DNS-323

vedeja wrote:

I am a skilled programmer coming from non-linux environments and, of course, would like to expand my knowledge and start do my own programming (since this 323 gadget has given me an unplanned entrypoint to linux).

I am requesting very basic (and patient) step-by-step information on how to set up my own development environment. I know there is a wiki on how to cross-compile but it's above my head already at that level. Perhaps someone could begin by explaining things like:

* toolchain
* uclibc
* cross-compile
* ARM, etc

Such a question is hard to answer, you can fill books about the topic. For basics and the big picture, start reading here:
http://en.wikipedia.org/wiki/Toolchain
http://en.wikipedia.org/wiki/Cross-compiler
http://en.wikipedia.org/wiki/Uclibc
http://en.wikipedia.org/wiki/ARM_architecture

Offline

 

#3 2008-03-06 15:10:28

vedeja
Member
Registered: 2008-02-21
Posts: 161

Re: Creating/implementing software for the DNS-323

I was sort of expecting an answer llike that, but thanks anyway. In general, can one acquire all the tools/nibs/bits required to get going, free off the internet? Or is there licensed stuff that must be payed for?


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.50 ¤ FW 1.07 ¤

Offline

 

#4 2008-03-06 15:54:44

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: Creating/implementing software for the DNS-323

It's all free - if you follow the cross compile wiki (you need a linux OS, a Live cd would do... and ask here for help if you need it) you'll install the tools/nibs/bits needed, and yes they're free/open source.

Offline

 

#5 2008-03-06 16:01:13

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Creating/implementing software for the DNS-323

vedeja wrote:

I was sort of expecting an answer llike that, but thanks anyway. In general, can one acquire all the tools/nibs/bits required to get going, free off the internet? Or is there licensed stuff that must be payed for?

It's all free software. For cross-compilation, you need a linux desktop. If you can wait, I'm working on a new funplug package that comes with a compiler. But the current version is broken and it will take some time to fix...

To get started with Linux dev, I'd install a Linux desktop, write and test source code there, and only if it works well enough, port it to the dns.

Offline

 

#6 2008-03-06 16:07:57

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Creating/implementing software for the DNS-323

A cross compiler is a compiler that will build an executable for a different system to the one that it is running on. A tool chain is the compiler plus any other supporting libraries and applications. You need a cross compiler because the CPU inside the DNS323 is not like the CPU in a "normal" PC.

The tool chain described on the wiki http://dns323.kood.org/howto:crosscompile is a set of libraries and command line utilities that you can use to create an executable that will run on the DNS323. You can try to integrate those tools with the text editor or IDE of your choice.

The toolchain is good for creating an application that will run on a vanilla DNS323 that will require as a minimum only a simple fun_plug script to start your new application. (So fonz fun_plug will do, but something even simpler will work too.)

I reached a personal milestone today - I compiled hello_world.c and ran the binary on my DNS323!

Here are my suggestions for your first steps based on my vast experience:

Install Linux on a PC, either a real pc or a virtual machine using Microsoft Virtual PC or VMWare Server. This should not be any harder than installing Windows. Maybe you could even use Linux on a bootable CD, like Knoppix?

Maybe you can avoid installing Linux by getting all of this working with Cygwin in Windows, but Cygwin has it's own peculiarities and you'll be able to get more support if you are working inside a normal Linux setup. Personally I installed CentOS 4 (because I already had a virtual machine with that on), but the helpful folks round here seem to prefer Debian.

During your installation you will often be asked what your machine will be used for, and there will be an option like "Development System" that you can choose. Don't worry too much about this as it only determines what software will be installed, and you can add extra things later. Also help yourself by choosing one of the lower security levels if you are given an option. (I assume that you will only be using the install for compiling, and that you have a reasonable secure network where you will be using the machine.)

After the install learn how to install extra software on to your Linux installation, and choose a text editor or IDE that you feel comfortable with. (If you're new to Linux choose something very simple like kate, joe or nano; learning vi might be useful to edit on the DNS323, and if you start doing more development for Linux then Eclipse is excellent but usually requires installing java which might be harder than you expect).

Then follow the instructions on the Wiki for cross compiling, up to and including building the tool chain step. I don't think (that is I don't know) that there is any reason to compile the kernel and other applications listed after that step.

When you build the tool chain the configuration script prompts for various pieces of input and accepting the default values will produce a working tool chain, but it was suggested to me that choosing arm926t as the processor type might create better optimized executables.

After the script has finished creating the tool chain and you have fixed the symlinks then you can, for example, compile a simple program called hello from a source file called hello.c with a command like this:

arm-linux-gcc hello.c -o hello

If you are trying to compile a Linux application for the DNS323 that you have downloaded then it will probably have a configure script that you need to run, and you will need to tell that script that you want to use your ARM toolchain to do the compilation. I've not done that yet.

Additionally the Optware/ipk talk on these boards looks interesting, eg http://dns323.kood.org/forum/t1797-%5Ba … k%27s.html, but I'm still not sure I understand how that will all hang together.

Any help to you?

Last edited by sjmac (2008-03-06 16:23:25)

Offline

 

#7 2008-03-06 17:10:48

vedeja
Member
Registered: 2008-02-21
Posts: 161

Re: Creating/implementing software for the DNS-323

Thanks a lot. Forums proove that kindness is free and the world could be a better place if you just help. smile This gives me a good starting point with lots of new things to get my hand dirty with.

I will begin with a LiveCD just to get a look at the "real" thing, ans I'm thinking Knoppix after som wiki surfing. To jump a bit ahead: if I was to set up a toolchain using a LiveCD, would that mean I should make a "custom" CD (e.g. with Knoppix) where I would also include the stuff that makes up the toolchain?

sjmac wrote:

The toolchain is good for creating an application that will run on a vanilla DNS323 that will require as a minimum only a simple fun_plug script to start your new application.

By "vanilla" do you mean standard setup?


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.50 ¤ FW 1.07 ¤

Offline

 

#8 2008-03-06 17:39:06

terry_opie
Member
Registered: 2008-02-28
Posts: 11

Re: Creating/implementing software for the DNS-323

If you don't want to mess with rebooting into a Live CD, consider VMware.  The VMware server is now free, just have to "sign up" to get a license key.  ie, all they want is your e-mail address.  And you can get say 10 licenses if you want for possible future installations.

Its what I use, and I love it.  I can boot up the virtual machine (I run Ubuntu) when I need/want to development.  I also have directories shared on my Windows box, that I then in turn mount from the Linux VMware image to get access to all the goodies that I need.

Using VMware, both OS's are running at the same time so there isn't any rebooting to get one over the other.  You would probably definitely want to have dual (quad) core machine if this is the route you're going.  It helps to dole out the VM to one of the cores so you don't tank the Host OS.

Just a suggestion.

Last edited by terry_opie (2008-03-06 19:27:36)

Offline

 

#9 2008-03-06 18:26:50

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Creating/implementing software for the DNS-323

vedeja wrote:

I will begin with a LiveCD just to get a look at the "real" thing, ans I'm thinking Knoppix after som wiki surfing. To jump a bit ahead: if I was to set up a toolchain using a LiveCD, would that mean I should make a "custom" CD

Knoppix has a nice feature where you can save your changes to a USB memory stick. You won't need to make a custom CD. (And I think you need an installed version of Linux to make a custom CD, and you don't have that ...)

If you can't get it to work, then go the virtual machine route.

vedeja wrote:

By "vanilla" do you mean standard setup?

Yes

Offline

 

#10 2008-03-21 12:22:23

vedeja
Member
Registered: 2008-02-21
Posts: 161

Re: Creating/implementing software for the DNS-323

So what programming language should I use (or better - learn)? For example, the transmission-daemon. How was it written? So far, I have understood that shell scripting is equally important when it comes to developing but I don't think the more advanced programs are mere scripts.


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.50 ¤ FW 1.07 ¤

Offline

 

#11 2008-03-21 12:37:19

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: Creating/implementing software for the DNS-323

C is THE language in Unix/Linux.

Offline

 

#12 2008-03-21 16:53:45

jules
Member
Registered: 2008-01-26
Posts: 78

Re: Creating/implementing software for the DNS-323

Hmm, the internet is full of guides on crosscompilation but maybe a step-by-step and straightforward guide on how to build a simple application for the dns, with the basic dlink toolchain, showing how to resolve common problems (e.g. dependencies issues) could be of some use. Task added to my todo list.

Last edited by jules (2008-03-21 16:54:05)


CH3SNAS - Black Box Ed. • FW:1.03b6a • 2 x WD5000AAKS

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB