[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why hello kernel module didn't output anything?
Hi,
I am able to get the output. Are you workig on the console? printk comes
only on the console.
Regs,
sathish
On Thu, 4 Oct 2001, Hong Hsu wrote:
>
> Here is my simple question:
> Compile following hello.c with gcc -c hello.c -Wall, then insmod hello.o
> -o mytest
> The /proc/modules shows "mytest 528 0 (unused)"
> But how the module will be called as it suppose to send "Hello, world "
> to either xterm or konsole?
>
> Thanks,
> -Hong
>
>
> #define __KERNEL__ /* We're part of the kernel */
> #define MODULE /* Not a permanent part, though. */
>
> /* #include <linux/modversions.h> */
> #include <linux/module.h>
>
> int init_module()
> {
> printk("Hello, world - this is the kernel speaking\n");
>
> return 0;
> }
>
> void cleanup_module()
> {
> printk("Short is the life of an LKM\n");
> }
>
> -
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> IRC Channel: irc.openprojects.net / #kernelnewbies
> Web Page: http://www.kernelnewbies.org/
>
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/