当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > uClinux中添加用户应用程序的详细方法

Unix/Linux
调查显示:采用 Linux 系统比 Windows 便宜36%
Linux下Modules的概念及使用详解[转贴]
Linux 新手常见问题FAQ
Linux下Modules的概念及使用详解
Linux 策略路由
LINUX下变态下载的安装使用方法
服务器控制下的SIP呼叫转移
Linux 系统中的Samba配置
samba服务器的文件共享配置
Linux策略路由
vsftp下用户允许可传、下文件,但不能删
自制Liunx的开机画面
RedHat 7.3, RedHat ADS 2.1+Xmanager 1.3.9.6实现Windows下X
inode上限的问题,有默认的值吗?怎么查看呢?
如何在Linux下获得MBR的信息?
好用的Linux小工具:Autofs
Linux之邮件服务器配置指南
关于ntfs和内核问题
Linux目录切换技巧
linux可以绕开三茗硬盘保护卡

Unix/Linux 中的 uClinux中添加用户应用程序的详细方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 171 ::
收藏到网摘: n/a

1. uClinux-dist/user/Makefile

dir_$(CONFIG_USER_HELLO_WORLD)

+= hello

2. uClinux-dist/config/Configure.help

CONFIG_USER_HELLO_WORLD

A simple hello world program

3. uClinux-dist/config/config.in

找到下面两行

mainmenu_option next_comment

comment 'Miscellaneous Applications'

添加如下一行

bool 'hello'

CONFIG_USER_HELLO_WORLD

4.1.uClinux-dist/user/hello/Makefile

EXEC = helloOBJS = hello.oall: $(EXEC)$(EXEC): $(OBJS)$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)romfs:$(ROMFSINST) /bin/$(EXEC)clean:-rm -f $(EXEC) *.elf *.gdb *.o

4.2.uClinux-dist/user/hello/hello.c

#include <stdio.h>int main(){printf("Hello, World\n");return 0;}

5. 将用户程序编译进romfs

# cd ~/uClinux-dist# make menuconfig# make dep# make romfs