[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: [LI] Problems with kernel modules
I tried the same thing with the -c option added to the command line. I
did not get any message at all when I tried insmod panic.o. I then said
lsmod and could see the module listed there. rmmod panic gave me the
following output:
---------------------------------------------------------------
Oops: 0002
CPU: 0
EIP: 0010:[<c4021091>]
EFLAGS: 00010282
eax: 00000000 ebx: c4021000 ecx: 00000ee9 edx: 00000001
esi: c4021000 edi: 00000000 ebp: c39bff90 esp: c39bff94
ds: 0018 es: 0018 ss: 0018
Process rmmod (pid: 1923, process nr: 55, stackpage=c39bf000)
Stack: c011698c c4021000 fffffff0 c39bffbc c0115ff6 c4021000 00000000
c39be000
00000000 00000000 c3a97000 c0109d08 0804a7a8 00000000 bffffe61
00000000
00000000 bffffcf0 00000081 0000002b 0000002b 00000081 0804921f
00000023
Call Trace: [<c011698c>] [<c4021000>] [<c0115ff6>] [<c4021000>]
[<c0109d08>]
Code: c6 00 61 c9 c3 4c 6f 61 64 69 6e 67 20 74 68 65 20 70 61 6e
Segmentation fault
----------------------------------------------------------------
What could be going wrong ?
On Sun, 19 Dec 1999 skhader@xxxxxxxxxx wrote:
>
> Hi there,
> Just yesteerday I wrote a module and compiled without any hassles and then
> inserted that
> and remove that module also without hassles ;-) ( but a small panic ;-)
>
> here is my program ( warning: Please do not try this at home ;-) and some
> usual disclaimers !!
>
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> init init_module( void)
> {
> printk( "Loading the panic module 3.....2......1.....\n");
> printk(" Done !! \n");
> return(0);
> }
>
> void cleanup_module(void)
> {
> char *ch=0;
> printk(" Your Module is ready to panic 3.....2.......1\n ");
> *ch='a';
> }
>
> and then I did
> $ gcc -D__KERNEL -DMODULE -I/usr/include panic.c
>
> and then
>
> $ insmod panic.o
> $ rmmod panic
>
> and my system happily panic'ed ;-)
>
> Well, we were testing something for which we had to write this module. ;-)
> So change this to suit your thing ;-)
> HTH
> Khader
>
> ---------------------------------- @}--------
> Syed Khader Vali Debian 2.2.1 ( potato )
> skhader@xxxxxxxxxx Kernel 2.3.33
> # 91-80-5262355 Extn:2527
>
>
> --------------------------------------------------------------------
> The Linux India Mailing List Archives are now available. Please search
> the archive at http://lists.linux-india.org/ before posting your question
> to avoid repetition and save bandwidth.
>
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available. Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.