免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 672 | 回复: 0
打印 上一主题 下一主题

divice init [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-28 20:33 |只看该作者 |倒序浏览
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP