找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 8941|回复: 8

linux下自己编译可以在DD-WRT上工作的程序。

[复制链接]
工作环境: linux, 我的是ubuntu8.04,ubuntu的iso可以刻盘后光盘启动,也能用vmware安装,现在支持wubi方式安装,把ubuntu安装位xp下面的一个应用,整个linux分区就是windows下面的一个文件。

编译工具:http://www.dd-wrt.com/dd-wrtv2/d ... .debian.sp1.tar.bz2
解压,加入到PATH:(建议修改到~/.bashrc)
export PATH=$PATH:/home/steeven/work/dd-wrt/home/dd-wrt/whiterussian/openwrt/staging_dir_mipsel/bin

写一个test.c测试程序:
#include <stdio.h>
int main(){
printf("hello~\n");
return 0;
}

编译:
mipsel-linux-gcc test.c -o test

这时候ls应该看到test程序了。
./test执行,报错了吧?无法工具执行二进制文件!这就对了。因为mipsel-linux-gcc是交叉编译,编译出来的是给mips芯片用的。
file test, 看到MIPS字样了?好,copy到dd-wrt的/tmp目录下面,记得chmod +x test, 在telnet下面执行就能看到"hello~"出来鸟

要在x86平台上验证有个办法,安装qemu:
sudo apt-get install qemu
这玩意可以模拟mipsel芯片,但是要加对应的库目录(-L):
qemu-mipsel -L /home/steeven/work/dd-wrt/home/dd-wrt/whiterussian/openwrt/staging_dir_mipsel/ test
上面的-L目录是交叉编译工具所在目录。一样能运行吧~

在optware下面还可以安装gdb/gdbserver,调试程序更方便。不晓得有没有gcc

本人菜鸟,欢迎大家自己编译出一些有趣的程序出来。
这是我编译过的:以路由攻路由 passwd密码生成工具
我的恩山、我的无线 The best wifi forum is right here.
呵呵 感谢提供资料
我试试编译一个驱动...
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

牛人啊,我找了几天了,终于找到点眉目了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

www.dd-wrt.com/dd-wrtv2/downloads/others/sourcecode/toolchains/目录下有好多软件包:

all_toolchains_amd64.tar.bz2
gcc-3.3.5-openwrt.tar.bz2
gcc-3.4.4-crossmipsel-AMD64.tar.bz2
gcc.3.4.4-broadcom-mipsel.tar.bz2
toolchains.darwin.ppc.sp1.tar.bz2
toolchains.x86.debian.sp1.tar.bz2

我用的是红旗Linux和Everest Linux,应该用上面哪个包编译呢?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

4# lfm


现在dd官网上面没有   toolchains.x86.debian.sp1.tar.bz2
只有  current-toolchains.tar.bz2
这个文件里有几个文件夹
是不是现在就是这个文件替代上面的文件?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

dd的toolchain基本没用
去下openwrt 2.4下的sdk  就可以编译2。4的了
比dd提供的sdk好多了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

牛人~~内牛满面
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

以路由攻路由链接死了,学习中。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-5 19:24

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表