ディバイスドライバを ..
[2ch|▼Menu]
17:login:Penguin
02/02/01 04:33 Dg5fN5Aj
どうやってドライバを書くのかという英文をひらったぞ(゚Д゚)ゴルァ

一番単純なモジュール抜粋じゃー
#define MODULE
#include <linux/module.h>

int init_module (void) /* Loads a module in the kernel */
{
printk("Hello kernel \n");
return 0;
}

void cleanup_module(void) /* Removes module from kernel */
{
printk("GoodBye Kernel\n");
}

モジュールコンパイルしろや
# gcc -c hello.c
モジュールロードだ
# insmod hello.o

出力は
Hello kernel
モジュールアンロード
# rmmod hello.o



次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5369日前に更新/265 KB
担当:undef