Module manager

Source
Expand description

§Device Manager Module

This module provides functionality for managing hardware devices in the kernel.

§Overview

The device manager is responsible for:

  • Registering and managing serial devices
  • Tracking available device drivers
  • Device discovery and initialization
  • Managing device information

§Key Components

  • BasicDeviceManager: Manages fundamental I/O devices like serial ports
  • DeviceManager: The main device management system that handles all devices and drivers

§Device Discovery

Devices are discovered through the Flattened Device Tree (FDT). The manager:

  1. Parses the device tree
  2. Matches compatible devices with registered drivers
  3. Probes devices with appropriate drivers

§Usage

The device manager is implemented as a global singleton that can be accessed via:

  • DeviceManager::get_manager() - Immutable access
  • DeviceManager::get_mut_manager() - Mutable access

§Example: Registering a serial device

use crate::device::manager::register_serial;
 
// Create a new serial device
let my_serial = Box::new(MySerialImplementation::new());
 
// Register with the device manager
register_serial(my_serial);

Structs§

BasicDeviceManager
BasicDeviceManager
BorrowedDeviceGuard
DeviceHandle
DeviceManager
DeviceManager

Enums§

DeviceState

Statics§

MANAGER 🔒

Functions§

register_serial
Registers a serial device with the device manager.

Type Aliases§

BorrowedDevice