Linux Kernel list Depth analysis

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.