Expand description
Network Initialization Orchestrator
Complete network stack initialization for the bootloader. This module
coordinates dma-pool and morpheus_network to bring up networking
and return success/failure to the bootstrap phase.
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Bootstrap (bootloader) │
│ Calls NetworkInit::initialize(), displays result │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ core::net (this module) │
│ Orchestrates init, manages error ring buffer │
└─────────────────────────────────────────────────────────────┘
│
┌────────────────────┼────────────────────┐
▼ ▼ ▼
dma-pool morpheus_network ping (later)§Error Handling
All errors are logged to a ring buffer that the bootstrap UI can dump if initialization fails. This includes:
- Core orchestration errors
- Network crate debug logs (forwarded from its ring buffer)
§Usage
ⓘ
use morpheus_core::net::{NetworkInit, InitConfig, NetworkStatus};
// Bootstrap phase
let config = InitConfig::default();
match NetworkInit::initialize(config, get_time_ms) {
Ok(status) => {
// Network ready! status.ip_address has our IP
// Later: call ping to verify connectivity
}
Err(e) => {
// Dump error ring buffer to UI
while let Some(entry) = net::error_log_pop() {
display_error(&entry);
}
}
}Modules§
- config 🔒Network initialization configuration.
- error 🔒Network initialization errors.
- init 🔒Network initialization orchestrator (DEPRECATED).
- Error Ring Buffer for Network Initialization
- status 🔒Network initialization status.
Structs§
- Single log entry in the ring buffer
- Network initialization configuration.
- Network status after successful initialization.
Enums§
- Stage identifiers for error categorization
- Network initialization error.
Constants§
- ECAM base address for QEMU i440FX machine type.
- ECAM base address for QEMU Q35 machine type.
Functions§
- Log a debug/info message to the ring buffer
- Drain entries from the network crate’s debug ring buffer and forward them to our error ring buffer.
- Log an error message to the ring buffer
- Check how many entries are available to read
- Clear the ring buffer
- Get total number of entries ever written (for overflow detection)
- Pop the oldest entry from the ring buffer
Type Aliases§
- Result type for network initialization.