Module fdt

Source
Expand description

Flattened Device Tree (FDT) management module.

This module provides functionality for managing the Flattened Device Tree (FDT), which is a data structure used to describe the hardware components of a system.

§Overview

The FDT is passed by the bootloader to the kernel and contains information about the hardware configuration of the system. This module parses and provides access to that information.

§Core Components

  • FdtManager: A singleton that manages access to the parsed FDT
  • init_fdt(): Function to initialize the FDT subsystem

§Usage

Before using the FDT functions, you must:

  1. Set the FDT address using FdtManager::set_fdt_addr()
  2. Call init_fdt() to parse the FDT

After initialization, you can access the FDT using the static manager:

let fdt_manager = FdtManager::get_manager();
if let Some(fdt) = fdt_manager.get_fdt() {
    // Use the FDT data
}

§Implementation Details

The module uses the fdt crate to parse the device tree. It maintains a static global manager instance to provide access throughout the kernel. The FDT address is stored in a static variable that must be set before initialization.

Structs§

FdtManager

Statics§

FDT_ADDR 🔒
MANAGER 🔒

Functions§

init_fdt
Initializes the FDT subsystem.
relocate_fdt
Relocates the FDT to safe memory.