<?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; Raghav</title>
	<atom:link href="https://www.emblogic.com/blog/author/raghav-kesar/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>Installing Arduino IDE in Fedora OS</title>
		<link>https://www.emblogic.com/blog/05/installing-arduino-ide-in-fedora-os/</link>
		<comments>https://www.emblogic.com/blog/05/installing-arduino-ide-in-fedora-os/#comments</comments>
		<pubDate>Sun, 18 May 2014 06:13:32 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10133</guid>
		<description><![CDATA[ Open the terminal First you log in as a super user $ su $ password: ******* After you log in as a super user, download these packages given below. yum install arduino yum install java-1.7.0-openjdk After running these two commands &#8230; <a href="https://www.emblogic.com/blog/05/installing-arduino-ide-in-fedora-os/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="color: #000000"> Open the terminal</p>
<p style="color: #000000">First you log in as a super user</p>
<p style="color: #000000">$ su</p>
<p style="color: #000000">$ password: *******</p>
<p style="color: #000000">After you log in as a super user, download these packages given below.</p>
<p style="color: #000000"><strong>yum install arduino</strong></p>
<p style="color: #000000"><strong>yum install java-1.7.0-openjdk</strong></p>
<p style="color: #000000">After running these two commands , you will find arduino executable file in your file system . Run the executable file.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/installing-arduino-ide-in-fedora-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Character Device Driver</title>
		<link>https://www.emblogic.com/blog/03/writing-character-device-driver/</link>
		<comments>https://www.emblogic.com/blog/03/writing-character-device-driver/#comments</comments>
		<pubDate>Sun, 02 Mar 2014 07:20:02 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8716</guid>
		<description><![CDATA[Following are the important points to note while writing data from user space to kernel space 1. The memory we allocate for creating qsets are architecture dependent, because qsets are the array of pointers which points to quantums i.e. they &#8230; <a href="https://www.emblogic.com/blog/03/writing-character-device-driver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Following are the important points to note while writing data from user space to kernel space</p>
<p>1. The memory we allocate for creating qsets are architecture dependent, because qsets are the array of pointers which points to quantums i.e. they store the address of quantums.</p>
<p>2. so , for creating 8qsets in 32bit system we need to allocate 32 bytes of memory while in 64 bit system we need to allocate 64bytes of memory</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/writing-character-device-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Interface to Character Device Driver</title>
		<link>https://www.emblogic.com/blog/03/user-interface-to-character-device-driver-2/</link>
		<comments>https://www.emblogic.com/blog/03/user-interface-to-character-device-driver-2/#comments</comments>
		<pubDate>Sun, 02 Mar 2014 07:11:57 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8713</guid>
		<description><![CDATA[RCS file: writef.c,v Working file: writef.c head: 1.15 branch: locks: strict root: 1.15 access list: symbolic names: keyword substitution: kv total revisions: 15;    selected revisions: 15 description: chardev_write() function reside here. —————————- revision 1.15    locked by: root; date: 2014/03/01 11:19:07;  &#8230; <a href="https://www.emblogic.com/blog/03/user-interface-to-character-device-driver-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: writef.c,v<br />
Working file: writef.c<br />
head: 1.15<br />
branch:<br />
locks: strict<br />
root: 1.15<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 15;    selected revisions: 15<br />
description:<br />
chardev_write() function reside here.<br />
—————————-<br />
revision 1.15    locked by: root;<br />
date: 2014/03/01 11:19:07;  author: root;  state: Exp;  lines: +5 -0.<br />
Testing……….<br />
—————————-<br />
revision 1.14<br />
date: 2014/03/01 11:13:18;  author: root;  state: Exp;  lines: +15 -7<br />
The copy_from_user() function is used to copy a block of data from user space into the kernel buffer.copy_from_user() function contains 3 arguments:<br />
1.A destination buffer,<br />
2.A source buffer,and<br />
3.length in bytes.<br />
—————————-<br />
revision 1.13<br />
date: 2014/03/01 11:06:21;  author: root;  state: Exp;  lines: +2 -1<br />
Done memset().<br />
Testing the code…..<br />
—————————-<br />
revision 1.12<br />
date: 2014/03/01 11:01:16;  author: root;  state: Exp;  lines: +54 -5<br />
create_quantums() function that will create the required number of quantums.<br />
Kmalloc() is used to allocate memory for each quantum. No. of quantums are dependent on how many number of bytes we are writing from user space.<br />
Filling the memory allocated using kmalloc() with memset() so that it does not contain any garbage.<br />
—————————-<br />
revision 1.11<br />
date: 2014/03/01 10:39:39;  author: root;  state: Exp;  lines: +1 -0<br />
memset() function is used to fill the memory allocated for the qset array to ”.<br />
—————————-<br />
revision 1.10<br />
date: 2014/03/01 10:36:59;  author: root;  state: Exp;  lines: +14 -4<br />
Using kmalloc() memory is allocated to the required number of qsets , The memory allocated for qset depends upon the architecture of the OS, if the architecture is of 64 bytes then each qset required 8 byte of memory . and 4 bytes for 32 bit OS.Checking whether it is working fine or not.<br />
—————————-<br />
revision 1.9<br />
date: 2014/03/01 10:26:27;  author: root;  state: Exp;  lines: +36 -2<br />
Implemented create_scullqset() function.Now checking the number of qsets that needs to created by using the size argument of the chardev_write().After determining the number of qsets that needs to be created create_qset() function is called.<br />
—————————-<br />
revision 1.8<br />
date: 2014/03/01 10:07:44;  author: root;  state: Exp;  lines: +2 -1<br />
memset() function to clear the garbage ” .<br />
—————————-<br />
revision 1.7<br />
date: 2014/03/01 10:04:21;  author: root;  state: Exp;  lines: +10 -0<br />
Allocating memory for 1 scullqset using kmalloc<br />
—————————-<br />
revision 1.6<br />
date: 2014/03/01 09:56:22;  author: root;  state: Exp;  lines: +22 -2<br />
After finding out the number of scullqsets,create_scullqset() function is called to create the specified number of scullqsets.<br />
Checking whether the function calling is taking place or not……<br />
—————————-<br />
revision 1.5<br />
date: 2014/03/01 09:47:56;  author: root;  state: Exp;  lines: +19 -0<br />
The size argument that specifies the size of the buffer pointed to by ubuff is used to find the number of scullqsets that needs to be created.<br />
After finding out the exact number of scullqsets that needs to be created,the number of scullqsets are printed.<br />
Creating scullqsets…….<br />
—————————-<br />
revision 1.4<br />
date: 2014/03/01 09:32:34;  author: root;  state: Exp;  lines: +1 -1<br />
Checking whether the ubuff pointer is actually pointing to the buffer in the application.Also checking the size field inside the 3rd argument of chardev_write().<br />
—————————-<br />
revision 1.3<br />
date: 2014/03/01 09:28:31;  author: root;  state: Exp;  lines: +6 -1</p>
<p>Testing&#8230;.<br />
—————————-<br />
revision 1.2<br />
date: 2014/03/01 09:20:00;  author: root;  state: Exp;  lines: +9 -1<br />
Printing the address inside filep-&gt;private_data to check whether it matches with the address returned by container_of() macro.<br />
A local variable of type Sculldev is declared which will store the address that is present inside filep-&gt;private_data.<br />
—————————-<br />
revision 1.1<br />
date: 2014/02/28 21:33:05;  author: root;  state: Exp;<br />
Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/user-interface-to-character-device-driver-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing data to character device driver</title>
		<link>https://www.emblogic.com/blog/02/writing-data-to-character-device-driver/</link>
		<comments>https://www.emblogic.com/blog/02/writing-data-to-character-device-driver/#comments</comments>
		<pubDate>Sun, 23 Feb 2014 13:44:55 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8559</guid>
		<description><![CDATA[RCS file: wwrite.c,v Working file: wwrite.c head: 1.7 branch: locks: strict raghav: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7;    selected revisions: 7 description: The file_operations structure is defined in linux/fs.h &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.7    locked by: raghav; &#8230; <a href="https://www.emblogic.com/blog/02/writing-data-to-character-device-driver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: wwrite.c,v<br />
Working file: wwrite.c<br />
head: 1.7<br />
branch:<br />
locks: strict<br />
raghav: 1.7<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 7;    selected revisions: 7<br />
description:<br />
The file_operations structure is defined in linux/fs.h<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7    locked by: raghav;<br />
date: 2014/02/23 13:27:46;  author: raghav;  state: Exp;  lines: +3 -2<br />
displayed the data in kernel using copy_from_user<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/02/23 13:25:54;  author: raghav;  state: Exp;  lines: +1 -1<br />
implemented copy_from_user to copy the data from application layer<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/02/23 13:25:12;  author: raghav;  state: Exp;  lines: +1 -1<br />
using kalloc : creating memory for required number of quantums<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/23 13:23:58;  author: raghav;  state: Exp;  lines: +1 -1<br />
now count the number of qset required<br />
allocating memory for required number of qset<br />
implemented memset for qset memory<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/23 13:22:57;  author: raghav;  state: Exp;  lines: +1 -1<br />
Allocating memory for scullqset and also clean this memory using memset<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/23 13:22:09;  author: raghav;  state: Exp;  lines: +1 -2<br />
count the number of scullQset required<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/23 13:20:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/writing-data-to-character-device-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing cdev_del() — remove a cdev from the system</title>
		<link>https://www.emblogic.com/blog/02/implementing-cdev_del-remove-a-cdev-from-the-system/</link>
		<comments>https://www.emblogic.com/blog/02/implementing-cdev_del-remove-a-cdev-from-the-system/#comments</comments>
		<pubDate>Sun, 23 Feb 2014 13:13:26 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8556</guid>
		<description><![CDATA[RCS file: clean.c,v Working file: clean.c head: 1.3 branch: locks: strict raghav: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3;    selected revisions: 3 description: to delete the chr_dev structure which we had initialized during chr_dev init &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8230; <a href="https://www.emblogic.com/blog/02/implementing-cdev_del-remove-a-cdev-from-the-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: clean.c,v<br />
Working file: clean.c<br />
head: 1.3<br />
branch:<br />
locks: strict<br />
raghav: 1.3<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 3;    selected revisions: 3<br />
description:<br />
to delete the chr_dev structure which we had initialized during chr_dev init<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3    locked by: raghav;<br />
date: 2014/02/23 13:09:42;  author: raghav;  state: Exp;  lines: +2 -2<br />
now unregistering the driver from the driver table using major minor number.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/23 13:09:07;  author: raghav;  state: Exp;  lines: +1 -1<br />
kfree — free previously allocated memory<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/23 13:08:14;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/implementing-cdev_del-remove-a-cdev-from-the-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing Command Line Arguments to a Module</title>
		<link>https://www.emblogic.com/blog/02/passing-command-line-arguments-to-a-module/</link>
		<comments>https://www.emblogic.com/blog/02/passing-command-line-arguments-to-a-module/#comments</comments>
		<pubDate>Fri, 21 Feb 2014 03:59:07 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8444</guid>
		<description><![CDATA[Driver Modules can take command line arguments, but not with the argc/argv you might be used to. To allow arguments to be passed to your module, declare the variables that will take the values of the command line arguments as &#8230; <a href="https://www.emblogic.com/blog/02/passing-command-line-arguments-to-a-module/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Driver Modules can take command line arguments, but not with the <tt>argc</tt>/<tt>argv</tt> you might be used to.</p>
<p>To allow arguments to be passed to your module, declare the variables that will take the values of the command line arguments as global and then use the <tt>module_param()</tt> macro, (defined in <tt>linux/moduleparam.h</tt>) to set the mechanism up. At runtime, insmod will fill the variables with any command line arguments that are given, like <strong>./insmod mymodule.ko myvariable=5</strong></p>
<p><strong></strong><br />
RCS file: header.h,v<br />
Working file: header.h<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
raghav: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
including linux/moduleparam.h<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1    locked by: raghav;<br />
date: 2014/02/21 03:49:24;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: entry.c,v<br />
Working file: entry.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
raghav: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
included module_param()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1    locked by: raghav;<br />
date: 2014/02/21 03:52:45;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/passing-command-line-arguments-to-a-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Program to delete a file using file handling in c</title>
		<link>https://www.emblogic.com/blog/02/program-to-delete-a-file-using-file-handling-in-c/</link>
		<comments>https://www.emblogic.com/blog/02/program-to-delete-a-file-using-file-handling-in-c/#comments</comments>
		<pubDate>Sun, 16 Feb 2014 13:52:28 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8396</guid>
		<description><![CDATA[RCS file: x.c,v Working file: x.c raghav: 1.5 access list: keyword substitution: kv total revisions: 5;    selected revisions: 5 description: Program to delete any file using file handling in c With function remove() we can delete/remove any file from the &#8230; <a href="https://www.emblogic.com/blog/02/program-to-delete-a-file-using-file-handling-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: x.c,v<br />
Working file: x.c<br />
raghav: 1.5<br />
access list:<br />
keyword substitution: kv<br />
total revisions: 5;    selected revisions: 5<br />
description:<br />
<strong>Program to delete any file using file handling in c</strong></p>
<p>With function <strong>remove()</strong> we can delete/remove <strong></strong> any file from the file system . remove function takes argument as path of the file . and on success it returns 0.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5    locked by: raghav;<br />
date: 2014/02/16 13:50:15;  author: raghav;  state: Exp;  lines: +1 -0<br />
remove function returns 0 on sucess .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/16 13:48:28;  author: raghav;  state: Exp;  lines: +1 -1<br />
use of remove function to remove the file by writing the path of the file which we want to delete<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/16 13:47:46;  author: raghav;  state: Exp;  lines: +1 -1<br />
input the name of file which we want to delete using gets function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/16 13:46:43;  author: raghav;  state: Exp;  lines: +1 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/16 13:46:14;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/program-to-delete-a-file-using-file-handling-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User interface to Character Device Driver</title>
		<link>https://www.emblogic.com/blog/02/user-interface-to-character-device-driver/</link>
		<comments>https://www.emblogic.com/blog/02/user-interface-to-character-device-driver/#comments</comments>
		<pubDate>Sun, 16 Feb 2014 13:27:00 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8393</guid>
		<description><![CDATA[There are few steps to follow to open a file inside kernel from application layer. 1. Insert your character device driver inside the kernel using insmod and check its entry in the device driver table using cat /proc/devices and note &#8230; <a href="https://www.emblogic.com/blog/02/user-interface-to-character-device-driver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>There are few steps to follow to open a file inside kernel from application layer.</strong></p>
<p><strong></strong>1. Insert your character device driver inside the kernel using <strong>insmod</strong> and check its entry in the device driver table using <strong>cat /proc/devices</strong> and note down its major minor number.</p>
<p>2. Now make a node using <strong>mknod </strong>following with node name character and major minor number example<strong> :   mknod nod c 250 0</strong></p>
<p>3. Next step is to run a file (application.c) in the application layer and through the help of node open the file inside the kernel  <strong>:    fd=open(&#8220;nod&#8221;,O_RDWR);</strong></p>
<p>include this statement in the file (application.c) which is in the application layer</p>
<p>4. After executing the application.c file which is in the application layer. check the fd returned by open function. If it is positive, that means file is opened successfully.</p>
<p>5.Last step to unlink the node using <strong>unlink node </strong>and remove the driver using <strong>rmmod</strong></p>
<p>/////////////////////////////////////////////////////////////////////////////</p>
<p>RCS file: clean.c,v<br />
Working file: open.c<br />
head: 1.5<br />
branch:<br />
locks: strict<br />
raghav: 1.5<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 5;    selected revisions: 5<br />
description:<br />
Creating a node between user and kernerl level using mknod following with node name and c for character device driver and combination of major minor no.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5    locked by: raghav;<br />
date: 2014/02/13 11:20:48;  author: raghav;  state: Exp;  lines: +2 -0<br />
creating a file in application layer and now this file will open the file inside the kernel level using node<br />
we can check it: whether its working or not by printing the fd returned from open func. if its negative then operation unsuccessful.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/13 10:19:28;  author: raghav;  state: Exp;  lines: +1 -1<br />
Error detected: defination of scull_open function whose arguments are struct i node and struct file<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/13 10:18:05;  author: raghav;  state: Exp;  lines: +6 -5</p>
<p>Including the open.o in the Make file.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 06:09:06;  author: raghav;  state: Exp;  lines: +3 -5<br />
included the struct file_operation Scull_ops.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:58:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/user-interface-to-character-device-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unregistering a character device driver from device table</title>
		<link>https://www.emblogic.com/blog/02/unregistering-a-character-device-driver-from-device-table/</link>
		<comments>https://www.emblogic.com/blog/02/unregistering-a-character-device-driver-from-device-table/#comments</comments>
		<pubDate>Sat, 15 Feb 2014 07:24:19 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8359</guid>
		<description><![CDATA[There are some points which we have to note down while working in character device driver: 1. The second argument of unregister_chrdev_region function means the number of devices to unregister from the device table &#8230;.  should be matched with the &#8230; <a href="https://www.emblogic.com/blog/02/unregistering-a-character-device-driver-from-device-table/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are some points which we have to note down while working in character device driver:<br />
1. The second argument of <strong>unregister_chrdev_region</strong> function means the number of devices to unregister from the device table &#8230;.  should be matched with the third argument of <strong>alloc_chrdev_region</strong> function. Else the driver entry will not remove from the device table.</p>
<p>RCS file: clean.c,v<br />
Working file: clean.c<br />
head: 1.5<br />
branch:<br />
locks: strict<br />
raghav: 1.5<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 5;    selected revisions: 5<br />
description:<br />
included the unregister_chrdev_region to unregister the device<br />
to do so we need the major minor number.<br />
which we&#8217;ll get from the first argv of alloc_chrdev_region<br />
as i am using seperate files so , i have to use this dev_t dev as a extern in exit function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5    locked by: raghav;<br />
date: 2014/02/13 11:20:48;  author: raghav;  state: Exp;  lines: +2 -0<br />
adding kfree function to free the allocated memory of struct sculldev after removing and un registering the device<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/13 10:19:28;  author: raghav;  state: Exp;  lines: +1 -1<br />
Error detected: In the second argument of unregister_chrdev_region func() we have to input only that number of drivers which we have registered.<br />
suppose if we have register our driver for 10 devices then in the unregister fun() we have to unregister 10 devices i.e give 10 in the second argument of unregister function.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/13 10:18:05;  author: raghav;  state: Exp;  lines: +6 -5<br />
Error in un registering the driver from the driver table<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 06:09:06;  author: raghav;  state: Exp;  lines: +3 -5<br />
included the unregister_chrdev_region to unregister the driver, but here its return type is void<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:58:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/unregistering-a-character-device-driver-from-device-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a character device driver to the system using cdev_add</title>
		<link>https://www.emblogic.com/blog/02/adding-a-character-device-to-the-system-using-cdev_add/</link>
		<comments>https://www.emblogic.com/blog/02/adding-a-character-device-to-the-system-using-cdev_add/#comments</comments>
		<pubDate>Thu, 13 Feb 2014 11:27:13 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8347</guid>
		<description><![CDATA[Implementing cdev_add and cdev_init RCS file: header.h,v Working file: header.h head: 1.4 branch: locks: strict raghav: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4;    selected revisions: 4 description: This is a seperate header file where i have &#8230; <a href="https://www.emblogic.com/blog/02/adding-a-character-device-to-the-system-using-cdev_add/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Implementing cdev_add and cdev_init</strong><br />
RCS file: header.h,v<br />
Working file: header.h<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
raghav: 1.4<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
This is a seperate header file where i have included all the necessary header file required for writing character<br />
including linux/init.h and linux/module.h<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4    locked by: raghav;<br />
date: 2014/02/13 11:01:53;  author: raghav;  state: Exp;  lines: +33 -1<br />
&lt;included &lt;linux/slab&gt; for kalloc function to allocate memory to struct scull_dev<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/13 05:47:34;  author: raghav;  state: Exp;  lines: +0 -1<br />
header file &lt;init.h&gt; is included to support module_init and module_exit<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 05:24:24;  author: raghav;  state: Exp;  lines: +0 -1<br />
Included the module licence GPL to make it authorized<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:23:05;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: entry.c,v<br />
Working file: entry.c<br />
head: 1.9<br />
branch:<br />
locks:<br />
raghav: 1.9<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 9;    selected revisions: 9<br />
description:<br />
program to insert a driver file inside our kernel<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9    locked by: raghav;<br />
date: 2014/02/13 11:12:56;  author: raghav;  state: Exp;  lines: +24 -14<br />
cdev_add function is added the character device to the system<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/02/13 06:55:08;  author: raghav;  state: Exp;  lines: +8 -3<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/02/13 05:43:43;  author: raghav;  state: Exp;  lines: +10 -15<br />
included the alloc_chrdev_region to register the driver number and get the major and minor number using its first argument dev<br />
Major no is allocated by kernel and minor no is allocated by driver to devices<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/02/11 12:33:38;  author: raghav;  state: Exp;  lines: +2 -2<br />
ERROR: i was using name function name &#8220;out&#8221; for exit function<br />
Now i changed it to outo , and now it works without showing any bug<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/02/11 12:31:14;  author: raghav;  state: Exp;  lines: +2 -1<br />
ERROR: forget to write retern 0 in init function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/11 12:27:34;  author: raghav;  state: Exp;  lines: +5 -5<br />
creating  a seperate Makefile to execute both files init.o and exit.o<br />
This make file is important as we can&#8217;t compile out init func seperately<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/11 12:17:12;  author: raghav;  state: Exp;  lines: +14 -0<br />
using module init function to insert the file inside the kernel and exit function is used to remove the file from kernel<br />
Make sure dont use the same function name as init and exit are built in name and already defined inside kernels else it will create a problem<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/11 12:12:17;  author: raghav;  state: Exp;  lines: +2 -1<br />
Inclluding linux/module.h and linux/init.h<br />
and including MODULE_LICENCE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/11 12:10:44;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: clean.c,v<br />
Working file: clean.c<br />
head: 1.5<br />
branch:<br />
locks: strict<br />
raghav: 1.5<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 5;    selected revisions: 5<br />
description:<br />
included the unregister_chrdev_region to unregister the device<br />
to do so we need the major minor number.<br />
which we&#8217;ll get from the first argv of alloc_chrdev_region<br />
as i am using seperate files so , i have to use this dev_t dev as a extern in exit function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5    locked by: raghav;<br />
date: 2014/02/13 11:20:48;  author: raghav;  state: Exp;  lines: +2 -0<br />
adding kfree function to free the allocated memory of struct sculldev after removing and un registering the device<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/13 10:19:28;  author: raghav;  state: Exp;  lines: +1 -1<br />
Error detected: In the second argument of unregister_chrdev_region func() we have to input only that number of drivers which we have registered.<br />
suppose if we have register our driver for 10 devices then in the unregister fun() we have to unregister 10 devices i.e give 10 in the second argument of unregister function.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/13 10:18:05;  author: raghav;  state: Exp;  lines: +6 -5<br />
Error in un registering the driver from the driver table<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 06:09:06;  author: raghav;  state: Exp;  lines: +3 -5<br />
included the unregister_chrdev_region to unregister the driver, but here its return type is void<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:58:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/adding-a-character-device-to-the-system-using-cdev_add/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem in registering and unregistering driver in kernel</title>
		<link>https://www.emblogic.com/blog/02/problem-in-registering-and-unregistering-driver-in-kernel/</link>
		<comments>https://www.emblogic.com/blog/02/problem-in-registering-and-unregistering-driver-in-kernel/#comments</comments>
		<pubDate>Thu, 13 Feb 2014 10:33:25 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8343</guid>
		<description><![CDATA[There are some problems which we faced in un- registering the driver 1. there is no return type of unregister_chrdev_region , so you can check the result only by using vim /proc/devices after rmmod command 2. suppose if you are &#8230; <a href="https://www.emblogic.com/blog/02/problem-in-registering-and-unregistering-driver-in-kernel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are some problems which we faced in un- registering the driver</p>
<p>1. there is no return type of<strong> unregister_chrdev_region</strong> , so you can check the result only by using <strong>vim /proc/devices</strong> after <strong>rmmod</strong> command</p>
<p>2. suppose if you are registering 10 devices using  <strong>alloc_chrdev_region</strong> then you have to give 10 on the second argument of <strong>unregister_chrdev_region</strong> function, else it will not remove the driver entry from the driver table.</p>
<p>RCS file: clean.c,v<br />
Working file: clean.c<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
included the unregister_chrdev_region to unregister the device<br />
to do so we need the major minor number.<br />
which we&#8217;ll get from the first argv of alloc_chrdev_region<br />
as i am using seperate files so , i have to use this dev_t dev as a extern in exit function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/13 10:19:28;  author: raghav;  state: Exp;  lines: +1 -1<br />
Error detected: In the second argument of unregister_chrdev_region func() we have to input only that number of drivers which we have registered.<br />
suppose if we have register our driver for 10 devices then in the unregister fun() we have to unregister 10 devices i.e give 10 in the second argument of unregister function.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/13 10:18:05;  author: raghav;  state: Exp;  lines: +6 -5<br />
Error in un registering the driver from the driver table<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 06:09:06;  author: raghav;  state: Exp;  lines: +3 -5<br />
included the unregister_chrdev_region to unregister the driver, but here its return type is void<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:58:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/problem-in-registering-and-unregistering-driver-in-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Registering a character device driver with Major and Minor number in kernel</title>
		<link>https://www.emblogic.com/blog/02/registering-a-character-device-driver-with-major-and-minor-number-in-kernel/</link>
		<comments>https://www.emblogic.com/blog/02/registering-a-character-device-driver-with-major-and-minor-number-in-kernel/#comments</comments>
		<pubDate>Thu, 13 Feb 2014 07:27:33 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8337</guid>
		<description><![CDATA[RCS file: header.h,v Working file: header.h head: 1.3 branch: locks: strict raghav: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3;    selected revisions: 3 description: This is a seperate header file where i have included all the necessary &#8230; <a href="https://www.emblogic.com/blog/02/registering-a-character-device-driver-with-major-and-minor-number-in-kernel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: header.h,v<br />
Working file: header.h<br />
head: 1.3<br />
branch:<br />
locks: strict<br />
raghav: 1.3<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 3;    selected revisions: 3<br />
description:<br />
This is a seperate header file where i have included all the necessary header file required for writing character<br />
including linux/init.h and linux/module.h<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3    locked by: raghav;<br />
date: 2014/02/13 05:47:34;  author: raghav;  state: Exp;  lines: +0 -1<br />
header file &lt;init.h&gt; is included to support module_init and module_exit<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/13 05:24:24;  author: raghav;  state: Exp;  lines: +0 -1<br />
Included the module licence GPL to make it authorized<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:23:05;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: entry.c,v<br />
Working file: entry.c<br />
head: 1.7<br />
branch:<br />
locks: strict<br />
raghav: 1.7<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 7;    selected revisions: 7<br />
description:<br />
program to insert a driver file inside our kernel<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7    locked by: raghav;<br />
date: 2014/02/13 05:43:43;  author: raghav;  state: Exp;  lines: +10 -15<br />
included the alloc_chrdev_region to register the driver number and get the major and minor number using its first argument dev<br />
Major no is allocated by kernel and minor no is allocated by driver to devices<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/02/11 12:33:38;  author: raghav;  state: Exp;  lines: +2 -2<br />
ERROR: i was using name function name &#8220;out&#8221; for exit function<br />
Now i changed it to outo , and now it works without showing any bug<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/02/11 12:31:14;  author: raghav;  state: Exp;  lines: +2 -1<br />
ERROR: forget to write retern 0 in init function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/11 12:27:34;  author: raghav;  state: Exp;  lines: +5 -5<br />
creating  a seperate Makefile to execute both files init.o and exit.o<br />
This make file is important as we can&#8217;t compile out init func seperately<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/11 12:17:12;  author: raghav;  state: Exp;  lines: +14 -0<br />
using module init function to insert the file inside the kernel and exit function is used to remove the file from kernel<br />
Make sure dont use the same function name as init and exit are built in name and already defined inside kernels else it will create a problem<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/11 12:12:17;  author: raghav;  state: Exp;  lines: +2 -1<br />
Inclluding linux/module.h and linux/init.h<br />
and including MODULE_LICENCE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/11 12:10:44;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS file: clean.c,v<br />
Working file: clean.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
raghav: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;    selected revisions: 2<br />
description:<br />
included the unregister_chrdev_region to unregister the device<br />
to do so we need the major minor number.<br />
which we&#8217;ll get from the first argv of alloc_chrdev_region<br />
as i am using seperate files so , i have to use this dev_t dev as a extern in exit function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2    locked by: raghav;<br />
date: 2014/02/13 06:09:06;  author: raghav;  state: Exp;  lines: +3 -5<br />
included the unregister_chrdev_region to unregister the driver, but here its return type is void<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/13 05:58:43;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/registering-a-character-device-driver-with-major-and-minor-number-in-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting a file inside a Kernel file system</title>
		<link>https://www.emblogic.com/blog/02/inserting-a-file-inside-a-kernel-file-system/</link>
		<comments>https://www.emblogic.com/blog/02/inserting-a-file-inside-a-kernel-file-system/#comments</comments>
		<pubDate>Tue, 11 Feb 2014 12:48:36 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8294</guid>
		<description><![CDATA[RCS file: entry.c,v Working file: entry.c head: 1.6 branch: locks: strict raghav: 1.6 access list: symbolic names: keyword substitution: kv total revisions: 6;    selected revisions: 6 description: program to insert a driver file inside our kernel &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.6    locked &#8230; <a href="https://www.emblogic.com/blog/02/inserting-a-file-inside-a-kernel-file-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: entry.c,v<br />
Working file: entry.c<br />
head: 1.6<br />
branch:<br />
locks: strict<br />
raghav: 1.6<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 6;    selected revisions: 6<br />
description:<br />
program to insert a driver file inside our kernel<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6    locked by: raghav;<br />
date: 2014/02/11 12:33:38;  author: raghav;  state: Exp;  lines: +2 -2<br />
ERROR: i was using name function name &#8220;out&#8221; for exit function<br />
Now i changed it to outo , and now it works without showing any bug<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/02/11 12:31:14;  author: raghav;  state: Exp;  lines: +2 -1<br />
ERROR: forget to write retern 0 in init function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/11 12:27:34;  author: raghav;  state: Exp;  lines: +5 -5<br />
creating  a seperate Makefile to execute both files init.o and exit.o<br />
This make file is important as we can&#8217;t compile out init func seperately<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/11 12:17:12;  author: raghav;  state: Exp;  lines: +14 -0<br />
using module init function to insert the file inside the kernel and exit function is used to remove the file from kernel<br />
Make sure dont use the same function name as init and exit are built in name and already defined inside kernels else it will create a problem<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/11 12:12:17;  author: raghav;  state: Exp;  lines: +2 -1<br />
Inclluding linux/module.h and linux/init.h<br />
and including MODULE_LICENCE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/11 12:10:44;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/inserting-a-file-inside-a-kernel-file-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing Semaphore in a single process by setting its initial value to ZERO</title>
		<link>https://www.emblogic.com/blog/01/implementating-semaphore-in-a-single-process-by-setting-its-initial-value-to-zero/</link>
		<comments>https://www.emblogic.com/blog/01/implementating-semaphore-in-a-single-process-by-setting-its-initial-value-to-zero/#comments</comments>
		<pubDate>Tue, 28 Jan 2014 15:13:56 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8219</guid>
		<description><![CDATA[RCS file: test1.c,v Working file: test1.c head: 1.6 branch: locks: strict raghav: 1.6 access list: symbolic names: keyword substitution: kv total revisions: 6;    selected revisions: 6 description: Implementing semaphore in a single process to check what if &#8230;we set the &#8230; <a href="https://www.emblogic.com/blog/01/implementating-semaphore-in-a-single-process-by-setting-its-initial-value-to-zero/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<ul>
<li>RCS file: test1.c,v<br />
Working file: test1.c<br />
head: 1.6<br />
branch:<br />
locks: strict<br />
raghav: 1.6<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 6;    selected revisions: 6<br />
description:<br />
<strong>Implementing semaphore in a single process to check what if &#8230;we set the value of a semaphore directly to 0.</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6    locked by: raghav;<br />
date: 2014/01/28 14:42:29;  author: raghav;  state: Exp;  lines: +3 -1<br />
Run the program and analyse its output by changing the semaphore from 0 to 1.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/01/28 14:36:22;  author: raghav;  state: Exp;  lines: +19 -0<br />
now. . write two statements in a program.. one before using the wait function and one after using the wait function.<br />
print the value of semaphore using GETVAL before using wait function.<br />
and print the value of semaphore using GETVAL after using wait function i.e. in critical reigon.<br />
make sure one thing if you&#8217;ve set the initial value of semaphore to ZERO, then it will not enter the critical region.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/01/28 14:16:51;  author: raghav;  state: Exp;  lines: +7 -1<br />
after creating the semaphore : set its value to 0(zero)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/01/28 10:39:02;  author: raghav;  state: Exp;  lines: +4 -0<br />
Second use a semctl function to set its value to 0 rather than 1, because we are checking what will happen if we directly set its value to 0<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/01/28 10:37:18;  author: raghav;  state: Exp;  lines: +9 -0<br />
First creating a semaphore using a semget function .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/01/28 10:34:38;  author: raghav;  state: Exp;<br />
Initial revision<br />
=============================================================================</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/implementating-semaphore-in-a-single-process-by-setting-its-initial-value-to-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PROCESS MANAGEMENT</title>
		<link>https://www.emblogic.com/blog/12/process-management-2/</link>
		<comments>https://www.emblogic.com/blog/12/process-management-2/#comments</comments>
		<pubDate>Thu, 26 Dec 2013 15:28:12 +0000</pubDate>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7846</guid>
		<description><![CDATA[&#8220;Process management&#8221; as name itself means to manage the processes. And in terms of Linux OS, processes means &#8220;executing instance&#8221; of a program or we can use a word &#8220;tasks&#8221; for processes. Example: when ever we copy a file or &#8230; <a href="https://www.emblogic.com/blog/12/process-management-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>&#8220;Process management&#8221; as name itself means to manage the processes. And in terms of Linux OS, processes means &#8220;executing instance&#8221; of a program or we can use a word &#8220;tasks&#8221; for processes.</p>
<p>Example: when ever we copy a file or folder from one location to another in windows OS it usually displays  a graph , a moving file, time remaining, how much memory remaining etc. All such things are called processes. But you must have noticed one thing that actually these are different processes which runs under a same program.</p>
<p>so there is parent process and child process. The process which creates another process is called parent process and latter is called child process. And each process has its own PID i.e. process identity number to distinguish the child from the parent.</p>
<p>To get these process IDs in the program</p>
<p>The functions are</p>
<p>getpid() // to get the current process id</p>
<p>getppid() // to get the creator/ parent process id</p>
<p>There are three methods of creating a process:</p>
<p>1. Create a process with the use  of loader from file system.</p>
<p>2. Create a process from the code segment of the current program using system call</p>
<p>3. Duplication of the program</p>
<p>The easiest one is to use a Duplication of  a program</p>
<p>To create a process using this method is done by using &#8220;fork()&#8221;</p>
<p>fork function is a special function use to create a child process from a parent process. Using fork(), child process shares the code segment of its parent but both processes have different physical address. After completion of the child process, child process returns its control to parent and the parent process returns its control to the shell.</p>
<p>child PID= parent PID + 1</p>
<p>PPID of child = PID of parent</p>
<p>fork() returns three values and we can use these values to know which process  is executing</p>
<p>fork() returns following values</p>
<p>0 (zero)    :  if the process is executed by child</p>
<p>+ve value :  means child is created and +ve value is child&#8217;s PID</p>
<p>-ve value  :  ERROR&#8230;! i.e. child process is not created.</p>
<p>NOTE: child process and Parent process both are the part of same program and execute at the same time. It depends on the scheduler that which process executes in which order&#8230;&#8230;.!</p>
<p>Rest i will surely update about how to manage these processes and i will add more stuff related to Process management &#8230;.soon&#8230;!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/process-management-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
