maltevesper / JetStream-driver

15 stars 10 forks source link

Why not use low-level IO system call API? #1

Open jonnew opened 6 years ago

jonnew commented 6 years ago

One thing that is fantastic about xillybus is that its API is just low-level system calls (open, read, write) for all IO. This is wonderful because when I write a library or application, I can just spoof data streams using standard files and named pipes rather than having to use actual hardware. It makes testing so easy and makes my code generic in the case that data is actually coming from a file (e.g. data replay). I wonder if this was considered when writing this API. I would love to switch to a fully open source alternative for my project, but I think would need to significantly refactor and probably break this generic IO interface.

maltevesper commented 6 years ago

The idea behind the different API is to support asynchronous I/O and command queuing. There might be a chance for this to be implementable using aio_write. However, as I am no kernel expert I have not looked into the aio_write structure. At the moment, there is no chance that I will get around to implementing the aio_write interface. If you are interested in implementing this, please give me notice and I will share a development branch which has more features that would have to be taken into consideration.