初学uCOS,要建编译环境,忙乎一阵子,今天终于可以了!
网上有很多别人提供的方法,之前总是编译不出。今天找了一个,一下就搞定了。在此列出:
**************************************
bc45编译ucos-II的过程
作者:jinsah 栏目:嵌入式系统
bc45编译ucos-II的过程
费了一天的劲,终于在bc45下编译了ucosII的第一个例子,现在将过程说明如下,献给像我一样的菜鸟们。
1.将ucos_ii的源代码解压到c盘根目录下形成SOFTWARE文件夹
2.将bc45安装在c盘根目录下,形成bc45文件夹
3.将include.h,pc.h,ucos_ii.h,os_cfg.h和os_cpu.h这几个文件拷贝到bc45\include文件夹下
4.修改include.h修改为:
//#include "\SOFTWARE\ucos-ii\ix86l\os_cpu.h"
//#include "os_cfg.h"
//#include "\SOFTWARE\blocks\pc\source\pc.h"
//#include "\SOFTWARE\ucos-ii\source\ucos_ii.h"
#include "c:\bc45\include\os_cpu.h"
#include "c:\bc45\include\os_cfg.h"
#include "c:\bc45\include\pc.h"
#include "c:\bc45\include\ucos_ii.h"
5.在bc45环境下建立工程文件ide,选择dos模式
6.在工程文件中添加以下几个文件:
SOFTWARE\ucos_ii\ix86\os_cpu_a.asm
SOFTWARE\ucos_ii\ix86\os_cpu_c.c
SOFTWARE\ucos_ii\ex1_x86l\bc45\source\test.c
SOFTWARE\blocks\pc\bc45\pc.c
SOFTWARE\ucos_ii\source\ucos_ii.c
7.编译运行
****************************************
补充一点:修改ucos_ii.c中包含文件路径
#define OS_GLOBALS /* Declare GLOBAL variables */
#include "includes.h"
#define OS_MASTER_FILE /* Prevent the following files from including includes.h */
#include "C:\SOFTWARE\uCOS-II\SOURCE\os_core.c"
#include "C:\software\ucos-ii\source\os_flag.c"
#include "C:\software\ucos-ii\source\os_mbox.c"
#include "C:\software\ucos-ii\source\os_mem.c"
#include "C:\software\ucos-ii\source\os_mutex.c"
#include "C:\software\ucos-ii\source\os_q.c"
#include "C:\software\ucos-ii\source\os_sem.c"
#include "C:\software\ucos-ii\source\os_task.c"
#include "C:\software\ucos-ii\source\os_time.c"
用户377235 2012-5-7 15:30