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

Re: How arguments are stored on pages linux_bprm (Kernel 2.4)



Thanks for the reply Prashant. What is the purpose of leaving
sizeof(void*) bytes?

Regards,
Dang

On 6/7/06, s prashant <sprashant16@xxxxxxxxx> wrote:
The arguments are copied onto the bprm.pages using the copy_strings api.
bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof (void*) indicates the total
bytes that the pages can accomadate. The arrangement of the arguments onto
the pages is as shown in the figure.

 pages
 ------------------------- ---
 | sizeof (void*) | ^
 |-----------------------| |
 | argv[0] | |
 |-----------------------| 31
 | argv[1] | |
 |-----------------------| |
 | argv[2] | |
 |=======================| ---
 | argv[3] | ^
 |-----------------------| |
 | argv[4] | |
 |-----------------------| 30
 | | | |
 |-----------------------| |
 | | | |
 |=======================| ---
 | | |
 | | |
 | | |
 | | |
 | | |
 | | |
 |=======================| ---
 | | ^
 | | |
 | | |
 | | 0
 | | |
 | | |
 ------------------------ ---



The above info is w.r.t 2.4.21 kernel.
Anybody please correct me if i am wrong.

regards
prashant.


On 6/5/06, Dang <linuxdang@xxxxxxxxx> wrote: > > > > Hi, > I have a requirement of reading command line arguments passed while invoking a binary, inside load_elf_binary(). I tried to read kernel 2.4 code but i am confused how data is stored inside the pages (linux_bprm) > Can anybody point to some document / tutorial or if possible brief me about how it is done? > > Regards, > Dang



--
S Prashant
email:- prashant@xxxxxxxxxxxxx
SolidCore Techsoft Systems India(Pvt)Ltd
A-16, Mohan Co-operative Industrial Estate,
Mathura Road,
New Delhi, 11 00 44
Phone:91 11 51678443


--

Regards,
Dang

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