Re: save variables to hard disk at kernel mode

From: Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
Date: Tue Sep 17 2002 - 10:12:11 EST


On Mon, Sep 16, 2002 at 06:23:04PM -0500, Chin-Tser Huang wrote:
> I would like to implement at the kernel a save that
> can periodically store the value of some variables
> to the hard disk. Could anyone please tell me what
> function can I use to achieve this? Will this save
> block the operation of other functions? Thank you
> very much for your help!

This is policy, and policy should be implemented in userland. Have your
driver implement a device node that presents the value when userland
reads it. Imlement a simple userland program that read()s the device
and writes it to whatever file you like. The advantage of this approach
is that userland can decide *where* to write it: on a hard disk, send
it over a network, etc. etc.

Erik

-- 
J.A.K. (Erik) Mouw
Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:19 EST