Linked List introduction: A linked list is a common data structure that connects a series of data nodes into a data chain through pointers. Relative to the array, the linked list has a better dynamic, the establishment of the linked list without prior knowledge of the total amount of data, you can randomly allocate space, you can effectively in the linked list anywhere in real-time insert or delete data . The cost of a linked list is primarily the order of access and the loss of space in the organization chain.
The Linux kernel linked list is a two-way circular linked list
Creating and accessing linked lists
Create mylist.c under the Linux directory
#include <linux/module.h><linux/init.h>int mylist_init () { return 0;} void Mylist_exit () { }module_init (mylist_init); Module_exit (mylist_exit);
Re-create Makefile
Obj-m: = mylist.okdir:=/root/myhome/linux-2.6. 32.2/All: Make-C $ (Kdir) m=$ (PWD) modules cross_compile=arm-linux-arch= Armclean: rm -F *.o *.ko *.order *.symvers
Compiling the direct make will result in the. Ko kernel module file.
In this case, add a list of mylist.c files
Linux Kernel list Depth analysis