sysfs ノードからデバイスをアクセスする
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* sysfs ノードからデバイスをアクセスする [#j4096303]
Linux kernel のデバイスとドライバの管理作法に従ってデバイ...
/sys/devices/platform の下を見ていきます。このディレクト...
#pre(soft,overflow:auto){{
&span(ConsoleOut){~ $ };&span(ConsoleIn){cd /sys/devices};
&span(ConsoleOut){/sys/devices $ };&span(ConsoleIn){ls -l...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){dr-xr-xr-x 13 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 10 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 10 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 9 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 18 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 20 11:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
}}
i8042 ディレクトリを見てみましょう。このディレクトリには ...
#pre(soft,overflow:auto){{
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){/sys/devices/platform/i8042 $ };&span(C...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){/sys/devices/platform/i8042 $ };&span(C...
&span(ConsoleOut){/sys/devices/platform/i8042/serio0$ };&...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:4...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){--w------- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:5...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:5...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){/sys/devices/platform/i8042/serio0 $ };...
&span(ConsoleOut){auto};
&span(ConsoleOut){/sys/devices/platform/i8042/serio0 $ };...
&span(ConsoleOut){i8042 KBD port};
}}
bind_mode ノードの実装を詳しく見ていきましょう。このノー...
#code(c,/DEVICE_ATTR_RO.*modalias/../serio_id_attr_group/...
#code(c,/serio_init_port/../^}/,begin-=3,ogfileone:/drive...
group メンバは &ogdefs(sysfs_create_groups()); が呼び出さ...
#code(c,/device_add_groups/../^}/,ogfileone:/drivers/base...
sysfs ノードの追加は &ogdefs(serio); クラス・デバイスなの...
#textbox(note, あちこちにある uevent node はどんな機能が...
書き込む (&ogdefs(uevent_store());) と uevent を発行する ...
}}
終了行:
* sysfs ノードからデバイスをアクセスする [#j4096303]
Linux kernel のデバイスとドライバの管理作法に従ってデバイ...
/sys/devices/platform の下を見ていきます。このディレクト...
#pre(soft,overflow:auto){{
&span(ConsoleOut){~ $ };&span(ConsoleIn){cd /sys/devices};
&span(ConsoleOut){/sys/devices $ };&span(ConsoleIn){ls -l...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){dr-xr-xr-x 13 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 10 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 10 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 9 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){drwxr-xr-x 18 root root 0 Jul 24 01:43 ...
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 16 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 20 11:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 3 root root 0 Jul 24 01:...
}}
i8042 ディレクトリを見てみましょう。このディレクトリには ...
#pre(soft,overflow:auto){{
&span(ConsoleOut){/sys/devices/platform $ };&span(Console...
&span(ConsoleOut){/sys/devices/platform/i8042 $ };&span(C...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 22 root root 0 Jul 24 01:...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:...
&span(ConsoleOut){/sys/devices/platform/i8042 $ };&span(C...
&span(ConsoleOut){/sys/devices/platform/i8042/serio0$ };&...
&span(ConsoleOut){total 0};
&span(ConsoleOut){drwxr-xr-x 4 root root 0 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 5 root root 0 Jul 24 01:4...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){--w------- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:5...
&span(ConsoleOut){-r--r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){drwxr-xr-x 2 root root 0 Jul 24 01:5...
&span(ConsoleOut){lrwxrwxrwx 1 root root 0 Jul 24 01:5...
&span(ConsoleOut){-rw-r--r-- 1 root root 4096 Jul 24 01:5...
&span(ConsoleOut){/sys/devices/platform/i8042/serio0 $ };...
&span(ConsoleOut){auto};
&span(ConsoleOut){/sys/devices/platform/i8042/serio0 $ };...
&span(ConsoleOut){i8042 KBD port};
}}
bind_mode ノードの実装を詳しく見ていきましょう。このノー...
#code(c,/DEVICE_ATTR_RO.*modalias/../serio_id_attr_group/...
#code(c,/serio_init_port/../^}/,begin-=3,ogfileone:/drive...
group メンバは &ogdefs(sysfs_create_groups()); が呼び出さ...
#code(c,/device_add_groups/../^}/,ogfileone:/drivers/base...
sysfs ノードの追加は &ogdefs(serio); クラス・デバイスなの...
#textbox(note, あちこちにある uevent node はどんな機能が...
書き込む (&ogdefs(uevent_store());) と uevent を発行する ...
}}
ページ名: