keropoの備忘録

しらべたことをメモるブログ

2015-02-22から1日間の記事一覧

Linuxデバイスドライバ基礎② procインタフェース

procインタフェースを利用してユーザランドからカーネル(ドライバ)と通信するサンプル procfs.c #include <linux/module.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/proc_fs.h> #include <linux/stat.h> MODULE_LICENSE("GPL"); #define PROC_NAME "driver/example" static int proc_open(struct inode *node, </linux/stat.h></linux/proc_fs.h></linux/fs.h></linux/kernel.h></linux/module.h>…