<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; pankaj.hooda</title>
	<atom:link href="https://www.emblogic.com/blog/author/pankaj-hooda/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>detailed info about elf format&#8230;</title>
		<link>https://www.emblogic.com/blog/06/detailed-info-about-elf-format/</link>
		<comments>https://www.emblogic.com/blog/06/detailed-info-about-elf-format/#comments</comments>
		<pubDate>Tue, 12 Jun 2012 05:42:05 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=3205</guid>
		<description><![CDATA[Starting The question is simple: how does linux execute my main()? Through this document, I&#8217;ll use the following simple C program to illustrate how it works. It&#8217;s called &#8220;simple.c&#8221; main() { return(0); } Build &#160; gcc -o simple simple.c What&#8217;s &#8230; <a href="https://www.emblogic.com/blog/06/detailed-info-about-elf-format/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Starting</h2>
<p>The question is simple: how does linux execute my main()?<br />
Through this document, I&#8217;ll use the following simple C program to illustrate how it works. It&#8217;s called &#8220;simple.c&#8221;</p>
<pre>main()
{
   return(0);
}</pre>
<h2>Build</h2>
<p>&nbsp;</p>
<pre>gcc -o simple simple.c</pre>
<h2>What&#8217;s in the executable?</h2>
<p>To see what&#8217;s in the executable, let&#8217;s use a tool &#8220;objdump&#8221;</p>
<pre>objdump -f simple

simple:     file format elf32-i386
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x080482d0</pre>
<p>The output gives us some critical information about the executable.<br />
First of all, the file is &#8220;ELF32&#8243; format. Second of all, the start address is &#8220;0x080482d0&#8243;</p>
<h2>What&#8217;s ELF?</h2>
<p>ELF is acronym for Executable and Linking Format. It&#8217;s one of several object and executable file formats used on Unix systems. For our discussion, the interesting thing about ELF is its header format. Every ELF executable has ELF header, which is the following.</p>
<pre>typedef struct
{
	unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
	Elf32_Half	e_type;			/* Object file type */
	Elf32_Half	e_machine;		/* Architecture */
	Elf32_Word	e_version;		/* Object file version */
	Elf32_Addr	e_entry;		/* Entry point virtual address */
	Elf32_Off	e_phoff;		/* Program header table file offset */
	Elf32_Off	e_shoff;		/* Section header table file offset */
	Elf32_Word	e_flags;		/* Processor-specific flags */
	Elf32_Half	e_ehsize;		/* ELF header size in bytes */
	Elf32_Half	e_phentsize;		/* Program header table entry size */
	Elf32_Half	e_phnum;		/* Program header table entry count */
	Elf32_Half	e_shentsize;		/* Section header table entry size */
	Elf32_Half	e_shnum;		/* Section header table entry count */
	Elf32_Half	e_shstrndx;		/* Section header string table index */
} Elf32_Ehdr;</pre>
<p>In the above structure, there is &#8220;e_entry&#8221; field, which is starting address of an executable.</p>
<h2>What&#8217;s at address &#8220;0x080482d0&#8243;, that is, starting address?</h2>
<p>For this question, let&#8217;s disassemble &#8220;simple&#8221;. There are several tools to disassemble an executable. I&#8217;ll use objdump for this purpose.</p>
<pre>objdump --disassemble simple</pre>
<p>The output is a little bit long so I&#8217;ll not paste all the output from objdump. Our intention is see what&#8217;s at address 0x080482d0. Here is the output.</p>
<pre>080482d0 &lt;_start&gt;:
 80482d0:       31 ed                   xor    %ebp,%ebp
 80482d2:       5e                      pop    %esi
 80482d3:       89 e1                   mov    %esp,%ecx
 80482d5:       83 e4 f0                and    $0xfffffff0,%esp
 80482d8:       50                      push   %eax
 80482d9:       54                      push   %esp
 80482da:       52                      push   %edx
 80482db:       68 20 84 04 08          push   $0x8048420
 80482e0:       68 74 82 04 08          push   $0x8048274
 80482e5:       51                      push   %ecx
 80482e6:       56                      push   %esi
 80482e7:       68 d0 83 04 08          push   $0x80483d0
 80482ec:       e8 cb ff ff ff          call   80482bc &lt;_init+0x48&gt;
 80482f1:       f4                      hlt    
 80482f2:       89 f6                   mov    %esi,%esi</pre>
<p>Looks like some kind of starting routine called &#8220;_start&#8221; is at the starting address. What it does is clear a register, push some values into stack and call a function. According to this instruction, the stack frame should look like this.</p>
<pre>Stack Top	-------------------
		0x80483d
		-------------------
		esi
		-------------------
		ecx
		-------------------
		0x8048274
		-------------------
		0x8048420
		-------------------
		edx
		-------------------
		esp
		-------------------
		eax
		-------------------

hope u find it useful...thanx</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/06/detailed-info-about-elf-format/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Batch E1 project&#8230;</title>
		<link>https://www.emblogic.com/blog/04/batch-e1-project/</link>
		<comments>https://www.emblogic.com/blog/04/batch-e1-project/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 09:22:33 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=2443</guid>
		<description><![CDATA[PROJECT NAME-&#62; Implementing Chating Across Multiple Systems Through Socket via Sculldriver PROJECT HEAD-&#62; Vaibhav sir Specifications: 1.Used Socket_inet as an ipc mechanism 2.Used semaphore at thread level for each application 3.Send/receive data between applications via driver from sculldev Description: Machine &#8230; <a href="https://www.emblogic.com/blog/04/batch-e1-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>PROJECT NAME-&gt; Implementing Chating Across Multiple Systems Through Socket via Sculldriver</p>
<p>PROJECT HEAD-&gt; Vaibhav sir</p>
<p>Specifications:</p>
<p>1.Used Socket_inet as an ipc mechanism<br />
2.Used semaphore at thread level for each application<br />
3.Send/receive data between applications via driver from sculldev</p>
<p>Description:</p>
<p>Machine 1-&gt;administrator<br />
There will a administrator system which will give open,close and proc system calls to open and close the node into another system containing the driver.</p>
<p>Machine 2-&gt;Server<br />
this system has the lkm which reads and writes the data on the scull using the node</p>
<p>Machine 3 and 4-&gt;reader and writers<br />
These systems will execute read/write system calls.</p>
<p>Data flow from machine 3 to machine 4 is as follows:<br />
        machine 3(write)-&gt;socket-&gt;node-&gt;lkm-&gt;scull &#8211;&gt;&gt;node-&gt;socket-&gt;machine 4(read)</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/04/batch-e1-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>character driver assignments</title>
		<link>https://www.emblogic.com/blog/04/character-driver-assignments/</link>
		<comments>https://www.emblogic.com/blog/04/character-driver-assignments/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 16:24:04 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=2441</guid>
		<description><![CDATA[1.implemented multiple quantam&#8217;s read and write 2.implemented read and write with 2 different application using semaphore 3.implemented read and write using thread 4.implemented sculltrim successfully]]></description>
				<content:encoded><![CDATA[<p>1.implemented multiple quantam&#8217;s read and write<br />
2.implemented read and write with 2 different application using semaphore<br />
3.implemented read and write using thread<br />
4.implemented sculltrim successfully</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/04/character-driver-assignments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>client server using threads</title>
		<link>https://www.emblogic.com/blog/03/client-server-using-threads/</link>
		<comments>https://www.emblogic.com/blog/03/client-server-using-threads/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 07:28:43 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=2201</guid>
		<description><![CDATA[i have completed the client server project using threads&#8230;]]></description>
				<content:encoded><![CDATA[<p>i have completed the client server project using threads&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/client-server-using-threads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>update to siddarth sir&#8230;</title>
		<link>https://www.emblogic.com/blog/02/update-to-siddarth-sir-3/</link>
		<comments>https://www.emblogic.com/blog/02/update-to-siddarth-sir-3/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 12:01:56 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1876</guid>
		<description><![CDATA[completed and uploaded 1,2 and 3 assignment on nas&#8230;]]></description>
				<content:encoded><![CDATA[<p>completed and uploaded 1,2 and 3 assignment on nas&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/update-to-siddarth-sir-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>problem in assignment 2</title>
		<link>https://www.emblogic.com/blog/02/problem-is-assignment-2/</link>
		<comments>https://www.emblogic.com/blog/02/problem-is-assignment-2/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 07:05:37 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1831</guid>
		<description><![CDATA[write a program that accept an integer as an input and displays all prime no. smaller or equal to that integer&#8230;]]></description>
				<content:encoded><![CDATA[<p>write a program that accept an integer as an input and displays all prime no. smaller or equal to that integer&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/problem-is-assignment-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doubt in Double character pointer prg</title>
		<link>https://www.emblogic.com/blog/02/doubt-in-double-character-pointer-prg/</link>
		<comments>https://www.emblogic.com/blog/02/doubt-in-double-character-pointer-prg/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 09:39:40 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1825</guid>
		<description><![CDATA[Why does the compiler inserts a null character in begining of first row only when the no. of rows and columns are to be input by the user and not in successive rows of double pointer&#8230;]]></description>
				<content:encoded><![CDATA[<p>Why does the compiler inserts a null character in begining of first row only when the no. of rows and columns are to be input by the user and not in successive rows of double pointer&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/doubt-in-double-character-pointer-prg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>update to siddarth sir</title>
		<link>https://www.emblogic.com/blog/01/update-to-siddarth-sir-2/</link>
		<comments>https://www.emblogic.com/blog/01/update-to-siddarth-sir-2/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 06:38:14 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1546</guid>
		<description><![CDATA[sir i have completed 1st assignment&#8230;]]></description>
				<content:encoded><![CDATA[<p>sir i have completed 1st assignment&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/update-to-siddarth-sir-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bitwise value of int</title>
		<link>https://www.emblogic.com/blog/01/bitwise-value-of-int/</link>
		<comments>https://www.emblogic.com/blog/01/bitwise-value-of-int/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 15:40:02 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1544</guid>
		<description><![CDATA[why only char pointer gives bytewise value of int datatype&#8230; why an increment in the value of int pointer fetches the address of next int variables after 4 bytes&#8230;not the address of next consecutive int byte&#8230;???]]></description>
				<content:encoded><![CDATA[<p>why only char pointer gives bytewise value of int datatype&#8230;<br />
why an increment in the value of int pointer fetches the address of next int variables after 4 bytes&#8230;not the address of next consecutive int byte&#8230;???</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/bitwise-value-of-int/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>assignment status&#8230;pankaj</title>
		<link>https://www.emblogic.com/blog/01/assignment-status-pankaj-3/</link>
		<comments>https://www.emblogic.com/blog/01/assignment-status-pankaj-3/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 15:32:59 +0000</pubDate>
		<dc:creator><![CDATA[pankaj.hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=1540</guid>
		<description><![CDATA[have completed 20 questions of assignment&#8230;]]></description>
				<content:encoded><![CDATA[<p>have completed 20 questions of assignment&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/assignment-status-pankaj-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
