QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2751|回复: 12

添加自己的应用程序到嵌入式系统!

[复制链接]
发表于 2005-5-20 18:08:03 | 显示全部楼层 |阅读模式
请问,自己的应用程序(包括协议栈)应怎么添加到板子上呢?

是和文件系统做在一起,烧到板子flash吗?
发表于 2005-5-20 18:16:12 | 显示全部楼层
找本UCLINUX的书,另有BAIDU,GOOGLE两位大神…………
回复

使用道具 举报

 楼主| 发表于 2005-5-23 22:15:52 | 显示全部楼层
是放到根文件系统吧!
但放到哪里呢?任意位置?
回复

使用道具 举报

发表于 2005-5-24 18:23:18 | 显示全部楼层
uCLinux 的 Documentation 下面有详细帮助文档

Adding User Applications to the uClinux Distribution
----------------------------------------------------

D. P. Siddons
9th Dec. 2001


This document gives simple instructions for adding a user-written application to
the uClinux configuration system. Entries must be added to three files, and an
apropriate Makefile must exist in the user application source directory, which
must be put in user (all directory names here are given relative to the uClinux
top directory. In my system this is /home/peter/uClinux-dist).  

Files to edit:

user/Makefile
   Add a line to the file like
   
   dir_$(CONFIG_USER_FOO_FOO)            += foo
   
   This adds the directory 'foo' to the list of directories to be built. I added
   mine in alphabetical order. The order doesn't seem to matter.
  
config/Configure.help
   This file contains the text which is presented on request during the
config.
   Add a block like
   
   CONFIG_USER_FOO_FOO
     This program does fooey things to your bars.
   
   The text must be indented two spaces, and there must be no empty lines. Lines
   should be <70 chars long.

config/config.in:
   Add a line in the apropriate menu section (i.e. in the program group you want
   your app to show up in during 'make config'; I used 'misc'), like
   
   bool 'foo'           CONFIG_USER_FOO_FOO
   
   The repetition of FOO allows for directories which contain multiple
   executables. Thus, if the user directory 'foo' contained code to make 'foo'
   and 'bar', each gets its own config line if an additional entry is made like
   
   bool 'bar'           CONFIG_USER_FOO_BAR  
   

Next, there needs to be a proper /user/foo/Makefile. The Makefile should follow
the following template:

   --------------------------------------------   
   EXEC = foo
   OBJS = foo.o

   all: $(EXEC)

   $(EXEC): $(OBJS)
        $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)

   romfs:
        $(ROMFSINST)    /bin/$(EXEC)         放哪里在这里决定

   clean:
        -rm -f $(EXEC) *.elf *.gdb *.o
   ---------------------------------------------
   
   If more than one executable is built in the foo directory, as above, then the
   Makefile should look like
   
   ------------------------------------------------------------
   EXECS = foo bar
   OBJS = foo.o bar.o

   all: $(EXECS)

   $(EXECS): $(OBJS)
        $(CC) $(LDFLAGS) -o $@ [email protected] $(LDLIBS)

   romfs:
        $(ROMFSINST) -e CONFIG_USER_FOO_FOO             /bin/foo
        $(ROMFSINST) -e CONFIG_USER_FOO_BAR             /bin/bar
   --------------------------------------------------------------
   
   More complex makefiles are of course possible. The reader is encouraged to
   browse the user tree for examples.
   
   When all this is set up, doing the standard 'make xconfig; make dep; make'
   should build the app and install it in romfs and hence in the target system
   image.bin.
回复

使用道具 举报

 楼主| 发表于 2005-5-25 09:02:50 | 显示全部楼层
谢谢楼上!
用在arm-linux是一样的 么 ?
回复

使用道具 举报

发表于 2005-5-25 10:13:59 | 显示全部楼层
这个是经典问题了,可以看看 uclinux 实现上添加用户程序的视频教程
http://www.lumit.org/dn_video.htm
回复

使用道具 举报

 楼主| 发表于 2005-5-26 16:17:38 | 显示全部楼层
谢谢楼上!
回复

使用道具 举报

发表于 2005-5-31 11:03:55 | 显示全部楼层
arm-linux好象不一样的,请各位指点指点? 用户程序要调用标准的c头文件要放到什么目录下?
回复

使用道具 举报

发表于 2005-6-3 16:30:40 | 显示全部楼层
应该是要把文件系统和内核做到一起烧写到flash中。
呵呵,这位仁兄好象是不是没有把<tab>放好地方啊?
qq:349069990
请指教!
回复

使用道具 举报

发表于 2005-6-3 17:20:25 | 显示全部楼层
arm-linux 和 arm-elf 的区别,清华bbs上有一段经典解释,可以看看:


there are some differences between arm-elf, arm-linux, andarm-uclinux toolchains.

As I know, arm-uclinux-binutils is the same as arm-linux-binutils.
arm-uclinux-gcc was patched from arm-linux-gcc to generate PIC
(Program Independent Code) code without GOT (Global Offset Table);

and arm-elf-gcc is designed for operating system independent
applications. For example, arm-elf-gcc will insert code for initializing
global C++ constructors at the beginning of main(), so even no-OS
platforms can work properly. BTW, they are almost the same while
compiling the Linux kernel.
回复

使用道具 举报

发表于 2005-6-4 13:11:37 | 显示全部楼层
不错!
回复

使用道具 举报

发表于 2005-6-4 13:32:08 | 显示全部楼层
[quote:a7c6307249="limingth"]这个是经典问题了,可以看看 uclinux 实现上添加用户程序的视频教程
http://www.lumit.org/dn_video.htm[/quote]

limingth你的视频用什么软件做的?
谢谢!
回复

使用道具 举报

发表于 2005-6-13 17:43:44 | 显示全部楼层
HyperCam ,很好用的。  
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-23 07:08 , Processed in 0.088331 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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