[lkml]   [1998]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectAnother doubt on device drivers

    Please help me with this doubt too...Pardon me if the question is very
    trivial..I am just a beginner with device driver writing.

    I have written a character device driver in which the following functions
    are there.

    #ifndef MODULE
    long zero_init(long mem_start, long mem_end)
    int init_module(void)
    /* here I use register_chrdev() */
    void cleanup_module(void)
    /* here I use unregister_chrdev() */

    My doubt is this. I have a printk() function call in init_module. When I
    compile the source I use -D option to define MODULE. But I am not getting
    any output from printk() in init_module(). Why is this so ?
    I believe init_module() is called when I do 'insmod'. Am I correct ?
    If not, when is register_chrdev() called ? Is cleanup_module() called
    when I do a 'rmmod' ??

    Thank you,

    The human mind treats a new idea the way the body treats a strange protein-
    --it rejects it.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:44    [W:0.020 / U:14.220 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site