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 中创建三个关键的顶层目录和集合,为后续设备、总线和驱动的注册提供组织骨架

相关推荐
M78佐菲2 小时前
ARM学习笔记(12)
linux·arm开发·笔记·嵌入式硬件·学习
可涵不会debug2 小时前
C++ std::bind 实战教程:线程池、回调场景全覆盖
linux·开发语言·c++
青梅味猪大肠3 小时前
【操作系统-26】进程互斥软件实现-Peterson算法
linux·运维·服务器
wdfk_prog3 小时前
Wi-Fi Direct教程 01:在 Ubuntu 搭建双 mac80211_hwsim + wpa_supplicant 2.12
linux·运维·服务器·ubuntu·ros·wifi-direct
Vcaker4 小时前
Linux学习36-k8s集群升级及kube-vip高可用
linux·运维·学习
skywalk81635 小时前
Deepseek harness的4种模式 配置文件内容
linux·人工智能·ubuntu·deepseek·harness
沫璃染墨5 小时前
《从零入门Linux系统篇(五十一):线程篇·四——pthread线程库详解:从线程创建到终止与分离》
linux·运维·服务器·开发语言·c++·系统架构·线程
YYRAN_ZZU5 小时前
GMSL开发加解串配置介绍
linux·嵌入式硬件
云计算练习生5 小时前
什么是上下文切换?进程切换时 CPU 到底在保存什么
linux·服务器·操作系统·进程切换