On Tue, Oct 12, 2004 at 18:32:29 +0900, aq wrote: > hello, > > >From what I read in the mailing list, the principle of "never doing > this or that from inside the kernel" is repeated thousand times a day. > We highly appreciate the tireless education of gurus in the list to > the newbies like us ;-) > > For example, to read/write to file from kernelspace is always > undesired. And there is a solution I got from the list: to use > request_firmware() instead. > > But how to use request_firmware() for that trick (to read/write to > file)? Is that encouraged/usual solution? I looked for some examples > about the technique, but to no avail. request_firmware() is for a specific case of loading data that hardware devices need to operate. For different things you want different solutions. If you just want to load or save a configuration, you probably want to talk to a user-space process instead. You can use proc file, device or netlink socket for that. You can even start the process with call_usermodehelper() if there is no suitable process waiting on your proc-file/device/netlink-socket. The reason is, that the user-mode helper can then implement various policies without modifying the kernel. Eg. there might be no writable filesystem, but the helper can send the data to a server. If you insisted on writing to a file, it would be a problem. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@xxxxxx>
Attachment:
signature.asc
Description: Digital signature