Skip to content

Commit

Permalink
add LKD 17
Browse files Browse the repository at this point in the history
  • Loading branch information
firmianay committed Jun 4, 2017
1 parent 5c37597 commit 901c32f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Linux Kernel Development
13. [Chapter 13: The Virtual Filesystem](./linux-kernel-development/chapter-13.md)
14. [Chapter 14: The Block I/O Layer](./linux-kernel-development/chapter-14.md)
15. [Chapter 15: The Process Address Space](./linux-kernel-development/chapter-15.md)
16. (-) [Chapter 16: The Page Cache and Page Writeback](./linux-kernel-development/chapter-16.md)
16. [Chapter 16: The Page Cache and Page Writeback](./linux-kernel-development/chapter-16.md)
17. (-) [Chapter 17: Devices and Modules](./linux-kernel-development/chapter-17.md)

Paper Review
---
Expand Down
29 changes: 29 additions & 0 deletions linux-kernel-development/chapter-17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Chapter 17: Devices and Modules

- `Device types`: Classifications used in all Unix systems to unify behavior of common devices
- `Modules`: The mechanism by which the Linux kernel can load and unload object code on demand
- `Kernel objects`: Support for adding simple object-oriented behavior and a parent/child relationship to kernel data structures
- `Sysfs`: A filesystem representation of the system's device tree


## Device Types
In Linux, as with all Unix systems, devices are classified into one of three types:
- `Block devices`: Often abbreviated `blkdevs`, `block devices` are addressable in device-specified chunks called `blocks` and generally support `seeking`, the random access of data.
- `Character devices`: Often abbreviated `cdevs`, character devices are generally not addressable, providing access to data only as a stream, generally of characters (bytes).
- `Network devices`: Sometimes called `Ethernet devices` after the most common type of network devices, `network devices` provide access to a network via a physical adapter and a specific protocol.


## Modules
The Linux kernel is modular, supporting the dynamic insertion and removal of code from itself at runtime. Related subroutines, data, and entry and exit points are grouped together in a single binary image, a loadable kernel object, called a `module`.


## The Device Model
A significant new feature in the 2.6 Linux kernel is the addition of a unified `device model`. The device model provides a single mechanism for representing devices and describing their topology in the system.



## sysfs
The `sysfs filesystem` is an in-memory virtual filesystem that provides a view of the kobject hierarchy. It enables users to view the device topology of their system as a simple filesystem. Using attributes, kobjects can export files that enable kernel variables to be read from and optionally written to.

The magic behind `sysfs` is simply tying kobjects to directory entries via the dentry
member inside each kobject.

0 comments on commit 901c32f

Please sign in to comment.