`clever' C preprocessor trick now causes problems

norume at young.usask.ca norume at young.usask.ca
Tue Sep 25 01:16:37 UTC 2001


Quoting Till Straumann <strauman at SLAC.Stanford.EDU>:

> But typically, these particular files are loaded by a script
> during IOC initialization. Modifying the script would be easy.

I'd prefer that people could use the script distributed with the example IOC application without modification.

> 
> One more thing puzzles me: if the server does relative path lookups,
> it must somehow have chdir()ed before trying to open these files.
> Now: RTEMS' tftp filesystem doesn't support directorys - a chdir by
> the server should fail anyway???

The example application startup script does not change directories.

> 
> I guess, what I'm trying to say is: are there really filenames that are
> hardcoded into IOC core that would have to be modified?

Well, there's "./st.cmd" in the IOC shell.

> 
> In this case, neither gcc nor EPICS seems to be the problem but the
> rudimentary
> implementation of filesystems in RTEMS and the lack of directory support
> in
> TFTPfs.

True, but the TFTP filesystem does support directories the the extent that the startup scripts use them.  Here's the startup script from exampleApp:
============================================================
dbLoadDatabase("../../dbd/example.dbd",0,0)
registerRecordDeviceDriver(pdbbase) 
dbLoadRecords("../../db/dbExample1.db","user=norume")
dbLoadRecords("../../db/dbExample2.db","user=norume,no=1,scan=1 second")
dbLoadRecords("../../db/dbExample2.db","user=norume,no=2,scan=2 second")
dbLoadRecords("../../db/dbExample2.db","user=norume,no=3,scan=5 second")
iocInit()
#seq sncExample,"user=norume"
============================================================

On my TFTP server these appear as:
/tftpboot/epics/norumx3/bin/example.bt
/tftpboot/epics/norumx3/dbd/example.dbd
/tftpboot/epics/norumx3/db/dbExample1.db
/tftpboot/epics/norumx3/db/dbExample2.db
/tftpboot/epics/norumx3/st.cmd

As you can see: 
1) There are no `cd' commands in the script.
2) I can use the same startup script on Linux, vxWorks, and RTEMS since the EPICS IOC shell alwaye begins reading commands from "./st.cmd".

> 
> Does anybody have an idea about how hard it would be to port an NFS
> client
> to
> RTEMS?

It's on my `to do' list, but way, way, way down.  If possible I'd like to find a backwards-compatible solution to this, since the CLS is using EPICS/RTEMS for production work.

-- 
Eric Norum                                 eric.norum at usask.ca
Department of Electrical Engineering       Phone: (306) 966-5394
University of Saskatchewan                 FAX:   (306) 966-5407
Saskatoon, Canada.



More information about the users mailing list