<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>P {MARGIN-TOP: 0mm; MARGIN-BOTTOM: 0mm}</style>
</head>
<body>
<div style="FONT-FAMILY: Arial; FONT-SIZE: 10pt" id="ezFormProc_div">
<div style="FONT-FAMILY: Arial" id="msgbody">
<div>
<div style="LINE-HEIGHT: 15pt"><br>
Yeah, I know mknod command. I just wanted to know if the register_chrdev makes the file or not.</div>
<div style="LINE-HEIGHT: 15pt">To my understanding, device file is needed when&nbsp;a user program wants to access the device and we don't need to generate the device file for us to use&nbsp;the device&nbsp;in kernel. Is my understanding correct?
</div>
<div style="LINE-HEIGHT: 15pt">&nbsp;</div>
<div style="LINE-HEIGHT: 15pt">For example, busybox (a user program)&nbsp;starts shell on tty2-4 by default. (as the assumed default inittab below)</div>
<div style="LINE-HEIGHT: 15pt">tty2::askfirst:-/bin/sh</div>
<div style="LINE-HEIGHT: 15pt">tty3::askfirst:-/bin/sh</div>
<div style="LINE-HEIGHT: 15pt">tty4::askfirst:-/bin/sh</div>
<div style="LINE-HEIGHT: 15pt">I have had some mknod commands before in /etc/init.d/rcS to make tty2~tty4 device files, but when I remove them for test, I can see busybox (almost sure it's coming from busybox) complaining that it cannot find the tty2~tty4 device
 files. </div>
<div style="LINE-HEIGHT: 15pt">&nbsp;</div>
<div style="LINE-HEIGHT: 15pt">I am trying to open a shell on my LCD (is it going to be tty2 ? I don't know) and I'm not sure if I have to make vcs1 vcs2 vcs3 files. And I don't know how to switch to LCD shell. during the boot, the texts come out on the LCD
 but I cannot see the texts (printf) from busybox. and cannot see the shell on LCD. When I press the keyboad, it looks like it's connected to tty1(I can see using prints on uart window). Can anybody tell me some direction?<br>
</div>
<div style="LINE-HEIGHT: 15pt">
<hr tabindex="-1">
</div>
<div style="LINE-HEIGHT: 15pt"><b>From : </b>&quot;Kernel&quot; &lt;bu.kernel@gmail.com&gt;<br>
<b>Sent : </b>2014-03-11 14:44:09 ( &#43;09:00 )<br>
<b>To : </b>Kim Chan &lt;ckim@etri.re.kr&gt;<br>
<b>Cc : </b>kernelnewbies@kernelnewbies.org &lt;kernelnewbies@kernelnewbies.org&gt;<br>
<b>Subject : </b>Re: Does register_chrdev function make device file under /dev ?<br>
<br>
</div>
<div style="LINE-HEIGHT: 15pt"><br>
</div>
<div style="LINE-HEIGHT: 15pt"><br>
On Mar 10, 2014, at 10:25 PM, 김찬 &lt;<a href="mailto:ckim@etri.re.kr" target="_blank">ckim@etri.re.kr</a>&gt; wrote:<br>
<br>
</div>
<div style="LINE-HEIGHT: 15pt"><span></span></div>
<blockquote style="LINE-HEIGHT: 15pt" type="cite">
<div><style>P {
        MARGIN-TOP: 0mm; MARGIN-BOTTOM: 0mm
}
</style>
<div style="FONT-FAMILY: 굴림; FONT-SIZE: 10pt" id="ezFormProc_div">
<div style="FONT-FAMILY: 굴림" id="msgbody">
<div>Hi,</div>
<div>&nbsp;</div>
<div>This should be a basic question.</div>
<div>Does the regisetr_chrdev function make the device file under /dev directory?</div>
<div>I am running linux on our embedded system and inside vcs_init, register_chrdev is called as below.</div>
<div>&nbsp;</div>
<div>int __init vcs_init(void)<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int i;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (register_chrdev(VCS_MAJOR, &quot;vcs&quot;, &amp;vcs_fops))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; panic(&quot;unable to get major %d for vcs device&quot;, VCS_MAJOR);<br>
</div>
<div>&nbsp;</div>
<div>I can see the&nbsp;function is returning ok but I don't see any vcs* file under /dev.</div>
<div>Does it only register the device on /sys or /proc directory and not under /dev?</div>
<div>Thanks in advance.</div>
<div>&nbsp;</div>
<div>Chan</div>
<div>&nbsp;</div>
</div>
</div>
</div>
</blockquote>
<div style="LINE-HEIGHT: 15pt"><br>
</div>
<div style="LINE-HEIGHT: 15pt">You have to create a device file using 'mknod' </div>
<div style="LINE-HEIGHT: 15pt"><br>
</div>
<div style="LINE-HEIGHT: 15pt">Ex: mknod -m 666 /dev/vcs c &lt;major no&gt; &lt;minor no&gt;</div>
<div style="LINE-HEIGHT: 15pt"><br>
</div>
<div style="LINE-HEIGHT: 15pt"><br>
</div>
<div style="LINE-HEIGHT: 15pt">
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>Kernelnewbies mailing list</span><br>
<span><a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a></span><br>
<span><a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a></span><br>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>