<?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; param938</title>
	<atom:link href="https://www.emblogic.com/blog/author/param938/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>program to find sum of two numbers without using operator</title>
		<link>https://www.emblogic.com/blog/08/program-to-find-sum-of-two-numbers-without-using-operator/</link>
		<comments>https://www.emblogic.com/blog/08/program-to-find-sum-of-two-numbers-without-using-operator/#comments</comments>
		<pubDate>Tue, 19 Aug 2014 12:33:54 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11400</guid>
		<description><![CDATA[RCS file: 1.c,v Working file: 1.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.1 locked by: root; date: 2014/08/19 12:34:16; author: root; state: Exp; &#8230; <a href="https://www.emblogic.com/blog/08/program-to-find-sum-of-two-numbers-without-using-operator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: 1.c,v<br />
Working file: 1.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
	root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;	selected revisions: 1<br />
description:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1	locked by: root;<br />
date: 2014/08/19 12:34:16;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/08/program-to-find-sum-of-two-numbers-without-using-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>READING OPERATION IN CHARACTER DRIVER DONE SUCCESSFULLY</title>
		<link>https://www.emblogic.com/blog/07/reading-operation-in-character-driver-done-successfully/</link>
		<comments>https://www.emblogic.com/blog/07/reading-operation-in-character-driver-done-successfully/#comments</comments>
		<pubDate>Thu, 03 Jul 2014 13:46:10 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10736</guid>
		<description><![CDATA[RCS file: sread.c,v Working file: sread.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: this is the reading function to read the data from the kernel space. &#8230; <a href="https://www.emblogic.com/blog/07/reading-operation-in-character-driver-done-successfully/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: sread.c,v<br />
Working file: sread.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
	root: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;	selected revisions: 2<br />
description:<br />
this is the reading function to read the data from the kernel space.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2	locked by: root;<br />
date: 2014/07/01 06:45:56;  author: root;  state: Exp;  lines: +5 -15<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/07/01 05:59:35;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/reading-operation-in-character-driver-done-successfully/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>character driver</title>
		<link>https://www.emblogic.com/blog/05/character-driver-30/</link>
		<comments>https://www.emblogic.com/blog/05/character-driver-30/#comments</comments>
		<pubDate>Mon, 12 May 2014 11:22:42 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10043</guid>
		<description><![CDATA[RCS file: init.c,v Working file: init.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: driver is inserted and registered in kernel space. driver is initialized and add &#8230; <a href="https://www.emblogic.com/blog/05/character-driver-30/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: init.c,v<br />
Working file: init.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
root: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;    selected revisions: 2<br />
description:<br />
driver is inserted and registered in kernel space. driver is initialized and add by using cdev_init and cdev_add.<br />
major and minor no.s are printed.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2    locked by: root;<br />
date: 2014/05/12 11:01:10;  author: root;  state: Exp;  lines: +6 -1<br />
parameters are taken from the user to calculate the no. of scullqset.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/05/08 10:04:44;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: cleanup.c,v<br />
Working file: cleanup.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
unregister is done here&#8230;&#8230;&#8230;.kfree is used to free the memory.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1    locked by: root;<br />
date: 2014/05/08 10:04:50;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: open.c,v<br />
Working file: open.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
root: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;    selected revisions: 2<br />
description:<br />
this is the program to open the device and function performing here.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2    locked by: root;<br />
date: 2014/05/12 11:02:23;  author: root;  state: Exp;  lines: +2 -2<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/05/08 10:04:59;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: release.c,v<br />
Working file: release.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
this is the program to release the device<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1    locked by: root;<br />
date: 2014/05/08 10:05:04;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: swrite.c,v<br />
Working file: swrite.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
this is the function to write the data into the buffer.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1    locked by: root;<br />
date: 2014/05/12 11:02:47;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/character-driver-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>character driver</title>
		<link>https://www.emblogic.com/blog/05/character-driver-29/</link>
		<comments>https://www.emblogic.com/blog/05/character-driver-29/#comments</comments>
		<pubDate>Sun, 11 May 2014 12:06:46 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9976</guid>
		<description><![CDATA[A Linux driver is a Linux module which can be loaded and linked to the kernel at runtime. The driver operates in kernel space and becomes part of the kernel once loaded, the kernel being monolithic. It can then access the symbols &#8230; <a href="https://www.emblogic.com/blog/05/character-driver-29/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="color: #2a2a2a">A Linux driver is a Linux module which can be loaded and linked to the kernel at runtime. The driver operates in <strong>kernel space</strong> and becomes part of the kernel once loaded, the kernel being monolithic. It can then access the symbols exported by the kernel.</p>
<p style="color: #2a2a2a">When the device driver module is loaded, the driver first registers itself as a driver for a particular device specifying a particular Major number.</p>
<p>It uses the call <span style="color: #993366"><strong>register_chrdev</strong></span> function for registration. The call takes the Major number, Minor number, device name and an address of a structure of the type file_operations(discussed later) as argument. In our example, we will be using a major number of 89 . The choice of major number is arbitrary but it has to be unique on the system.</p>
<p>The syntax of register_chrdev is</p>
<p><span style="color: #993366"><strong>int register_chrdev(unsigned int major,const char *name,struct file_operations *fops)</strong></span></p>
<p>Driver is unregistered by calling the <span style="color: #993366"><strong>unregister_chrdev</strong></span> function.</p>
<p style="color: #2a2a2a">Since device driver is a kernel module, it should implement <span style="color: #993366"><strong>init_module</strong></span> and <strong><span style="color: #993366">cleanup_module</span></strong> functions. The register_chrdev call is done in the init_module function  and unregister_chrdev call is done in the cleanup_module function.</p>
<p style="color: #2a2a2a">The register_chrdev call returns a non-negative number on success. If we specify the Major number as 0, the kernel returns a Major number unique at that instant which can be used to create a device file.<br />
A device file can be created either before the driver is loaded if we know the major and minor number beforehand or it can be created later after letting the driver specify a major number for us.</p>
<h2 style="color: #606060">Creating a device file</h2>
<p>A device file is a special file. It can’t just be created using cat or gedit or shell redirection for that matter. The shell command mknod is usually used to create device file. The syntax of mknod is</p>
<p><span style="color: #993366"><strong>mknod path type major minor</strong></span></p>
<p style="color: #2a2a2a">
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/character-driver-29/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inter Processcommunication (IPC),PIPES</title>
		<link>https://www.emblogic.com/blog/03/inter-processcommunication-ipcpipes/</link>
		<comments>https://www.emblogic.com/blog/03/inter-processcommunication-ipcpipes/#comments</comments>
		<pubDate>Sun, 23 Mar 2014 05:34:20 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9282</guid>
		<description><![CDATA[Pipes are used to establish communication between no. of processes. creating a pipe in c: To create a simple pipe with C, we make use of the pipe() system call. It takes a single argument, which is an array of &#8230; <a href="https://www.emblogic.com/blog/03/inter-processcommunication-ipcpipes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Pipes are used to establish communication between no. of processes.</p>
<p>creating a pipe in c:</p>
<p>To create a simple pipe with C, we make use of the pipe() system call. It takes a single argument, which is an array of two integers, and if successful, the array will contain two new file descriptors to be used for the pipeline. After creating a pipe, the process typically spawns a new process (remember the child inherits open file descriptors).</p>
<pre>SYSTEM CALL: pipe();                                                          

  PROTOTYPE: int pipe( int fd[2] );                                             
    RETURNS: 0 on success                                                       
             -1 on error: errno = EMFILE (no free descriptors)                  
                                  EMFILE (system file table is full)            
                                  EFAULT (fd array is not valid)                

  NOTES: fd[0] is set up for reading, fd[1] is set up for writing</pre>
<div> The first integer in the array (element 0) is set up and opened for reading, while the second integer (element 1) is set up and opened for writing. Visually speaking, the output of fd1 becomes the input for fd0. Once again, all data traveling through the pipe moves through the kernel.&nbsp;</p>
<pre>        #include &lt;stdio.h&gt;
        #include &lt;unistd.h&gt;
        #include &lt;sys/types.h&gt;

        main()
        {
                int     fd[2];

                pipe(fd);
                .
                .
        }</pre>
<p>Remember that an array name in C <em>decays</em> into a pointer to its first member. Above, <tt>fd</tt> is equivalent to <tt>&amp;fd[0]</tt>. Once we have established the pipeline, we then fork our new child process:</p>
<p>&nbsp;</p>
<pre>        #include &lt;stdio.h&gt;
        #include &lt;unistd.h&gt;
        #include &lt;sys/types.h&gt;

        main()
        {
                int     fd[2];
                pid_t   childpid;

                pipe(fd);

                if((childpid = fork()) == -1)
                {
                        perror("fork");
                        exit(1);
                }
                .
                .
        }</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/inter-processcommunication-ipcpipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUNCTIONS</title>
		<link>https://www.emblogic.com/blog/03/functions-3/</link>
		<comments>https://www.emblogic.com/blog/03/functions-3/#comments</comments>
		<pubDate>Mon, 03 Mar 2014 06:04:46 +0000</pubDate>
		<dc:creator><![CDATA[param938]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8752</guid>
		<description><![CDATA[A function is a self contained block of statements that have predefined meanings.you can  divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division usually is &#8230; <a href="https://www.emblogic.com/blog/03/functions-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A function is a self contained block of statements that have predefined meanings.you can  divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division usually is so each function performs a specific task.</p>
<p>A function <strong>declaration</strong> tells the compiler about a function&#8217;s name, return type, and parameters. A function <strong>definition</strong> provides the actual body of the function.</p>
<p>Defining a Function:</p>
<p>return_type function_name( parameter list )</p>
<p>{ body of the function }</p>
<ul>
<li><strong>Return Type</strong>: A function may return a value. The <strong>return_type</strong> is the data type of the value the function returns. Some functions perform the desired operations without returning a value. In this case, the return_type is the keyword <strong>void</strong>.</li>
<li><strong>Function Name:</strong> This is the actual name of the function. The function name and the parameter list together constitute the function signature.</li>
<li><strong>Parameters:</strong> A parameter is like a placeholder. When a function is invoked, you pass a value to the parameter. This value is referred to as actual parameter or argument. The parameter list refers to the type, order, and number of the parameters of a function. Parameters are optional; that is, a function may contain no parameters.</li>
<li><strong>Function Body:</strong>The function body contains a collection of statements that define what the function does.</li>
<li>example of function</li>
<li>
<pre>#include &lt;stdio.h&gt;

int mult ( int x, int y );

int main()
{
  int x;
  int y;

  printf( "Please input two numbers to be multiplied: " );
  scanf( "%d", &amp;x );
  scanf( "%d", &amp;y );
  printf( "The product of your two numbers is %d\n", mult( x, y ) );
  getchar(); 
}

int mult (int x, int y)
{
  return x * y;</pre>
</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/functions-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
