axplat-aarch64-bsta1000b

Crates.ioaxplat-aarch64-bsta1000b
lib.rsaxplat-aarch64-bsta1000b
version0.2.0
created_at2025-07-02 08:33:05.303703+00
updated_at2025-08-21 04:03:08.227613+00
descriptionImplementation of `axplat` hardware abstraction layer for Black Sesame Technology A1000b SoC.
homepagehttps://github.com/arceos-org/arceos
repositoryhttps://github.com/arceos-org/axplat_crates
max_upload_size
id1734767
size43,613
core (github:arceos-org:core)

documentation

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

README

axplat-aarch64-bsta1000b

Implementation of axplat hardware abstraction layer for Black Sesame Technology A1000b SoC.

Install

cargo +nightly add axplat axplat-aarch64-bsta1000b

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_bsta1000b;

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: 90

cargo fmt