Link to home
Start Free TrialLog in
Avatar of karana
karana

asked on

request function

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 .

 
ASKER CERTIFIED SOLUTION
Avatar of sekargopi
sekargopi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial