[ZLG-ARM] 嵌入式linux设备驱动程序之一 hello_world模块

[复制链接]
1756|2
 楼主| qtopia 发表于 2009-7-2 13:18 | 显示全部楼层 |阅读模式
#include&nbsp;&ltlinux/module.h&gt<br />#include&nbsp;&ltlinux/init.h&gt<br />#define&nbsp;__license__&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;GPL&quot;<br />&nbsp;<br />static&nbsp;int&nbsp;__init&nbsp;hello_init(void)<br />{<br />&nbsp;printk(&quot;Hello&nbsp;,cool&nbsp;world!
&quot;);<br />&nbsp;return&nbsp;0;<br />}<br />&nbsp;<br />static&nbsp;void&nbsp;__exit&nbsp;hello_exit(void)<br />{<br />&nbsp;printk(&quot;Goodbye,cruel&nbsp;world
&quot;);<br />}<br />&nbsp;<br />MODULE_LICENSE(__license__);<br />&nbsp;<br />module_init(hello_init);<br />module_exit(hello_exit);<br />
tmake 发表于 2009-7-2 18:26 | 显示全部楼层

嗯!很基本的 一个模块

  
lpc2410 发表于 2009-7-3 13:03 | 显示全部楼层

收藏了

  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

25

主题

125

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部