Kernel OOPS[filesystem programming]

From: Jeba Anandhan A (jeba_career_at_yahoo.com)
Date: 08/31/04

  • Next message: Sid Boyce: "2.6.9-rc1-mm2 nvidia breakage"
    Date:	Tue, 31 Aug 2004 09:19:56 -0700 (PDT)
    To: linux-kernel@vger.kernel.org
    
    

    i have written kernel program to access the data
    structure of particular inode.

    #include<linux/kernel.h>
    #include<linux/module.h>
    #include<linux/fs.h>
                                                          
                                                          
                  
                                                          
                                                          
                  
    static struct inode *my_inode;
    static unsigned long inode_no;
    int init_module(void){
    printk("inode module inserted\n");
    inode_no=1304012;
    printk("inode no=%d",inode_no);
    my_inode->i_ino=inode_no; // it creates segmentation
    //fault why so..
    return 0;
    }
                                                          
                                                          
                  
    void cleanup_module(void){
    }
                                                          
                                                          
                  
    when i insert the module ,kernel got OOPS.
    ~
    <1>Unable to handle kernel NULL pointer dereference at
    virtual address 00000028
     printing eip:
    d09c80a1
    *pde = 0841b067
    *pte = 00000000
    Oops: 0002
    inodetraversal1 inodetraversal i810_audio ac97_codec
    soundcore parport_pc lp parport autofs 3c59x floppy sg
    microcode ide-scsi scsi_mod ide-cd cdrom keybdev h
    CPU: 0
    EIP: 0060:[<d09c80a1>] Tainted: P
    EFLAGS: 00210282
     
    EIP is at init_module [inodetraversal1] 0x41
    (2.4.22-1.2115.nptl)
    eax: 00000000 ebx: c0349124 ecx: 00000001 edx:
    0013e5cc
    esi: 00000000 edi: 00000000 ebp: c4123f10 esp:
    c4123f08
    ds: 0068 es: 0068 ss: 0068
    Process insmod (pid: 7866, stackpage=c4123000)
    Stack: c0349124 00000000 d09c8000 c011ed74 c03badb4
    00000001 d09c8000 00000000
           08ea51c3 d09c8060 00000003 000000d3 00000060
    0000000f c89855c0 ccd26000
           cbbb4000 d09ca000 00000060 d09ad000 d09c8060
    0000037c 00000000 00000000
    Call Trace: [<c011ed74>] sys_init_module [kernel]
    0x584 (0xc4123f14)
    [<d09c8060>] init_module [inodetraversal1] 0x0
    (0xc4123f2c)
    [<d09c8060>] init_module [inodetraversal1] 0x0
    (0xc4123f58)
    [<c0109b9f>] system_call [kernel] 0x33 (0xc4123fc0)
     
     
    Code: 89 50 28 b8 00 00 00 00 c9 c3 55 89 e5 c9 c3 69
    6e 6f 64 65
      
    whatz problem with my program.how to rectify.?
    jeba

    __________________________________________________
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Sid Boyce: "2.6.9-rc1-mm2 nvidia breakage"

    Relevant Pages

    • Re: [PATCH 1/3] 2.6.8-rc4-mm1 - Fix UML build
      ... can access them all, and initialized data all before uninitialized, so ... SYMLINKS:= $,$/$f) ... semaphore.c-dir = kernel ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24
      ... > rebooted to a kernel that doesn't have the RT-preempt patch but ... getting a very verbose running trail, almost like an strace output, ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... Subject: Error mounting root fs on 72:01 using Promise FastTrak TX2000 ... > Now I'm sucessfully booting my system with the 2.4.23 kernel using ... I think it's when the ATARAID driver is about to fire up. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... > Now I'm sucessfully booting my system with the 2.4.23 kernel using ... I think it's when the ATARAID driver is about to fire up. ... > the hard drives since this is the only thing that has changed. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: udev and devfs - The final word
      ... As each device driver loads and registers with the kernel, ... 'cookies' can be written out to keep them separately ID'd. ... e.g. increasing error rates and aging silicon will ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)