Manually accessing file contents from bprm->file

stl st.lambert02 at gmail.com
Tue Nov 13 11:35:21 EST 2012


Hello,
I  am trying to boot a custom linux-2.6.37 port, but I am stuck at the
point where the kernel launches /init executable (since the initial
filesystem was mounted with initramfs support).

After investigations, it appears that a problem occurs during
prepare_binprm() function.
This function is responsible for copying the 128 bytes header of the
executable to bprm->buf.

However in my case, bprm->buf is filled with zeroes after this step.

The kernel_read() function receives bprm->buf and bprm->file as operand.

So the address in memory (in the initramfs) of the executable should be
accessible from bprm->file (file object of /init).

My question is:
How can I manually (e.g. in the debugger) access the contents of the /init
file (stored in memory, in the initramfs), from the bprm->file structure?
(I'd like to check the data structures are in good shape and correctly
point to the /init contents).

Thanks in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121113/e30c7177/attachment.html 


More information about the Kernelnewbies mailing list