论坛» 嵌入式开发» MCU

vxworks5.5硬盘启动加载程序中出现的问题

菜鸟
2006-04-20 02:30 1楼

我编译好一个tes.out,然后拷到目标机的c盘。

修改vxworks的usrAppInit.c的入口函数usrAppInit为:

/******************************************************************************
*
* usrAppInit - initialize the users application
*/
#include
#include

void usrAppInit (void)
{
#ifdef USER_APPL_INIT
USER_APPL_INIT; /* for backwards compatibility */
#endif

int fd;
usrAtaConfig(0,0,"/ata0");


fd = open("/ata0/test.out",O_RDONLY,0);
if(fd == ERROR)
{
printf("Open module Error!\n");
close(fd);
}
/* add application specific code here */
}

在fd = open("/ata0/test.out",O_RDONLY,0)时返回值总是错误,请问这是怎么回事?

菜鸟
2006-04-20 03:43 2楼
usrAtaConfig的返回值是正确的
菜鸟
2006-04-20 04:57 3楼

First, try to use the ls or ll to verify you dos filesystem is OK.

Second, make sure your test.o is risist in you disk.

菜鸟
2006-04-20 05:13 4楼

1、我的系统是从硬盘启动的,在启动的时候还有提示信息loading /ata0/vxworks……,所以文件系统应该没问题吧

2、我是在dos下把test.out拷贝到C盘的,肯定有。

是不是我的方法有问题?

菜鸟
2006-04-20 05:33 5楼
谢谢xiaohua,确实是dos filesystem的问题,我在配vxworks的时候没有把它加进去。
菜鸟
2006-04-24 19:47 6楼

救命!现在我也是这个问题!

怎么确认我的文件系统有没有问题?

共6条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]