|
My Kernel v0.1.0
|
Represents a device inside the kernel. More...
#include <device.h>
Data Fields | |
| node_t | this |
| Used to list devices, internal use only. | |
| const char * | name |
| The name of the device. | |
| driver_t * | driver |
| The driver for this device. | |
| const struct file_operations * | fops |
| Operations applied to the device's underlying file. More... | |
| struct vnode * | vnode |
| This device's vnode, used by the VFS. | |
This structure is typically embedded in a more specific "per-bus" device-structure. It contains the basic information shared across all types of device, necessary for enumeration, synchronization, etc.
The bulk of the interactions should be performed through the device's bus's API (e.g. there could exist a pci_read(struct pci_device *dev) function to read from a pci device).
| const struct file_operations* device::fops |
Used by the VFS when interacting with a file opened from the devtmpfs. This should be generally filled in by the driver-type API, and not by the device's driver's init function.