- 论坛徽章:
- 0
|
SCSI network card等的驱动当然也是在 start_kernel()函数里完成的
start_kernel() -> do_basic_setup -> driver_init -> device_init () ==2.6
主要是研究这个函数
727 * Ok, the machine is now initialized. None of the devices
728 * have been touched yet, but the CPU subsystem is up and
729 * running, and memory and process management works.
730 *
731 * Now we can finally start doing some real work..
732 */
733static void __init do_basic_setup(void)
734{
735 /* drivers will send hotplug events */
736 init_workqueues();
737 usermodehelper_init();
738 driver_init();
739 init_irq_proc();
740 do_initcalls();
741}
===>走到driver_init()
17 * driver_init - initialize driver model.
18 *
19 * Call the driver model init functions to initialize their
20 * subsystems. Called early from init/main.c.
21 */
22
23void __init driver_init(void)
24{
25 /* These are the core pieces */
26 devices_init();
27 buses_init();
28 classes_init();
29 firmware_init();
30 hypervisor_init();
31
32 /* These are also core pieces, but must come after the
33 * core core pieces.
34 */
35 platform_bus_init();
36 system_bus_init();
37 cpu_dev_init();
38 memory_dev_init();
39 attribute_container_init();
40}
而2.4稍微不同,但是大致流程相似
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/67119/showart_626729.html |
|