EmbLogic's Blog

Category Archives: Uncategorized

related c

basic meaning of static variable,global variable,local variable.difference also

Posted in Uncategorized | 2 Comments

c related quary

why char pointer take four bytes.while char take only one byte

Posted in Uncategorized | 1 Comment

Update on 03/10/11

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 →

Posted in Uncategorized | 1 Comment

why array starts with 0 index?

Posted in Uncategorized | 2 Comments

character driver update

some time works both register and unregistered but some time it hangs the system.

Posted in Uncategorized | Leave a comment

status of character device driver………

sir i have successfully register multiple devices with cdev init & cdevadd and unregistr using cdevdel & kfree and also with scull_setup_cdev function .

Posted in Uncategorized | Leave a comment

ARRAY IN C

How to Remove the duplicates in an array.

Posted in Uncategorized | 2 Comments

char driver problem…

    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 →

Posted in Uncategorized | 1 Comment

Linked List

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 →

Posted in Data Structures with C, Uncategorized | 3 Comments

char_dri

pls tell me the different issue associated with malloc and kmalloc ? and what is different betn them?

Posted in Uncategorized | 4 Comments

register the driver acording to 2.4 kernal give error in rmmod and all hedar file and decleartion are include in heder24.h

#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”); }

Posted in Uncategorized | 3 Comments

datatype….

will anyone suggest me the difference b/w- int flag; const int flag; static int flag;

Posted in Uncategorized | 3 Comments

Question No.15 of Assignment-1

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 →

Posted in Uncategorized | 2 Comments

error:while cross-compiling the gcc for arm-board

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 →

Posted in Uncategorized | 1 Comment

Significance of main(int argc, char *argv[]) ?

What is the significance of int argc & char *argv[] ? Where and why is it used ?

Posted in Uncategorized | 1 Comment