basic meaning of static variable,global variable,local variable.difference also
why char pointer take four bytes.while char take only one byte
I just finished with Structures and Linked Lists tonight. I have to implement Linked Lists, Queues and SCULL and I’ll do it in this week. Char Driver : Still working on Registration and Initialization. I have to cover up a … Continue reading
some time works both register and unregistered but some time it hangs the system.
sir i have successfully register multiple devices with cdev init & cdevadd and unregistr using cdevdel & kfree and also with scull_setup_cdev function .
The code during registration:- scull_dev_ptr=kmalloc(NO_OF_DEVICES*sizeof(struct scull_dev),GFP_KERNEL); memset(scull_dev_ptr,”,sizeof(struct scull_dev)); for(loopv=0;loopv<NO_OF_DEVICES;loopv++) { ldev=MKDEV(scull_major,scull_minor); scull_minor=MINOR(ldev); scull_dev_ptr[loopv].cdev_var.dev=ldev; scull_dev_ptr[loopv].cdev_var.owner=THIS_MODULE; cdev_init(&scull_dev_ptr[loopv].cdev_var,&fops); ret_val_2=cdev_add(&scull_dev_ptr[loopv].cdev_var,ldev,1); if(ret_val_2<0) { #ifdef DEBUG printk(KERN_ERR “cdev_add failed”); #endif goto out; } scull_minor++; #ifdef DEBUG printk(KERN_INFO “minor=%d”,scull_minor); #endif } The code during unregisteration:- … Continue reading
The following code is meant to create a Linked List. The code is running and it shows no error. Is this the correct way of creating a linked list….???? 1 2 3 #include<stdio.h> 4 #include <stdlib.h> 5 struct node 6 … Continue reading
pls tell me the different issue associated with malloc and kmalloc ? and what is different betn them?
#include”header24.h” int i,retvl; module_param(i,int,S_IRUGO); int init_function(void) { retvl=register_chrdev(0,”my_reg”,&fops); if(retvl<0) printk(KERN_ERR “error\n”); printk(KERN_INFO “retvl=%d\n”,retvl); printk(KERN_INFO “HELLO WORLD\n”); printk(KERN_INFO “process name=%s \t process id=%d”,current->comm,current->pid); printk(KERN_INFO “i=%d\n”,i); return 0; } void exit_function(void) { unregister_chrdev(retvl,”my_reg”); printk(KERN_INFO “BYE\n”); }
will anyone suggest me the difference b/w- int flag; const int flag; static int flag;
int main() { float a, a = 2.0e20; printf(“%f”,a); } Here looking at the program we expect that the output should be like 200..( 0 for 20 times). but to our astonishment we are getting the output as 200000004008175468544. Can … Continue reading
configure: creating cache ./config.cache checking build system type… arm-unknown-linux-gnu checking host system type… arm-unknown-linux-gnu checking target system type… arm-unknown-linux-gnu checking LIBRARY_PATH variable… ok checking GCC_EXEC_PREFIX variable… ok checking whether to place generated files in the source directory… no checking whether … Continue reading
What is the significance of int argc & char *argv[] ? Where and why is it used ?