2010-03-09 20:52:15     How add my own file to the kernel?

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

2010-03-09 20:52:15     How add my own file to the kernel?

zhang zhihua (CHINA)

Message: 87008   

 

Hi,

 

    如何将我自己编写的应用添加到linux内核当中呢?比如说我编写了一个小程序,让PH2、PH3、PH4作为GPIO口输出一个方波,我在win下面使用VDSP++编译调试已经实现了这个功能,我现在想把它添加到内核当中,在我编译出来的kernel中包含这个应用,系统运行后用示波器检测这几个口,是添加到linux/driver目录下并修改Kconfig和Makfile吗?

TranslateQuoteReplyEditDelete

 

 

2010-03-10 01:04:57     Re: How add my own file to the kernel?

Yi Li (CHINA)

Message: 87012   

 

> 是添加到linux/driver目录下并修改Kconfig和Makfile吗

 

Yes. 但需要按照linux的规则来写driver:   docs.blackfin.uclinux.org/doku.php?id=gpio

 

-Yi

QuoteReplyEditDelete

 

 

2010-03-10 03:28:21     Re: How add my own file to the kernel?

zhang zhihua (CHINA)

Message: 87034   

 

我添加之后执行make,下载到目标板后执行cat  proc/devices 发现了我添加的设备,但是为什么在dev目录下没有呢?

TranslateQuoteReplyEditDelete

 

 

2010-03-10 04:13:56     Re: How add my own file to the kernel?

Yi Li (CHINA)

Message: 87037   

 

please refer to:   docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dev-management

QuoteReplyEditDelete

 

 

2010-03-10 20:29:08     Re: How add my own file to the kernel?

zhang zhihua (CHINA)

Message: 87064   

 

我在device_table.txt里面增加了

 

/dev/gpio c 640 0 0 253 0 0 1

 

然后配置如下:

 

Miscellaneous Configuration --->

  Device Nodes --->

    [ ] Dynamic

    [ * ] Static

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

TranslateQuoteReplyEditDelete

Attachments

    Outcomes