QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 984|回复: 3

关于启动kernel和模块的关系?

[复制链接]
发表于 2003-5-17 11:39:38 | 显示全部楼层 |阅读模式
Hi,guys,
  当我编译升级内核的时候,总是特别小心,因为很多硬件缺省内核是不支持的。但是缺省安装的内核通过模块支持了。我不明白linux启动的时候,内核和模块动态加载的依存关系,是不是涉及到/etc/modules.conf文件的设置?
  内核是如何check哪些模块需要加载,哪些模块不需要加载?
  谢谢!
PS:昨天读了一下启动部分的code,发现好不习惯哈。和FreeBSD的思想基本不一样。昨天我贴的网址http://www.moses.uklinux.net/patches/lki.html

个人感觉不错,可以快速了解启动过程。 :-)
发表于 2003-5-18 10:47:19 | 显示全部楼层
u can assume a kernel is a minimal core. after it start up, it support basic fucntions. when it need sth, it check and try to load the module dynamically. if succ, then u can consider the module is part of kernel now, even the speed of accessing the routines in module and in kenrel are the same. if fails, then u can not use that functions.

for example. u start up the linux and now u want to mount ntfs system or fdisk it, but ntfs is not in kernel. then kernel will check if there is a ntfs.o.if not, then fails. if so, kernel will load the ntfs.o and then u can use it.
回复

使用道具 举报

 楼主| 发表于 2003-5-18 20:49:58 | 显示全部楼层
我知道你的意思,也理解你的意思。FreeBSD的思想也是这样。
比如:FreeBSD想要加载某个模块,而不是编译在内核的模块,在启动的过程中,会试图从/etc/default/rc.conf和/etc/rc.conf中查找相关配置信息,来决定是否加载。在启动后,通过命令kldload加载也是一种途径,和insmod是一个意思。
因为,以前没有玩过linux,对于linux会查找些什么文件来决定哪些模块需要加载不是很清楚,而且FreeBSD没有主动检查新硬件的功能,所以想了解linux启动会check是否有硬件的实现code。
回复

使用道具 举报

发表于 2003-5-19 08:59:19 | 显示全部楼层
that kudzu in rh is a hardware detect tool. u can man kudzu to get more info about it.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-22 06:26 , Processed in 0.072934 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表