devices_init / buses_init / classes_init / firmware_init / hypervisor_init 函数

devices_init

  • [1. devices_init 函数](#1. devices_init 函数)
  • [2. buses_init 函数](#2. buses_init 函数)
  • [3. classes_init 函数](#3. classes_init 函数)
  • [4. firmware_init 函数](#4. firmware_init 函数)
  • [5. hypervisor_init 函数](#5. hypervisor_init 函数)

1. 函数

  1. 通过 kset_create_and_add 函数,创建 /sys/devices目录(即devices_kset)

  2. 通过 kobject_create_and_add 函数,创建/sys/dev目录(即dev_kobj)

  3. 通过 kobject_create_and_add 函数,创建/sys/dev/block目录(即sysfs_dev_block_kobj,该目录下会以符号链接形式列出所有设备,链接名为主次设备号)

  4. 通过 kobject_create_and_add 函数,创建/sys/dev/char目录(即sysfs_dev_char_kobj,该目录下会以符号链接形式列出所有设备,链接名为主次设备号)


函数


2. buses_init 函数

  1. 通过 kset_create_and_add 函数,创建 /sys/bus目录(即 bus_kset)

  2. 通过 kset_create_and_add 函数,创建 /sys/devices/system目录(即 system_kset)


buses_init 函数


3. classes_init 函数

  1. 通过 kset_create_and_add 函数,创建 /sys/class目录(即class_kset)

classes_init 函数


4. firmware_init 函数

  1. 通过 kobject_create_and_add 函数,创建/sys/firmware目录(即firmware_kobj)

firmware_init 函数


5. hypervisor_init 函数

  1. .config配置文件中配置了CONFIG_SYS_HYPERVISOR,则通过 kobject_create_and_add 函数,创建/sys/hypervisor目录(即hypervisor_kobj)

  2. .config配置文件中未配置CONFIG_SYS_HYPERVISOR,则什么都不做(一般不配置)


hypervisor_init 函数


*[devices_init]: 在 sysfs 中创建三个关键的顶层目录和集合,为后续设备、总线和驱动的注册提供组织骨架

相关推荐
LongRunning13 小时前
【Linux】RK3568-OpenCV+YOLO(八)
linux·opencv·yolo
民乐团扒谱机17 小时前
【微实验】NSGA-II(非支配排序遗传算法)——解决多目标优化问题的“自然选择模拟器”
linux·人工智能·算法
물の韜17 小时前
ZYNQ/FMQL系列Linux之I2C开发实战
linux·arm开发·嵌入式硬件·设备树·iic·zynq
qq_3718021117 小时前
Ubuntu Linux中安装WorkBuddy
linux·运维·服务器·ubuntu
无足鸟ICT17 小时前
【RHCA+】iptraf-ng(网络监控分析)
linux·网络
独隅18 小时前
WebStorm 在 Linux 环境下的实战安装与高效开发指南
linux·ide·webstorm
坤坤子吖19 小时前
Linux网络编程:TCP服务器的多进程与多线程实现
linux·服务器·开发语言·网络·c++·笔记·学习
阡陌数智20 小时前
Claude API新版本重大变更与安全升级指南
java·linux·安全
奶茶树20 小时前
【Linux】环境开发工具(vim,gcc,g++,Makefile)
linux·运维·vim
木子欢儿1 天前
国内 macOS/Linux 安装 rust
linux·运维·服务器·macos·rust