It is possible to perform file operations from CCS on the host using fopen/fread from stdio. I was expecting "system" from stdlib to be implemented as well but it's not. Is there a workaround to make os system calls on the host from CCS?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
It is possible to perform file operations from CCS on the host using fopen/fread from stdio. I was expecting "system" from stdlib to be implemented as well but it's not. Is there a workaround to make os system calls on the host from CCS?
Yes, you can use the standard C I/O functions, but only while running under CCS. See http://processors.wiki.ti.com/index.php/Tips_for_using_printf. See also the Compiler User's Guide section "The C I/O Functions" in chapter "Run-Time-Support Functions" (section and chapter number vary by ISA).
Sorry I should have been more precise. This is the function in interested in :
http://www.cplusplus.com/reference/clibrary/cstdlib/system/
I've looked at the run-time functions and it's not there. It could be pretty useful. I'm using the standard C I/O functions without any issues. Seems to me that if I can do that I should also be able to make any arbitrary system call on the host. Thanks.
No, there is no way to call system(), and there is no way to call arbitrary host OS functions. C I/O works through a special ABI shared by the compiler library and CCS. CCS knows how to decode a special buffer on the target into which the library encodes requests. The requests are actually handled by CCS. There is no way at this time for the user to extend this ABI. This is in theory possible, but you would need a new feature in CCS to be able to hook your own C I/O handling. There are probably better ways to approach this problem than through the C I/O ABI. What you're looking for is tighter integration between the host OS and target OS, and the compiler library C I/O doesn't really qualify. Perhaps BIOS has addressed this issue?
Thanks,
Actually all I want is for the CCS application to call an executable on the host OS which generates a file which will then be used by the CCS application though the ABI. I can think of other ways to do that but it would have been much more simple if "system" was implemented within the ABI.