EmbLogic's Blog

Author Archives: deepak.jain

module code to show how to initialize a cdev data structure with cdev_init() and tell the kernel about it with cdev_add().

RCS file: header.h,v Working file: header.h head: 1.16 branch: locks: strict root: 1.16 access list: symbolic names: keyword substitution: kv total revisions: 16;    selected revisions: 16 description: Base header file that includes the definitions of all the macros,structures and contains … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code to show how to allocate and deallocate memory using kmalloc() and kfree() functions for Sculldev (i.e the data structure used to hold device information)respectively.

RCS file: header.h,v Working file: header.h head: 1.14 branch: locks: strict root: 1.14 access list: symbolic names: keyword substitution: kv total revisions: 14;    selected revisions: 14 description: Base header file that includes the definitions of all the macros,structures and contains … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code to show how parameters can be passed to a module while loading it with the help of macro called module_param().

RCS file: header.h,v Working file: header.h head: 1.8 branch: locks: strict root: 1.8 access list: symbolic names: keyword substitution: kv total revisions: 8;    selected revisions: 8 description: Base header file that includes the definitions of all the macros,structures and contains … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code to show how device numbers are allocated and deallocated using alloc_chrdev_region() and unregister_chrdev_region().

RCS file: header.h,v Working file: header.h head: 1.7 branch: locks: strict root: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7;    selected revisions: 7 description: Base header file that includes the definitions of all the macros,structures and contains … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Simplest driver module code to understand the macros module_init() and module_exit().

RCS file: header.h,v Working file: header.h head: 1.5 branch: locks: strict root: 1.5 access list: symbolic names: keyword substitution: kv total revisions: 5;    selected revisions: 5 description: Base header file that includes the definitions of all the macros,structure definitions and … Continue reading

Posted in Character Driver | Leave a comment

Code for finding out the middle node in a single linked list in C language.

RCS file: middle_of_linked_list.c,v Working file: middle_of_linked_list.c head: 1.15 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 15;    selected revisions: 15 description: Code to demonstrate how to find the middle of a linked list in C langauge. … Continue reading

Posted in Data Structures with C | Leave a comment

Code to demonstrate how to delete an alternate number of nodes in the single linked list in C.

RCS file: delete_linked_list.c,v Working file: delete_linked_list.c head: 1.13 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 13;    selected revisions: 13 description: Code to demonstrate how to delete alternate nodes in a single linked list in C … Continue reading

Posted in Data Structures with C | Leave a comment

Code to demonstrate how to delete M nodes after N nodes in a single linked list in C .

RCS file: delete_M_nodes_after_N.c,v Working file: delete_M_nodes_after_N.c head: 1.9 branch: locks: strict root: 1.9 access list: symbolic names: keyword substitution: kv total revisions: 9;    selected revisions: 9 description: Code to demonstrate how to delete M nodes after N nodes in a … Continue reading

Posted in Data Structures with C | Leave a comment

Display elements of a linked list using recursion in C language

RCS file: display_linked_list.c,v Working file: display_linked_list.c head: 1.10 branch: locks: strict root: 1.10 access list: symbolic names: keyword substitution: kv total revisions: 10;    selected revisions: 10 description: Code to demonstrate how to display a linked list using recursion in C … Continue reading

Posted in Data Structures with C | Leave a comment

Module code to show how to pass parameters to a module when using insmod using module_param() macro.

RCS file: header.h,v Working file: header.h head: 1.4 branch: locks: strict root: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4;    selected revisions: 4 description: Header file:<linux/init.h> is included to support module_init() and module_exit() macros. —————————- revision 1.4   … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Program to delete a node at a specified position and also to delete the entire linked list in C language.

RCS file: delete_n_nodes.c,v Working file: delete_n_nodes.c head: 1.11 branch: locks: strict root: 1.11 access list: symbolic names: keyword substitution: kv total revisions: 11;    selected revisions: 11 description: Code to demonstrate how to delete a node at specified position and also … Continue reading

Posted in Data Structures with C | Leave a comment

Program to remove duplicates from a sorted linked list in C language.

RCS file: remove_duplicate_sort.c,v Working file: remove_duplicate_sort.c head: 1.9 branch: locks: strict root: 1.9 access list: symbolic names: keyword substitution: kv total revisions: 9;    selected revisions: 9 description: Code to demonstrate how to remove duplicates in a sorted linked list. —————————- … Continue reading

Posted in Data Structures with C | Leave a comment

Program to compare two single linked lists in C language.

RCS file: compare_linked_list.c,v Working file: compare_linked_list.c head: 1.9 branch: locks: strict root: 1.9 access list: symbolic names: keyword substitution: kv total revisions: 9;    selected revisions: 9 description: Code to demonstrate how to compare the two single linked lists in C. … Continue reading

Posted in Data Structures with C | Leave a comment

Program that inserts a node at the Nth position in a single linked list in C language.

RCS file: insert_at_n_pos.c,v Working file: insert_at_n_pos.c head: 1.12 branch: locks: strict root: 1.12 access list: symbolic names: keyword substitution: kv total revisions: 12;    selected revisions: 12 description: Developing a general code that inserts a node at the N-position specified by … Continue reading

Posted in Data Structures with C | Leave a comment

Code to demonstrate how to create a copy of a single linked list in C.

RCS file: copy_linked_list.c,v Working file: copy_linked_list.c head: 1.14 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 14;    selected revisions: 14 description: Code to demonstrate how to copy an already existing linked list. —————————- revision 1.14 date: … Continue reading

Posted in Data Structures with C | Leave a comment