[ECOS] Native file access under eCos synthetic

Bart Veer bartv@redhat.com
Fri Dec 7 05:57:00 GMT 2001


>>>>> "Andrew" == Andrew Lunn <andrew.lunn@ascom.ch> writes:

    >> I call for that cyg_hal_sys_getcwd() declared in <cyg/hal/hal_io.h>: 
    >> externC char * cyg_hal_sys_getcwd(char * buf, size_t size);

    Andrew> You need to add the assembly language this implements this
    Andrew> function. The assembly needs to put the parameters onto
    Andrew> the stack, do the trap and then cleanup.

    Andrew> There are macros to do all the work. Look in

    Andrew> /packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S

    Andrew> getcwd seems to take two parameters, so you probably
    Andrew> need....

    Andrew> SYSCALL2(getcwd)

Correct and I have added cyg_hal_sys_getcwd() to the current sources.
However note that the system call returns an integer, not a char*,
corresponding to the number of characters in the buffer - see
/usr/src/linux-2.4/fs/dcache.h for more information.

Bart



More information about the Ecos-discuss mailing list