- I created a new project
- I double clicked "Create a bootable VXWorks image (custom configured)"
- I pressed Next
- I selected "An existing project" and pressed Next
- I pressed Finish
- I double clicked on userAppInit.c and modified it as follows:
#include <stdio.h>
...
void usrAppInit (void)
{
...
FILE * f = fopen ("myfile", "r");
if (!f)
printf ("File not found!\n");
else
printf ("File found!\n");
}
- I selected Build (compilation works ok)
- I opened Object Modules, right clicked on vxWorks.exe and selected
Start 'vxWorks.exe'
The simulator starts properly and prints out File not found! even though
myfile is in the same directory as vxWorks.exe. I also tried opening
other files like c:/autoexec.bat but the result is the same. Note that I
didn't touch the default VxWorks component configuration.
Does anybody know what I'm missing?
Thanks very much in advance.
Marco Zandonadi
ntPassFileSystem is needed.
type iosDevShow in the shell
host = your disk that tornado installed .
Marco Zandonadi <myr...@pacbell.net> wrote in message
news:38C19191...@pacbell.net...
Thank you very much, that's what I needed.
I still have one more problem, though. I can successfully create files
with creat() but I can't write() to them. Every write() call on a file
descriptor returned by creat() returns -1.
Any suggestions will be greatly appreciated.
Thank you
Marco
> You should create the file by window NT command at first, then you can use
> creat() and write() functions.
what do you mean by "create the file by window NT command"? If you mean
that I should use a DOS shell I can't do it because I need to open
several tens of files each time I run my program, so it definitely has
to be done inside the program (also these files have different names
each time I run my program).
Thanks.
Marco
for some information (regarding VxWorks / VxSim bugs) to this topic see me
about 5 days old reply to someone here to the subject:
Pass Through Filesystem for VxSim
you have to use the correct fixes and patches at least.
--
regards, Mario Semo. http://www.kirchnersoft.com
Marco Zandonadi wrote in message <38C19191...@pacbell.net>...
Marco Zandonadi <myr...@nospampacbell.net> wrote in message
news:38C41184...@nospampacbell.net...
ok, here is the patch description:
SPR 27918
IDE:
Component: tornado-vxsim
RTOS: Version:
Product Name: Tornado Release#: 2.0 Release Status: FCS
Products Affected: Tornado
Host: Intel x86/Pentium HostOs: HostOSRev: 4.0
Arch Family: SIM NT Arch CPU: SIM NT BSP: Ver:
DESCRIPTION
Using Tornado 2 FCS on Windows NT, simpc target.
The open flags values which VxWorks uses differ from those used by
Windows NT, and ntPassFsLib does not convert between them. For
instance, the O_CREAT flag has value 0x200 in VxWorks, but
value 0x100 in Windows NT. This causes both open (...,O_CREAT | ..., ...)
and creat() to fail on the host: ntPassFsLib device.
WORKAROUND
A patch for this SPR may be downloaded via the Web from the
patches section on WindSurf, or by contacting WRS Customer
Support. The patch title is,
"27918 ntPassFsLib file creation patch".
--
regards, Mario Semo. http://www.kirchnersoft.com
Marco Zandonadi wrote in message <38C41184...@nospampacbell.net>...