Nemanja Popov wrote:

If you want the host to see a filesystem, then yes, you would need to have
a filesystem stored in the SDRAM. But if you don't mind making the user
programs access the contents of SDRAM directly then you don't need a
filesystem.


Notice that you would face this same problem if you adopt the suggestion
above, using /dev/fpga-sdram as a backing file.  Either way, the host
won't see a filesystem unless one is stored in the SDRAM contents.

File system is not necessary, actually it is not necessary for user programs to access contents of SDRAM directly.

Maybe I didn't explain this correctly...

You need a backing file to use g_file_storage. But that backing file might be one dummy file lying in a FUSE filesystem.

Your FUSE deamon would handle all FUSE requests. When asked about the directory contents it would just reply "well, I have just this one file here called 'backing'" or something like that.

When requested to read from the file it would read from SDRAM and give the data to FUSE, that would in turn give it to g_file_storage. The same goes for writes.

Now the question is, how to access contents of FPGA's SDRAM from host machine, or how the target board will be visible on host, through which device (/dev/sda or ... ?). When using backing file it was visible through /dev/sda, to be precise, through /dev/sda1. Now when backing file is gone, and with no filesystem, I guess that /dev/sda is not in the game, or I'm wrong?

You're wrong, IFAICT. From the host point of view, the way you implement the storage device is not important. For the host this is just a mass storage device, which it can read and write blocks from/into.


Also, how to use that device. Which functions to call (read, write, ioctl ...) ?

It seems that you want to use it like it was a large file: "open" it, seek to the address you want, read the data, and you should get the data that is on the SDRAM at that address.


Of course, this doesn't seem like a good hardware design, and you're paying the price for it. If your SDRAM was just a block device, and it was a user space program that read the images from the CCD and stored them on a filesystem on the SDRAM block device, you wouldn't have any problems at all. You could mount your device on the host system (it could be Windows or Linux) without any special handling, and read the images as separate files. It would all "just work".

--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to