kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ramasubramanian.rahul@gmail.com (Rahul Ramasubramanian)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How a program could generate the memory addresses for its variables, when it is about to run?
Date: Fri, 27 May 2011 03:11:00 -0400	[thread overview]
Message-ID: <BANLkTimgtgu==Shd+7H8640TOPzM8wXXgg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=K+=_RHE_f35dR_gnmOjyZ2VHHKg@mail.gmail.com>

hi
this may help
http://www.akae.cn/study/ebook/computerscience/Linkers%20and%20Loaders.pdf

On Fri, May 27, 2011 at 2:56 AM, Rajat Sharma <fs.rajat@gmail.com> wrote:

> Hi Sandeep,
>
> probably you want to look at how your program is loaded in memory. For
> example an ELF binary is understood by ELF format handler inside
> kernel. Format handler supply their load_binary methods to load a
> program image im memory and initial its different virtual memory areas
> (stack, heap etc.). exec system call searches for correct format
> handler for you based on file header.
>
> Please go thoroghly through Understanding the Linux Kernel, 3rd
> Edition, Chapter 20. Program ExZecution.
>
> -Rajat
>
> On Fri, May 27, 2011 at 12:14 PM, sandeep kumar
> <coolsandyforyou@gmail.com> wrote:
> > hi all,
> > I am new to the linux kernel internals. I know there is a memory
> management
> > subsystem which handles all the memory related things.
> >
> > But Now i want to know a bit deeper how things work.
> >
> > I want to start with the following question,
> > How a program could generate the memory addresses for its variables, when
> it
> > is about to run?
> >
> > Can please somebody give pointers how to learn this kind of things like,
> > "in the early stages (when our program is about to be executed..about to
> > become a process) what are the things that will be done by the kernel?"
> >
> > Please help me in this regard,
> >
> > Thanking you,
> > Sandeep Kumar A.
> >
> >
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
> >
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110527/b2308d8b/attachment.html 

  reply	other threads:[~2011-05-27  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27  6:44 How a program could generate the memory addresses for its variables, when it is about to run? sandeep kumar
2011-05-27  6:56 ` Rajat Sharma
2011-05-27  7:11   ` Rahul Ramasubramanian [this message]
2011-05-27 17:21 ` Mulyadi Santosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTimgtgu==Shd+7H8640TOPzM8wXXgg@mail.gmail.com' \
    --to=ramasubramanian.rahul@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).