Linux內核編程:從hello world 開始-(3)_run

/*   
 *File    : test.c 
 *Author  : DavidLin      
 *Date    : 2014-12-07pm      
 *Email   : [email protected] or [email protected]      
 *world   : the city of SZ, in China      
 *Ver     : 000.000.001      
 *history :     editor      time            do      
 *          1)LinPeng       2014-12-07      created this file!      
 *          2)      
 */  


1.獲得root權限:su root;

2.make   

3.insmod ./test.ko

4.rmmod test

5.tail -n 3 /var/log/messages

6.lsmod

執行完上述流程,就可以看到內核打印信息了,其中lsmod可以看到test模塊的靚影,歡迎來到內核的世界,Hello World。

發佈了56 篇原創文章 · 獲贊 6 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章