⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adding_user_applications.html

📁 ADI 公司blackfin系列的用户使用文挡。
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title></title>  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><h2><a name="adding_user_applications" id="adding_user_applications">Adding User Applications</a></h2><div class="level2"><p>The following procedure describes how to add a user written application to the uClinux memory image:</p><p>First create a new directory in <code>.../uClinux-dist/user/</code> to store the source files for the new application.  In this example the program and directory will be called <em>myprog</em>.  Next move the source files for the application into this directory.</p><p> <strong>makefiles</strong><br/></p><ul><li class="level1"><div class="li"> the text editor uses only line feeds (LF) to specify line endings.<br/></div></li><li class="level1"><div class="li"> indents are done with tabs, not spaces.</div></li></ul><p></p><p> Next the file <code>.../uClinux-dist/user/Makefile</code> must be edited.  Add a line similar to the following in the included directories section:</p><pre class="code">dir_$(CONFIG_USER_MYPROG_MYPROG)            += myprog</pre><p> If the directory contains two executables, for example <em>myprog1</em> and <em>myprog2</em>, this is changed to:</p><pre class="code">dir_$(CONFIG_USER_MYPROG_MYPROG1)            += myprogdir_$(CONFIG_USER_MYPROG_MYPROG2)            += myprog</pre><p> Next the file <code>.../uClinux-dist/config/</code><code>Configure.help</code> must be edited.  This file contains the text which will be displayed in the help dialog when compiling uClinux.  Add an entry similar to the following:</p><pre class="code">CONFIG_USER_MYPROG_MYPROG  This is my program</pre><p> For two executables in the same directory add entries similar to the following:</p><pre class="code">CONFIG_USER_MYPROG_MYPROG1  This is my program</pre><pre class="code">CONFIG_USER_MYPROG_MYPROG2  This is my program too</pre><p> Each line of the help text must be indented two spaces.  Also, each line must be less than 70 characters long.  There cannot be any blank lines within the help text.</p><p>Next the file <code>.../uClinux-dist/config/</code><code>config.in</code> must be edited.  This file determines which sections programs appear under in the application configuration window.  Under an appropriate section add an entry similar to the following:</p><pre class="code">bool 'myprog'	CONFIG_USER_MYPROG_MYPROG</pre><p> For two executables in the same directory add entries similar to the following:</p><pre class="code">bool 'myprog1'	CONFIG_USER_MYPROG_MYPROG1bool 'myprog2'	CONFIG_USER_MYPROG_MYPROG2</pre><p> Next ensure that there is an appropriate Makefile inside your program&rsquo;s directory, in this example:  <code>.../uClinux-dist/user/myprog/Makefile</code>.  This Makefile should have a form similar to the following:</p><pre class="code">EXEC = myprogOBJS = myprog.oall: $(EXEC)$(EXEC): $(OBJS)	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)romfs:	$(ROMFSINST)    /bin/$(EXEC)clean:	rm -f $(EXEC) *.elf *.gdb *.o</pre><p> The Makefile for two executables in the same directory would be similar to the following:</p><pre class="code">EXEC = myprog1 myprog2OBJS = myprog1.o myprog2.oall: $(EXEC)$(EXEC): $(OBJS)	$(CC) $(LDFLAGS) -o $@ $@.o $(LDLIBS)romfs:	$(ROMFSINST) -e CONFIG_USER_MYPROG_MYPROG1      /bin/myprog1	$(ROMFSINST) -e CONFIG_USER_MYPROG_MYPROG2      /bin/myprog2clean:	-rm -f $(EXEC) *.elf *.gdb *.o</pre><p> <code>...uClinux-dist/user/ping</code><code>.../uClinux-dist/user</code> </p><p>Once these steps are complete, re-compile the uClinux kernel (see <a href="basic_compilation.html" class="wikilink1" title="basic_compilation.html">Basic Compilation</a>).  Your application should now appear in the <strong>application configuration</strong> window under the section you placed it in.  Ensure your application is selected and continue compiling the kernel.  When compilation is finished load the newly created memory image onto the target system.  If your application compiled successfully it should now appear in the <code>/bin</code> directory on the target system.</p></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -