About do_basic_setup during network initialization in Linux Kernel

Source: Internet
Author: User
About do_basic_setup during network initialization in Linux kernel-general Linux technology-Linux programming and kernel information. During linux network initialization, The start_kernel () function in initmain. c calls kernel_thread to start the init process, which corresponds to the init function in initmain. c. The init function calls the do_basic_setup () function, which calls the sock_init () function in netsocket. c.

Do_basic_setup:

Initialize the bus (such as pci_init ())

Network initialization (initialize the network data structure, sock_init (); In 2.4.17, sock_init () only initializes the network data structure. The actual protocol initialization is to run do_initcils () automatically load each protocol module)

Create an event management Core Thread (start_context_thread ())

Load all modules (use do_initcballs () to start any function identified by _ initcall (to facilitate core developers to add startup functions ))

# Define module_init (x) _ initcall (x. h, so that the system initializes to call initmain. module x is automatically loaded when do_initcils in c (enters x initialization ). In af_inet.c, module_init (inet_init) exists, so it also includes initializing the inet module. Haha

It is easier to understand in 2.6.14.2. View
CODE: static void _ init do_basic_setup (void)
{
/* Drivers will send hotplug events */
Init_workqueues ();
Usermodehelper_init ();
Driver_init ();

# Ifdef CONFIG_SYSCTL
Sysctl_init ();
# Endif

/* Networking initialization needs a process context */
Sock_init ();

Do_initcils ();
}

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.