LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1162|回复: 4

[菜鸟问]insmod command not find

[复制链接]
发表于 2006-3-31 20:12:46 | 显示全部楼层 |阅读模式
[root@localhost cooleagle]# cd program
[root@localhost program]# ls
hello.c  hello.ko  hello.mod.c  hello.mod.o  hello.o  Makefile  Makefile~
[root@localhost program]# insmod ./hello.ko
bash: insmod: command not found

[root@localhost program]# cd ../download
[root@localhost download]# rpm -i module-init-tools-3.1-3.i386.rpm
        package module-init-tools-3.1-3 is already installed

是不是要下载什么软件包 请指教 谢谢( 我用的是2.6.16内核)
发表于 2006-3-31 21:32:19 | 显示全部楼层
try 'whereis insmod' to find the insmod command and use the full path of insmod to execute it
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-1 11:05:05 | 显示全部楼层
Post by rickxbx
try 'whereis insmod' to find the insmod command and use the full path of insmod to execute it
谢谢,现在可以加载了!但不知道为什么没有输出啊?
[root@localhost program]# whereis insmod
insmod: /sbin/insmod.static /sbin/insmod /usr/share/man/man8/insmod.8.gz
[root@localhost program]# /sbin/insmod ./hello.ko
查看加载的模块时,能看到hello模块
[root@localhost program]# /sbin/lsmod
Module                  Size  Used by
hello                   1664  0
parport_pc             28268  1
lp                     13504  0
parport                37704  2 parport_pc,lp
autofs4                20228  2
rfcomm                 38804  0
l2cap                  25984  5 rfcomm
bluetooth              50020  4 rfcomm,l2cap
sunrpc                153636  1
dm_mod                 56724  0
video                  15492  0
button                  6800  0
battery                 9604  0
ac                      5124  0
ipv6                  260288  16
uhci_hcd               33296  0
shpchp                 48192  0
i2c_viapro              9236  0
i2c_core               22272  1 i2c_viapro
snd_via82xx            28824  1
gameport               16008  1 snd_via82xx
snd_ac97_codec         93088  1 snd_via82xx
snd_ac97_bus            2688  1 snd_ac97_codec
snd_seq_dummy           4100  0
snd_seq_oss            33508  0
snd_seq_midi_event      7680  1 snd_seq_oss
snd_seq                53068  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            51872  0
snd_mixer_oss          18688  1 snd_pcm_oss
snd_pcm                89732  3 snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_timer              24964  2 snd_seq,snd_pcm
snd_page_alloc         11144  2 snd_via82xx,snd_pcm
snd_mpu401_uart         8448  1 snd_via82xx
snd_rawmidi            26144  1 snd_mpu401_uart
snd_seq_device          9484  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd                    54496  13 snd_via82xx,snd_ac97_codec,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore              10080  1 snd
8139too                27776  0
mii                     6144  1 8139too
floppy                 65340  0
ext3                  134408  1
jbd                    59284  1 ext3
注:hello.c的内容如下:
#include <linux/module.h>
#include <linux/init.h>

MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
printk(KERN_ALERT "hello,world\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye\n");
}

module_init(hello_init);
module_exit(hello_exit);

怎么能看到输出啊 请指教谢谢
回复 支持 反对

使用道具 举报

发表于 2006-4-1 13:07:01 | 显示全部楼层
用demsg看看呢? 或者到控制台模式下
回复 支持 反对

使用道具 举报

发表于 2006-4-1 13:42:29 | 显示全部楼层
Post by cooleagle
怎么能看到输出啊 请指教谢谢


tail /var/log/messages
回复 支持 反对

使用道具 举报

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

本版积分规则

快速回复 返回顶部 返回列表