From: Stefan S. <dev...@gm...> - 2012-09-05 06:57:50
|
Hi Nikolaus, On 09/04/2012 03:40 PM, Nikolaus Rath wrote: > Character devices are generally not seekable. You'll need to find a > different solution for your problem. What are you trying to do? > > http://lmgtfy.com/?q=linux+character+device+seek&l=1 I wrote a character device proxy that transparently forwards all requests made to a device to a remote system over a network connection. Thus, for instance, if you open the CUSE device on machine A and write to it, these requests are all forwarded to machine B and the response of those calls is delivered back to machine A. The target system is a custom embedded MIPS system with very limited resources and still running on Linux-2.4. I can not make any adaptations to this system. My goal is to run an application from the embedded system inside a virtual machine. And since the application requires access to the devices on the embedded system, I wrote the CUSE proxy. One advantage of the approach I took is that on the target system, the "server" part of the character device proxy is a normal userland application, meaning that no changes to the system (like kernel changes) are required. It just works out of the box. The target system has custom character devices and at least one of them is definitely seekable. So, while character devices are *generally* not seekable, the one I have really is. I think there was a fuse patchset that made it possible to use a custom lseek implementation. So, in lack of other ideas, I was thinking about adding that functionality to CUSE and patching my kernel. Somehow I need to forward lseek calls made to the target device. Another idea might be to just mount "/dev" from the embedded system in the virtual machine. I was thinking about sshfs for this. But I believe for it to work, the embedded system would need support for sshfs which is does not have. Any ideas ? Cheers, Stefan |