From mboxrd@z Thu Jan 1 00:00:00 1970 From: fs.rajat@gmail.com (Rajat Sharma) Date: Fri, 27 May 2011 12:26:47 +0530 Subject: How a program could generate the memory addresses for its variables, when it is about to run? In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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 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 > >