hotplug:软件+硬件 学习总结

Q:热插拔
A:一个完整的热插拔系统包括热插拔系统的硬件,支持热插拔的软件和操作系统,支持热
插拔的设备驱动程序和支持热插拔的用户接口。

  1. 硬件支持:插入,先数据,后电源;拔出,先电源,后数据,最重要的是检测电平变化的引脚
  2. uevent, user space event. 内核与用户空间的一种通信机制
http://www.wowotech.net/linux_kenrel/uevent.html 主要讲述的是头文件热插拔事件从内核空间到用户空间
http://blog.csdn.net/bingqingsuimeng/article/details/7922217 一般,并且知识体系太老了
http://blog.csdn.net/bingqingsuimeng/article/details/7924300  有源代码的讲解,比较清晰
http://www.cnblogs.com/image-eye/archive/2011/08/19/2145858.html 内核启动过程的驱动加载
http://blog.chinaunix.net/uid-25721104-id-3023525.html 讨论的关于热插拔
http://blog.csdn.net/zirconsdu/article/details/8792184 图解很清晰

讲清楚了koject_uevent_env在做了什么,如何进入用户空间:https://elixir.bootlin.com/linux/latest/source/lib/kobject_uevent.c#L456

/**
 * kobject_uevent_env - send an uevent with environmental data
 *
 * @kobj: struct kobject that the action is happening to
 * @action: action that is happening
 * @envp_ext: pointer to environmental data
 *
 * Returns 0 if kobject_uevent_env() is completed with success or the
 * corresponding error when it fails.
 */
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
		       char *envp_ext[])
{
	struct kobj_uevent_env *env;
	const char *action_string = kobject_actions[action];
	const char *devpath = NULL;
	const char *subsystem;
	struct kobject *top_kobj;
	st
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值