<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 a user program wants to access the device and we don't need to generate the device file for us to use the device in kernel. Is my understanding correct?
</div>
<div style="LINE-HEIGHT: 15pt"> </div>
<div style="LINE-HEIGHT: 15pt">For example, busybox (a user program) 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"> </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>"Kernel" <bu.kernel@gmail.com><br>
<b>Sent : </b>2014-03-11 14:44:09 ( +09:00 )<br>
<b>To : </b>Kim Chan <ckim@etri.re.kr><br>
<b>Cc : </b>kernelnewbies@kernelnewbies.org <kernelnewbies@kernelnewbies.org><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, 김찬 <<a href="mailto:ckim@etri.re.kr" target="_blank">ckim@etri.re.kr</a>> 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> </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> </div>
<div>int __init vcs_init(void)<br>
{<br>
unsigned int i;</div>
<div> if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))<br>
panic("unable to get major %d for vcs device", VCS_MAJOR);<br>
</div>
<div> </div>
<div>I can see the 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> </div>
<div>Chan</div>
<div> </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 <major no> <minor no></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>