#embedded-hal #arm64 #arceos #hal

no-std axplat-aarch64-phytium-pi

Implementation of axplat hardware abstraction layer for Phytium Pi board

2 unstable releases

Uses new Rust 2024

0.2.0 Aug 21, 2025
0.1.0 Jul 2, 2025

#2334 in Embedded development

Download history 146/week @ 2025-07-09 147/week @ 2025-07-16 174/week @ 2025-07-23 177/week @ 2025-07-30 203/week @ 2025-08-06 243/week @ 2025-08-13 565/week @ 2025-08-20 284/week @ 2025-08-27 277/week @ 2025-09-03 140/week @ 2025-09-10 139/week @ 2025-09-17 208/week @ 2025-09-24 33/week @ 2025-10-01 109/week @ 2025-10-08 42/week @ 2025-10-15 181/week @ 2025-10-22

371 downloads per month

GPL-3.0-or-later OR Apache-2…

65KB
944 lines

axplat-aarch64-phytium-pi

Crates.io CI

Implementation of axplat hardware abstraction layer for Phytium Pi board.

Install

cargo +nightly add axplat axplat-aarch64-phytium-pi

Usage

1. Write your kernel code

#[axplat::main]
fn kernel_main(cpu_id: usize, arg: usize) -> ! {
    // Initialize trap, console, time.
    axplat::init::init_early(cpu_id, arg);
    // Initialize platform peripherals (not used in this example).
    axplat::init::init_later(cpu_id, arg);

    // Write your kernel code here.
    axplat::console_println!("Hello, ArceOS!");

    // Power off the system.
    axplat::power::system_off();
}
// Can be located at any dependency crate.
extern crate axplat_aarch64_phytium_pi;

3. Use a linker script like the following

ENTRY(_start)
SECTIONS
{
    . = 0xffff000090000000;

    .text : ALIGN(4K) {
        *(.text.boot)               /* This section is required */
        *(.text .text.*)
    }

    .rodata : ALIGN(4K) {
        *(.rodata .rodata.*)
    }

    .data : ALIGN(4K) {
        *(.data .data.*)
    }

    .bss : ALIGN(4K) {
        *(.bss.stack)               /* This section is required */
        . = ALIGN(4K);
        *(.bss .bss.*)
        *(COMMON)
    }

    _ekernel = .;                   /* Symbol `_ekernel` is required */

    /DISCARD/ : {
        *(.comment)
    }
}

Some symbols and sections are required to be defined in the linker script, listed as below:

  • _ekernel: End of kernel image.
  • .text.boot: Kernel boot code.
  • .bss.stack: Stack for kernel booting.

hello-kernel is a complete example of a minimal kernel implemented using axplat and related platform packages.

Dependencies

~9MB
~126K SLoC