The device model of the Linux2.6 Kernel

Source: Internet
Author: User
Linux general technology-Linux programming and kernel information for the device model of Linux kernel. The following is a detailed description. Source: Linux community

An important feature of the Linux 2.6 kernel is the provision of a unified kernel device model. With the continuous advancement of technology, the topology structure of the system becomes more and more complex, and the requirements for intelligent power management, hot swapping, and support for plug and play are also increasing. The 2.4 kernel is hard to meet these requirements. To meet the needs of this situation, the 2.6 kernel has developed a new device model.

1. Sysfs File System

Sysfs is a special file system similar to the proc file system. It organizes devices in the system into hierarchies and provides detailed kernel data structure information to user mode programs.

Its top-level directories mainly include:
Block Directory: contains all Block devices
Devices Directory: contains all the Devices in the system, and is organized into hierarchies according to the bus type attached to the device.
Bus Directory: contains all Bus types in the system
Drivers directory: includes all registered device Drivers in the kernel
Class Directory: the types of devices in the system (such as NIC devices and sound card devices)

2. Key data structures of the kernel object mechanism

2.1 kobject Kernel Object

Kobject is a new device management mechanism introduced in Linux 2.6. It is represented by struct kobject in the kernel. Through this data structure, all devices have a unified interface at the underlying layer. kobject provides basic object management, which is the core structure of the Linux 2.6 device model. It is closely associated with the sysfs file system, each kobject object registered in the kernel corresponds to a directory in the sysfs file system.

The Kobject structure is defined:
QUOTE:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.