Skip to main content

Hal

Trait Hal 

Source
pub trait Hal {
    // Required methods
    fn init();
    fn setup_paging();
    fn init_interrupt_controller();
    fn enable_interrupts();
    fn disable_interrupts();
    fn halt();
    fn current_cpu_id() -> u32;
    fn kernel_text_start() -> u64;
    fn kernel_text_end() -> u64;
}
Expand description

Hardware Abstraction Layer trait.

Each architecture must implement this trait to provide architecture-specific operations.

Required Methods§

Source

fn init()

Initialize the HAL for the current architecture.

Source

fn setup_paging()

Set up virtual memory paging.

Source

fn init_interrupt_controller()

Initialize the interrupt controller.

Source

fn enable_interrupts()

Enable interrupts.

Source

fn disable_interrupts()

Disable interrupts.

Source

fn halt()

Halt the CPU until the next interrupt.

Source

fn current_cpu_id() -> u32

Get the current CPU ID (for SMP).

Source

fn kernel_text_start() -> u64

Get the physical address of the kernel text section start.

Source

fn kernel_text_end() -> u64

Get the physical address of the kernel text section end.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§