axplat-aarch64-rk3588j

Crates.ioaxplat-aarch64-rk3588j
lib.rsaxplat-aarch64-rk3588j
version0.1.0
created_at2025-07-28 06:53:57.267114+00
updated_at2025-07-28 06:53:57.267114+00
descriptionImplementation of `axplat` hardware abstraction layer for Rockchip RK3588J SoC.
homepage
repositoryhttps://github.com/buhenxihuan/axplat_crates
max_upload_size
id1770786
size54,141
hypervisor (github:arceos-hypervisor:hypervisor)

documentation

https://docs.rs/axplat-aarch64-rk3588j

README

axplat-aarch64-rk3588j

Implementation of axplat hardware abstraction layer for Rockchip RK3588J SoC.

Install

cargo +nightly add axplat axplat-aarch64-rk3588j

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();
}

2. Link your kernel with this package

// Can be located at any dependency crate.
extern crate axplat_aarch64_rk3588j;

3. Use a linker script like the following

ENTRY(_start)
SECTIONS
{
    . = 0xffff000081000000;

    .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.

Commit count: 0

cargo fmt