DEVICE(9)
π DEVICE(9) π
ok so bestie, this is the kernel developer's manual page for device, and we're about to make device objects make sense. no cap. π¦
β¨ NAME β¨
device β an abstract representation of a device
πΈ SYNOPSIS πΈ
typedef struct device *device_t;
like, that's it. that's the whole synopsis. iconic.
π DESCRIPTION π
okay so, the device object is literally the kernel's little avatar for a piece of hardware attached to the system. we're talking expansion cards, the bus that card is plugged into, disk drives hanging off that expansion card, etc. etc. the whole family tree basically. π«Ά
the system defines one device all by itself β root_bus β and every other device gets created dynamically during autoconfiguration. normally the devices representing top-level buses in the system (ISA, PCI etc.) get attached directly to root_bus, and everything else gets added as children of their relevant bus. it's giving... tree structure, lowkey. π³
and speaking of trees: the devices in a system form a tree. every device except root_bus has a parent (peep device_get_parent(9)). plus, any device can have children attached to it β see device_add_child(9), device_add_child_ordered(9), device_find_child(9), device_get_children(9), and device_delete_child(9). the way that a whole bus can just have children... main character energy fr fr. π
a device that's been successfully probed and attached to the system will also have a driver (see device_get_driver(9) and driver(9)) and a devclass (see device_get_devclass(9) and devclass(9)). and there's a whole lil' pile of other attributes too:
- a unit number (see
device_get_unit(9)) - a verbose description (normally supplied by the driver β see
device_set_desc(9)anddevice_get_desc(9)) - a set of bus-specific variables (see
device_get_ivars(9)) - a set of driver-specific variables (see
device_get_softc(9))
ngl that's a lot of getters. slay. β¨
π the states, bestie π
devices can be in one of several states:
DS_NOTPRESENTβ the device has not been probed for existence, or the probe failed πDS_ALIVEβ the device probe succeeded but it's not yet attachedDS_ATTACHEDβ the device has been successfully attached πDS_BUSYβ the device is currently open π
you can figure out which state a device is in by calling device_get_state(9). vibe check, but for hardware. π§
π SEE ALSO π
π AUTHORS π
this manual page was written by Doug Rabson. thank you king. π
and that's the whole page bestie, no notes. π
Debian Β· January 15, 2017 β that's the source, the version, and the date, mwah. periodt. πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms