EmbLogic's Blog

character driver status

I have done register, unregister the character driver successfully and also open & release the character driver successfully. In this i am facing the problem regarding to container_of().

Posted in Character Driver | 1 Comment

character_driver

local_scull_dev_ptr=container_of(pointer,container type,cdev);

anyone plz tell me the internal functioning of the this macro…

1.what i mean to say is- how the control moves…

2.we directly take the third argument as ‘cdev’…

but we know cdev resides in struct scull_dev

so we should take ‘local_scull_dev_ptr->cdev’ as a third argument…

Posted in Character Driver | 1 Comment

problem regarding to container_of()

local_dev=container_of(inode->i_cdev, struct scull_dev,cdev1);
in above function, i don’t know how container_of() give the minor number and also how assign global device to local device.

Posted in Uncategorized | 2 Comments

PLEASE CHOOSE CATEGORY

All of you are requested to “add category” to your posts. Thank You

Posted in Word from Admin | Leave a comment

related c

difference b/w structure and union.

Structure:

1. It allocates memory equal to sum of memory allocated to its each individual member.

2.each member have their own memory space.

3. structure can not  be implemented in shred memory.

4. it has less Ambiguity.

5. Self referential structure can be implemented in data structure.

6. All members if structure can be accessed at a time.

Union:

1.It allocates piece of memory that is Large enough to hold the Largest variable of type in union.

2. one block is used by all the members of union.

3. Union is the Best environment where memory is shared.

4. as memory is shared, Ambiguity is more in union.

5. self ref. union can not be implemented.

6. only one member is accessed at a time.

Posted in Data Structures with C | 1 Comment

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

No of words in a sentence

Pgm to find the no of  occurance of a word in a sentence.

int main()

{

char str1[80],str2[20],str3[20];

int i=0,j,count=0;

printf(“Enter the sentence:\n”);gets(str1);

printf(“Enter the word for which no of occurance needs to be checked:\n”);gets(str2);

while(str1[i]!=”)

{

for(j=0;str1[i]!=’ ‘;j++,i++)

str3[j]=str1[i];   //Each word of the sentence is copied to str3 & compared with str2

str3[j]=”;

if(strcmp(str3,str2)==0)

count++;

}

printf(“%s word occured %d times”,str2,count);

}

I am so surprised to see that str2 value has some garbage values aftr execution.

Though count value is incremented properly but still for some particular sentences it shows “count-1″ value.Plz help me to understand where i went wrong.

Thanks

Pushpa

Posted in Data Structures with C | Leave a comment

in scull

how can i free memory after reading data for item, by free system call or delete the linking between qsets.

i use free system call it give me segmentation fault error

Posted in Data Structures with C | 2 Comments

status of charactrer driver.

i have successfully registered the multipal devices with a driver .if anybody want to take help for it by using for loop or by call a function …..most welcome.

Posted in Character Driver | Leave a comment

blog_update..

i have completed my registration &unregistration of multiple devices with the use of a fun scull_setup_cdev…….

Posted in Character Driver | Leave a 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 lot :/ !! Anyways, I’ll do it. :) . .

Posted in Uncategorized | 1 Comment

how to know the size of our program ………….?

Posted in Data Structures with C | 1 Comment

why array starts with 0 index?

Posted in Uncategorized | 2 Comments

how to know your system is little endian or big endian………..?

ARM processors could work in both modes either little and big endian.

In the ARM9TDMI, it works as  “BIGEND” that can be set (0 or 1) for instruction and data fetches…but only affect 16bit or 8bit fetches, while leaving the 32-bit word access unaffected.

Posted in ARM Embedded Processors | 4 Comments