Re: request_firmware() example ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > >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.

OK, let me show an example. I just supposed somehow I modify the ELF
loader (by patching the kernel), and I want the new loader, after
loading the executable into memory, to write the memory process to
somewhere on the disk. How can I do this, if I cannot use read/write
syscall from inside the kernel?

I am sorry if the above example is silly. I just suppose it is the
case to clarify my confusion ;-)

Thank you a lot,
AQ

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux