|Building Programs for the DLink DSL-300T
||[Oct. 23rd, 2005|03:54 pm]
My current ADSL router is a nifty little box from DLink, the DSL-300T. One of the nice things about it is that it's Linux powered.|
I've done some reading up on it in the past, with a view to getting it to support IPv6. Armed with this page (on the DSL-302T), I was able to telnet in and have a play with it. Then, armed with this page (on the DSL-604T), I felt I might have a chance at recompiling some stuff.
As it turns out, the router runs on a MIPS cpu, and is little endian (LSB). I guessed it would be big endian (MSB), so spent quite some time pissing about failing to get stuff to work :(
Because it's little endian, you generally want the mipsel, rather than the mips packages. I got a uclibc cross compiler from here, having found lots of handy links on the MIPS Linux site.
Armed with the mipsel crosstool, I've been able to build a hello-world application, and run it successfully on the router. (I've been using the built in wget, rather than the built in tftp client, because I find the busybox tftp syntax a bit wierd. Use this doc as a guide to it.).
A good way to check if your application is compiled right is to use file on it. You should get "ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), stripped" (though static is fine).
Now, I just have to get a full toolchain installed, and try to recompile the kernel for IPv6 support. Maybe that'll have to wait for next week though!