request function

Posted on 2005-05-05
Last Modified: 2010-04-22
sir ,

    i  wrote a block device driver module

     *************  x.c *****************

     struct block_operations bdops ;

 // i didnt initialized the  bdops fields

    major=register_blkdev(0, "sbull" ,&bdops);
    printk("<1> %d " ,major);
    blk_init_queue(BLK_DEFAULT_QUEUE(major) , sbull_request);

 // these above codes are in init_module()

 void sbull_request(request_queue_t)


//i compiled and insmod ./x.o .

//After the successful  module loading .

               mknod  /dev/kol  b  major  0

// here major (value) is got from printk function  in init_module

//after creating the device when i tried

            echo 0 > /dev/kol

// no respons .just waiting in an endless loop .I expected a printing of
// "hello " in console

tell me wer is wrong .wat is the corrrect code .

Question by:karana
    LVL 2

    Accepted Solution


    just check 'dmesg' output. most likely hello  is there

    you can configure whether to output kernel messages to the console or not. in this case,i believe this is turned off

    LVL 5

    Assisted Solution

    i think that
    # dmesg
    will not show output.
    function printk() usually send its messages to special files, like
    '/var/log/syslog', or '/var/log/messages'. So check contents of them.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now