2010-03-10 22:09:50     can't creat a node under the /dev

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-03-10 22:09:50     can't creat a node under the /dev

zhang zhihua (CHINA)

Message: 87066   

 

我在系统里面添加了一个name为gpio的IO驱动,编译之后执行cat proc/devices 能看到gpio,主设备号:110,次设备号:0,但是在/dev目录没有gpio设备,必须手动执行 mknod /dev/gpio c 110 0来创建,我也在device_table.txt里面增加了

 

/dev/gpio c 755 0 0 110 0 0 1

 

然后config kernel如下:

 

Miscellaneous Configuration --->

  Device Nodes --->

    [ ] Dynamic

    [ * ] Static

可是make之后再dev目录还是没有gpio这个设备...

 

还有其它什么地方需要修改还是我device_table.txt文件没修改正确?

TranslateQuoteReplyEditDelete

 

 

2010-03-10 22:29:25     Re: can't creat a node under the /dev

Sonic Zhang (CHINA)

Message: 87067   

 

There is already a generic gpio driver in kernel. Why not use it other than write your own?

QuoteReplyEditDelete

 

 

2010-03-10 22:33:45     Re: can't creat a node under the /dev

zhang zhihua (CHINA)

Message: 87068   

 

我们主要是想用16c2552扩展两个串口,所以自己编写驱动,现在主要是想测试怎么添加驱动,gpio这个名字是任意的,是不是和这个名字已经用了有关系?

TranslateQuoteReplyEditDelete

 

 

2010-03-10 22:38:58     Re: can't creat a node under the /dev

Sonic Zhang (CHINA)

Message: 87069   

 

你要mdev自动产生device node,需要在你的char device driver中注册class device 到 sysfs中。请找一个其他char device driver 参考。

QuoteReplyEditDelete

 

 

2010-03-11 11:12:12     Re: can't creat a node under the /dev

Mike Frysinger (UNITED STATES)

Message: 87099   

 

if you want to do static device nodes, you have to edit your default rc file too.  we dont add any logic in there to support static /dev.  most people who want to use static /dev dont know what they're doing and need to fix their device driver instead like the documentation covers.

QuoteReplyEditDelete

 

 

2010-03-11 22:02:25     Re: can't creat a node under the /dev

zhang zhihua (CHINA)

Message: 87106   

 

thank you,Mike,

 

    it's ok!I add it via modify the /etc/rc

Attachments

    Outcomes