I'm working on running a Hello World program on the Linksys WRT54G-V4.
Right now this router is running dd-wrt for reasons I'll explain below.
Following the instructions I've been able to build OpenWRT and produce images for brcm47xx and brcm63xx. I was never able to build dd-wrt firmware, or figure out its toolchain.
I'm able use the very nice 'make menuconfig' utility to build a toolchain that will cross compile from my x86 Ubuntu box to a MIPS target.
For example, here is a successful compile of my little Hello World program:
jim@ubuntu:~/Desktop/tests$ cat helloC.c
#include <stdio.h>
int main (int argc, char **argv)
{
printf("Hello World\n");
return 0;
}
jim@ubuntu:~/Desktop/tests$
jim@ubuntu:~/Desktop/tests$ mipsel-openwrt-linux-gcc -o HelloWorld helloC.c
jim@ubuntu:~/Desktop/tests$
jim@ubuntu:~/Desktop/tests$ file HelloWorld
HelloWorld: ELF 32-bit LSB executable, MIPS, MIPS32 version 1, dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, not stripped
jim@ubuntu:~/Desktop/tests$
Sadly, when I try to run HelloWorld on my WRT54G-V4 running dd-wrt I get a seg fault.
Looking at Wikipedia, I see that this router uses the Broadcom BCM5352.
When I run make menuconfig in by OpenWRT/trunk directory I don't see an option for the BCM5352, which is why I'm reluctant to flash my router with one of the images I've created in the brcm47xx or brcm63xx directories. I don't want to guess wrong and brick the router.
Question 1 - Which Broadcom configuration should I select using make menuconfig to target my WRT54G-V4 with its BCM5352 chipset?
Question 2 - Should my 'HelloWorld' executable file I generated above run directly from the command line on the 54G, or must I make it a package per http://www.gargoyle-router.com/wiki/dok … wrt_coding ?
TIA
(Last edited by JimNtexas on 6 Sep 2012, 19:17)