[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

request function

Posted on 2005-05-05
4
Medium Priority
?
284 Views
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)
    {
     
               printk("hello");
     }
 
 


**************************************************

//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 .

 
0
Comment
Question by:karana
2 Comments
 
LVL 2

Accepted Solution

by:
sekargopi earned 100 total points
ID: 13976715

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

Gopi
0
 
LVL 5

Assisted Solution

by:B1-66ER
B1-66ER earned 100 total points
ID: 14145241
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

834 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