<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Embedded-Linux-Device-Driver%2FC3%2FCreating-a-New-Character-Device%2FEnglish</id>
		<title>Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Embedded-Linux-Device-Driver%2FC3%2FCreating-a-New-Character-Device%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;action=history"/>
		<updated>2026-05-13T15:47:03Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=54286&amp;oldid=prev</id>
		<title>Nancyvarkey at 01:52, 30 October 2020</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=54286&amp;oldid=prev"/>
				<updated>2020-10-30T01:52:48Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 01:52, 30 October 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Class and its device :'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Class and its device :'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * A''' class '''specifies the type of '''device''' that has a similar behavior.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A''' class '''specifies the type of '''device''' that has a similar behavior.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For example, '''audio devices'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For example, '''audio devices'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 104:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 105:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight'''&amp;lt;nowiki&amp;gt; #include&amp;lt;device.h&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight'''&amp;lt;nowiki&amp;gt; #include&amp;lt;device.h&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| We have to include this '''header file.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| We have to include this '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;device.h &lt;/ins&gt;header file.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The''' kernel functions''' that are required to create a new '''device '''are declared in it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The''' kernel functions''' that are required to create a new '''device '''are declared in it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 143:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 144:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''printk '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''printk '''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| On failure, it will unregister the '''device '''and will exit with the failure message.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| On failure, it will &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;unregister&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;the '''device '''and will exit with the failure message.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Otherwise, '''printk '''will print the message that the '''class''' is created successfully.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Otherwise, '''printk '''will print the message that the '''class''' is created successfully.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 149:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 150:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see the''' kernel function''' used to create a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;new &lt;/del&gt;'''device file.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see the''' kernel function''' used to create a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;'''device file.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 169:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 170:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''fmt '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''fmt '''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| We will see the '''parameters''' that are passed to '''device_create() function'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| We will see the '''parameters''' that are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;passed&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;to '''device_create() function'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''class '''specifies the '''device class'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''class '''specifies the '''device class'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 212:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 213:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| These''' functions''' are executed when the''' device file''' creation fails.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| These''' functions''' are executed when the''' device file''' creation fails.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Here, &lt;/del&gt;'''class_destroy()''' will remove the''' class '''of '''device''' from the '''sysfs.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''class_destroy()''' will remove the''' class '''of '''device''' from the '''sysfs.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' printk messages'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' printk messages'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Depending upon its success or failure, the corresponding &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;messages &lt;/del&gt;will be printed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Depending upon its success or failure, the corresponding &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;message &lt;/ins&gt;will be printed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 278:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 279:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let us load the '''driver '''into the''' kernel.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let us load the '''driver '''into the''' kernel.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type''' sudo space su '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and&lt;/del&gt;''' password''' to be a '''superuser'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type''' sudo space su '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Type the&lt;/ins&gt;''' password''' to be a '''superuser'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;For that, type &lt;/del&gt;'''insmod space simple_driver.ko'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Type &lt;/ins&gt;'''insmod space simple_driver.ko'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''clear'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''clear'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 312:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 315:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let’s check whether the '''class''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let’s check whether the '''class''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type the command as shown.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;command&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;as shown.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, you can see the new '''my_class''' is registered successfully.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, you can see the new '''my_class''' is registered successfully.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 318:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 321:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Similarly check whether a '''device''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Similarly check whether a '''device''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type the command as shown.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;command&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;as shown.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This shows that the '''new_device''' is created in the '''sysfs'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This shows that the '''new_device''' is created in the '''sysfs'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 327:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 330:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us check if the '''device file''' is created under the '''dev directory '''or not.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us check if the '''device file''' is created under the '''dev directory '''or not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ls space hyphen l space slash dev slash new_device.&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;command&lt;/ins&gt;''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as shown.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can see the '''new_device file''' is created.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can see the '''new_device file''' is created.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 384:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 387:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Open the '''simple_driver.c file.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Open the '''simple_driver.c file.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a''' device '''with a different name.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a''' device '''with a different name.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Compile and load the '''simple_driver dot c.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Compile&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;and load the '''simple_driver dot c.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# See the newly created '''device file''' under the '''sysfs.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# See the newly created '''device file''' under the '''sysfs.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=54128&amp;oldid=prev</id>
		<title>Nirmala Venkat at 11:00, 26 October 2020</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=54128&amp;oldid=prev"/>
				<updated>2020-10-26T11:00:10Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:00, 26 October 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 82:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 82:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''cd Desktop/DeviceDriver/CreateNewDevice'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''cd Desktop/DeviceDriver/CreateNewDevice'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Go to the directory '''CreateNewDevice''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;as shown here&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Go to the directory &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;where &lt;/ins&gt;'''CreateNewDevice''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is saved on your system&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Press '''Enter key''' after every '''command'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Press '''Enter key''' after every '''command'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 103:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 104:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight'''&amp;lt;nowiki&amp;gt; #include&amp;lt;device.h&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight'''&amp;lt;nowiki&amp;gt; #include&amp;lt;device.h&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;You &lt;/del&gt;have to include this '''header file.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;We &lt;/ins&gt;have to include this '''header file.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The''' kernel functions''' that are required to create a new '''device '''are declared in it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The''' kernel functions''' that are required to create a new '''device '''are declared in it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 311:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 312:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let’s check whether the '''class''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let’s check whether the '''class''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''ls space hyphen l space slash sys slash class slash pipeline grep my underscore class&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the command as shown&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, you can see the new '''my_class''' is registered successfully.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, you can see the new '''my_class''' is registered successfully.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 317:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 318:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Similarly check whether a '''device''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Similarly check whether a '''device''' is created in the '''sysfs '''or not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''ls space hyphen l space slash sys slash class slash my class&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Type &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the command as shown&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This shows that the '''new_device''' is created in the '''sysfs'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This shows that the '''new_device''' is created in the '''sysfs'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 426:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 427:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Mayuri Panchakshari &lt;/del&gt;signing off.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Usha &lt;/ins&gt;signing off.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Thanks for watching.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Thanks for watching.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=53856&amp;oldid=prev</id>
		<title>Nancyvarkey at 06:30, 26 September 2020</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=53856&amp;oldid=prev"/>
				<updated>2020-09-26T06:30:09Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;amp;diff=53856&amp;amp;oldid=53838&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=53838&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot; {| style=&quot;border-spacing:0;&quot; | style=&quot;border:1pt solid #000000;padding:0.176cm;&quot;| '''Visual cue:''' | style=&quot;border:1pt solid #000000;padding:0.176cm;&quot;| '''Narration:'''  |-...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Creating-a-New-Character-Device/English&amp;diff=53838&amp;oldid=prev"/>
				<updated>2020-09-22T09:21:57Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; {| style=&amp;quot;border-spacing:0;&amp;quot; | style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#039;&amp;#039;&amp;#039;Visual cue:&amp;#039;&amp;#039;&amp;#039; | style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &amp;#039;&amp;#039;&amp;#039;Narration:&amp;#039;&amp;#039;&amp;#039;  |-...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| '''Visual cue:'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| '''Narration:'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 1:&lt;br /&gt;
&lt;br /&gt;
Welcome slide:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Welcome to the spoken tutorial on '''Creating a new character device.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 2:&lt;br /&gt;
&lt;br /&gt;
Learning objectives:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| In this tutorial we will learn how to,&lt;br /&gt;
&lt;br /&gt;
* Create a''' class of a device''' in the '''sysfs.'''&lt;br /&gt;
* Create a''' device file''' in '''sysfs '''and''' dev directory. '''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;&amp;quot;| Slide 3:&lt;br /&gt;
&lt;br /&gt;
System Requirements:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| To record this tutorial, I am using,&lt;br /&gt;
&lt;br /&gt;
* '''VirtualBox''' version '''5.2.'''&lt;br /&gt;
* '''Ubuntu Linux 18.04 LTS''' operating system.&lt;br /&gt;
* '''Linux kernel '''version''' 5.0.0-31 generic '''and&lt;br /&gt;
* '''gedit text editor'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 4:&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| To follow this tutorial, you should be familiar with:&lt;br /&gt;
&lt;br /&gt;
* '''C programming language '''and&lt;br /&gt;
* Basics of''' Linux kernel'''&lt;br /&gt;
&lt;br /&gt;
If not, then go through the '''C/C++''' and '''Linux''' spoken tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 5:&lt;br /&gt;
&lt;br /&gt;
'''Class and its device :'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * A''' class '''specifies the type of '''device''' that has a similar behavior.&lt;br /&gt;
* For example, audio devices.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* '''Classes''' provide a grouping of devices based on functionality.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Mostly you can associate a device with a specific '''class'''.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For example, '''block devices''' such as '''hard drives''' are associated with the '''block class'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Point to the '''folder''' and''' file''' in '''desktop'''&lt;br /&gt;
&lt;br /&gt;
Point to the '''files.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Go to the '''DeviceDriver '''folder on the desktop.&lt;br /&gt;
&lt;br /&gt;
Here I have created a new '''directory '''as '''CreateNewDevice.'''&lt;br /&gt;
&lt;br /&gt;
In this '''directory''', I have saved a '''simple_driver dot c driver file '''and''' Makefile.'''&lt;br /&gt;
&lt;br /&gt;
I’ll use these files for demonstration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide:5&lt;br /&gt;
&lt;br /&gt;
'''Code files''':&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * The files used in this tutorial are available in the '''Code Files '''link on this tutorial page.&lt;br /&gt;
* Please download and extract them&lt;br /&gt;
* Make a copy and then use them while practising&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Open the''' terminal''' &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Open the''' terminal''' by pressing '''Alt+Ctrl+T''' keys simultaneously.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''cd Desktop/DeviceDriver/CreateNewDevice'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Go to the directory '''CreateNewDevice''' as shown here.&lt;br /&gt;
&lt;br /&gt;
Press '''Enter key''' after every command.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''gedit simple_driver.c'''&lt;br /&gt;
&lt;br /&gt;
open '''simple_driver.c'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type''' gedit space simple_driver dot c''' to open the driver '''file.'''&lt;br /&gt;
&lt;br /&gt;
I have used the same file ''' simple_driver dot c '''which we used earlier.&lt;br /&gt;
&lt;br /&gt;
In this file, I have added required''' kernels '''functions.&lt;br /&gt;
&lt;br /&gt;
These kernel functions are used to create a new '''character device '''and its''' class.'''&lt;br /&gt;
&lt;br /&gt;
Let me explain the code.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight'''&amp;lt;nowiki&amp;gt; #include&amp;lt;device.h&amp;gt;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| You have to include this '''header file.'''&lt;br /&gt;
&lt;br /&gt;
The''' kernel functions''' that are required to create a new '''device '''are declared in it.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''static struct class *cl'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| First we have to declare a class structure for a new device as shown here.&lt;br /&gt;
&lt;br /&gt;
A '''class''' is defined in the '''kernel''' with the '''struct class structure.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see how to create a '''class''' using the '''kernels function''' in the '''sysfs.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''struct class *class_create()'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''owner'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''name'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| The''' class_create''' function is used to create a '''class''' in the '''sysfs filesystem.'''&lt;br /&gt;
&lt;br /&gt;
This function returns the '''struct class pointer'''.&lt;br /&gt;
&lt;br /&gt;
'''owner '''specifies the''' pointer''' to the module in which this '''struct class '''is defined.&lt;br /&gt;
&lt;br /&gt;
'''name '''specifies the '''pointer '''to a string for the name of this '''class.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' class_create()'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Here,''' class_create() function''' will create '''my_class''' in the '''sysfs.'''&lt;br /&gt;
&lt;br /&gt;
The '''sysfs''' exports the system information from the '''kernel '''space to user space.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' unregister_chrdev_region'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''printk '''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| On failure, it will unregister the '''device '''and will exit with the failure message.&lt;br /&gt;
&lt;br /&gt;
Otherwise, '''printk '''will print the message that the class is created successfully.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see the''' kernel function''' used to create a new '''device file.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''struct device *device_create()'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| '''device_create() function''' is used to create the '''device file''' in the''' dev directory.'''&lt;br /&gt;
&lt;br /&gt;
It will also create the device file in the '''sysfs'''.&lt;br /&gt;
&lt;br /&gt;
It returns the''' struct device pointer.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''class'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''parent'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''devt'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''drvdata '''&lt;br /&gt;
&lt;br /&gt;
Highlight '''fmt '''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| We will see the parameters that are passed to '''device_create() function'''.&lt;br /&gt;
&lt;br /&gt;
'''class '''specifies the device class.&lt;br /&gt;
&lt;br /&gt;
'''parent '''specifies the parent device of this device. &lt;br /&gt;
&lt;br /&gt;
If it is not specified, it is''' '''referred to as '''NULL.'''&lt;br /&gt;
&lt;br /&gt;
'''devt '''specifies''' '''the''' dev_t '''variable which holds the '''device number.'''&lt;br /&gt;
&lt;br /&gt;
'''drvdata '''is a '''pointer''' to the '''driver''' data.&lt;br /&gt;
&lt;br /&gt;
'''fmt '''is a string used for the '''device name.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''device_create() '''&lt;br /&gt;
&lt;br /&gt;
Highlight''' new_device'''&lt;br /&gt;
&lt;br /&gt;
Highlight''' NULL'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Here, I have given a new character '''device''' name as '''new_device'''.&lt;br /&gt;
&lt;br /&gt;
'''cl '''specifies the '''pointer''' to the '''class structure''' of this new device.&lt;br /&gt;
&lt;br /&gt;
As the '''device''' does not have a '''parent device''', I have passed the''' NULL''' '''pointer'''.&lt;br /&gt;
&lt;br /&gt;
'''device_num''' holds the major and minor numbers of the '''new_device'''.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see the''' kernel function '''used to remove the '''class of device '''to free its''' memory.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''void class_destroy(struct class *class)'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''cl'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| '''class_destroy function '''destroys a '''struct class structure.'''&lt;br /&gt;
&lt;br /&gt;
'''class '''specifies the '''pointer''' to the '''struct class''' that has to be destroyed.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''class_destroy(cl), unregister_chrdev_region()'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''class_destroy(cl)'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| These''' functions''' are executed when the''' device file''' creation fails.&lt;br /&gt;
&lt;br /&gt;
Here, '''class_destroy()''' will remove the''' class '''of '''device''' from the '''sysfs.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' printk messages'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Depending upon its success or failure, the corresponding messages will be printed.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let us see the''' kernel function '''used to remove the '''device '''from the kernel&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''void device_destroy'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''class'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''devt'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| '''device_destroy function '''removes a''' device''' that was created with '''device_create().'''&lt;br /&gt;
&lt;br /&gt;
This function is used in the '''exit function''' to free the''' kernel's''' memory. &lt;br /&gt;
&lt;br /&gt;
'''Class''' is a''' pointer '''to the '''struct class''' that this device was registered with.&lt;br /&gt;
&lt;br /&gt;
'''devt '''specifies the '''dev_t''' of the '''device''' that was previously registered.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight''' exit_function()'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''printk'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| In the''' exit function''', we have to return all the resources to the''' system.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''class_destroy() '''and '''device_destroy()'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''printk messages.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Here, the '''class''' and '''device''' will be removed by their corresponding''' functions.'''&lt;br /&gt;
&lt;br /&gt;
'''Printk''' message indicates the successful removal of the '''class '''and''' device.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight '''unregister_chrdev_region() '''and '''printk'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Finally, we have to unregister the device from the '''kernel''' as shown here.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Save the''' file'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Save and close the '''file'''.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''gedit Makefile '''&lt;br /&gt;
&lt;br /&gt;
Save the''' Makefile '''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us create a '''Makefile''' to '''compile''' the '''driver.'''&lt;br /&gt;
&lt;br /&gt;
Type''' gedit space Makefile.'''&lt;br /&gt;
&lt;br /&gt;
Type the''' code '''as shown or you can make use of the downloaded''' Makefile'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''make all'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us '''compile''' the '''driver.'''&lt;br /&gt;
&lt;br /&gt;
Type '''make space all.'''&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt;''' insmod simple_driver.ko'''&lt;br /&gt;
&lt;br /&gt;
Type''' sudo su'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let us load the '''driver '''into the''' kernel.'''&lt;br /&gt;
&lt;br /&gt;
Type''' sudo space su '''and''' password''' to be a superuser.&lt;br /&gt;
&lt;br /&gt;
For that, type '''insmod space simple_driver.ko'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''clear'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Clear the '''screen.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''dmesg | grep simple_driver'''&lt;br /&gt;
Highlight '''respective printk messages'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us see the loaded '''printk '''messages from the '''initialisation function.'''&lt;br /&gt;
&lt;br /&gt;
Type '''dmesg space pipe space grep space simple_driver.'''&lt;br /&gt;
&lt;br /&gt;
It shows that the '''class_create() function''' is executed successfully.&lt;br /&gt;
&lt;br /&gt;
Similarly, it shows that the '''device_create() function '''is executed successfully.&lt;br /&gt;
&lt;br /&gt;
These messages indicate that our device and its class is created successfully.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt;''' clear'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Clear the screen.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt;''' ls -l /sys/class/ | grep my_class'''&lt;br /&gt;
&lt;br /&gt;
Highlight the output&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' ls -l /sys/class/my_class/'''&lt;br /&gt;
&lt;br /&gt;
Highlight the output&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let’s check whether the '''class''' is created in the '''sysfs '''or not.&lt;br /&gt;
&lt;br /&gt;
Type '''ls space hyphen l space slash sys slash class slash pipeline grep my underscore class.'''&lt;br /&gt;
&lt;br /&gt;
Here, you can see the new '''my_class''' is registered successfully.&lt;br /&gt;
&lt;br /&gt;
Similarly check whether a device is created in the '''sysfs '''or not.&lt;br /&gt;
&lt;br /&gt;
Type '''ls space hyphen l space slash sys slash class slash my class.'''&lt;br /&gt;
&lt;br /&gt;
This shows that the '''new_device''' is created in the '''sysfs'''.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type '''ls -l /dev/new_device'''&lt;br /&gt;
&lt;br /&gt;
Highlight the output&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us check if the '''device file''' is created under the '''dev''' '''directory '''or not.&lt;br /&gt;
&lt;br /&gt;
Type''' ls space hyphen l space slash dev slash new_device.'''&lt;br /&gt;
&lt;br /&gt;
You can see the '''new_device file''' is created.&lt;br /&gt;
&lt;br /&gt;
The user can access this''' file''' to transfer the data to the '''new_device''' using its''' driver.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt; '''clear'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Clear the screen.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type''' rmmod simple_driver .ko'''&lt;br /&gt;
&lt;br /&gt;
Type '''dmesg | grep simple_driver'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; clear&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Now let us unload the '''driver.'''&lt;br /&gt;
&lt;br /&gt;
Type '''rmmod space simple_driver dot ko'''&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Highlight the '''output '''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| To see the unloaded '''printk '''messages type the '''dmesg '''command as shown.&lt;br /&gt;
&lt;br /&gt;
The output shows that the '''device file''' and it’s '''class''' are removed from the '''kernel.'''&lt;br /&gt;
&lt;br /&gt;
It indicates that the '''device''' is also unregistered here. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Type &amp;gt;&amp;gt;''' make clean'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''exit'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Let us remove the '''object files''' created after the '''compilation.'''&lt;br /&gt;
&lt;br /&gt;
Type '''make clean.'''&lt;br /&gt;
&lt;br /&gt;
To be a regular user , type''' exit.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| With this, we come to the end of this tutorial. Let us summarize.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 6:&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| In this tutorial, we learnt how to&lt;br /&gt;
&lt;br /&gt;
* Create a''' class of a device''' in the '''sysfs.'''&lt;br /&gt;
* Create a''' device file''' in '''sysfs '''and''' dev directory. '''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 7:&lt;br /&gt;
&lt;br /&gt;
Assignment : &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| As an assignment: &lt;br /&gt;
&lt;br /&gt;
# Open the '''simple_driver.c file.'''&lt;br /&gt;
# Create a''' device '''with a different name.&lt;br /&gt;
# Compile and load the '''simple_driver dot c.'''&lt;br /&gt;
# See the newly created '''device file''' under the '''sysfs.'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 8:&lt;br /&gt;
&lt;br /&gt;
About Spoken Tutorial Project:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * The video at the following link summarizes the Spoken Tutorial project.&lt;br /&gt;
&lt;br /&gt;
* Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 9:&lt;br /&gt;
&lt;br /&gt;
Spoken Tutorial workshops:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| The''' Spoken Tutorial Project''' Team:&lt;br /&gt;
&lt;br /&gt;
* conducts workshops and&lt;br /&gt;
* gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 10:&lt;br /&gt;
&lt;br /&gt;
Forum questions:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * Please post your timed queries in this forum.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 11:&lt;br /&gt;
&lt;br /&gt;
Forum for specific questions:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| * Do you have any general or technical questions on Embedded Linux Device Driver?&lt;br /&gt;
* Please visit the FOSSEE forum and post your question.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 12:&lt;br /&gt;
&lt;br /&gt;
Acknowledgment:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| The Spoken Tutorial Project is funded by MHRD, Government of India.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| Slide 13:&lt;br /&gt;
&lt;br /&gt;
Thank you slide:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;| This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay. &lt;br /&gt;
&lt;br /&gt;
This is Mayuri Panchakshari signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for watching.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>