Forum Discussion
Altera_Forum
Honored Contributor
9 years agoport a file to ecos
hi guys, I'am working with real time operating system Ecos .I need to port a file to this Rtos and run Ecos. so how can i add this file (from...
Altera_Forum
Honored Contributor
9 years agoI work on the ecos operating system, I want to run it on the virtual machine qemu (pc_rltk8139: architecture x86), I downloaded and installed then I started with a small code c "Hello word", which Has worked well.
Then, I develop a code c on the synthetic Linux target (Ubuntu). All the code that I created in c works well on ubuntu, i tried to do the same work on my qemu machine and transferred it to ecos wich it did not work. My code includes a copy program that requires loading data from two text files. An input file(entree.txt) contains data that will be copied to the other output file(sortie.txt). My problem is that I do not know how to integrate my files into an appropriate file system image and how to integrate it into the eCos image. Code c: # include <stdio.h> # include <stdlib.h> # define ENTREE "/home/amine/ecos/eCos-on-QEMU/entree.txt" # define SORTIE "/home/amine/ecos/eCos-on-QEMU/sortie.txt" int main(void) { FILE *f_in, *f_out; int c; if ((f_in = fopen(ENTREE,"r")) == NULL) { fprintf(stderr, "\nErreur: Impossible de lire le fichier 111 %s\n",ENTREE); return(EXIT_FAILURE); } if ((f_out = fopen(SORTIE,"w")) == NULL) { fprintf(stderr, "\nErreur: Impossible d'ecrire dans le fichier 222 %s\n", SORTIE); return(EXIT_FAILURE); } while ((c = fgetc(f_in)) != EOF) fputc(c, f_out); printf("copie correcte\n"); fclose(f_in); fclose(f_out); return(EXIT_SUCCESS); } output message : Erreur: Impossible de lire le fichier 111 /home/amine/ecos/eCos-on-QEMU/entree.txt issue : how to port files to ecos waiting for your guidance. thank you