Possible to perform asynchronous output in kernel space?

Hello,


I am trying to set up a periodic loop in kernel-space, which is reading 
a current value via analog input and then writing out the transformed 
value via analog output within the same sampling interval, shortly 
before the next read is timed.


To achieve this, i want to use:


- asynchronous read with callback function (where calculations for 
output value and writing to output-buffer are performed)

- asynchronous write, filling only the head position of the data-buffer 
with the value to be written before next read

- an instruction list for triggering both acquisitions simultaneously 
(as described here: 
https://mail.comedi.org/pipermail/comedi/2002-April/002855.html 
<https://mail.comedi.org/pipermail/comedi/2002-April/002855.html>)



Now my problem:


1.) functions supporting asynchronous write are missing in kcomedilib.

-> Is there another possibility to fill the (dma-)buffer given by 
comedi_map? Already knowing the initialization offset of the ringbuffer 
would help a lot.

And: if this worked: Can I somehow get to know, how many usec's in 
advance the card fetches the value, next to be written, from DMA-buffer?


2.) comedi_do_insnlist is missing in kcomedilib as well.

-> can I somehow simulate this functionality in order to get input and 
output synchronized?



A rather bad workaround for all this might be to move to userspace using 
RTAI's LXRT for output value calculations. But in userspace, 
asynchronous output only seems to work by a block-wise transmit of 
buffer's content to the driver, since comedi_poll only accepts 
input-subdevices.



So, do you see any way out of my dilemma? This would help me a lot!

Thousand thanks in advance! :)


Marco

Received on 2006-12-06Z10:46:39