Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds initial ARM32 (ARMv7-A) architecture support to the ArceOS operating system, alongside upgrading several dependencies (page_table_multiarch 0.5→0.6, various crate bumps) and adapting the page table API to a new cursor-based interface.
Changes:
- Adds ARM32 target (
armv7a-none-eabi) across build system, CI, QEMU configuration, platform crate wiring, and architecture-specific code paths (TLS, percpu, paging, C headers, setjmp/longjmp stubs). - Migrates page table operations from direct
map/unmap/protect_regioncalls to a cursor-based API (pt.cursor().map_region(...)) to matchpage_table_multiarchv0.6. - Fixes potential overflow in network benchmarks by changing counter types from
usizetou64(needed for 32-bit targets where10 * GBoverflowsusize).
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Adds workspace deps and patches for arm32 fork dependencies |
| Cargo.lock | Dependency version updates and new arm32-related crates |
| Makefile | Adds arm32 target, changes default MEM to 1G |
| rust-toolchain.toml | Adds armv7a-none-eabi target |
| scripts/make/*.mk | Adds arm32 QEMU machine, CFLAGS, platform mappings |
| modules/axhal/* | Adds arm32 platform crate, page table type, TLS/percpu, paging API migration |
| modules/axmm/src/backend/*.rs | Migrates to cursor-based page table API |
| modules/axmm/src/aspace.rs | Cursor-based API + access_flags conversion |
| modules/axnet/src/smoltcp_impl/bench.rs | Fixes usize overflow on 32-bit by using u64 |
| modules/axdriver/src/drivers.rs | Adds debug log in ramdisk probe |
| ulib/axlibc/* | Arm32 C header support, stub setjmp/longjmp, build.rs fix |
| api/arceos_posix_api/src/imp/time.rs | Fixes tv_sec cast for 32-bit |
| examples/* | Adds arm32 platform support |
| .github/workflows/*.yml | Adds arm32 to CI matrix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Copilot reviewed 34 out of 35 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Copilot reviewed 32 out of 34 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds ARM32 (armv7a) support across the build system, libc shims, HAL, and CI to enable building and running ArceOS on qemu-system-arm (virt).
Changes:
- Add ARM32 target support in Makefiles, QEMU runner scripts, Rust toolchain targets, and CI matrices.
- Extend axlibc/posix API headers and shims for ARM32 ABI details (TLS, setjmp/longjmp, stdint/float/assert).
- Update core dependencies and paging/percpu integrations to newer crate APIs that support ARM32.
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ulib/axlibc/src/setjmp.rs | Adds ARM32-specific returns/termination paths for setjmp/longjmp stubs. |
| ulib/axlibc/src/malloc.rs | Aligns allocator metadata for ARM32 ABI expectations. |
| ulib/axlibc/include/stdint.h | Defines intptr_t/uintptr_t sizing for __arm__. |
| ulib/axlibc/include/setjmp.h | Introduces ARM32 __jmp_buf sizing. |
| ulib/axlibc/include/float.h | Adds ARM32 long-double/decimal constants. |
| ulib/axlibc/include/assert.h | Implements standard NDEBUG behavior for assert. |
| ulib/axlibc/build.rs | Forces explicit clang --target for bindgen to avoid host ABI leakage. |
| scripts/make/qemu.mk | Adds QEMU machine/cpu settings and args for ARM virt. |
| scripts/make/platform.mk | Adds ARM platform package selection and updates error message. |
| scripts/make/build_c.mk | Adds ARM soft-float CFLAGS when fp-simd is disabled. |
| rust-toolchain.toml | Adds armv7a-none-eabi target to toolchain targets list. |
| modules/axtask/Cargo.toml | Bumps percpu dependency version for ARM32 support. |
| modules/axruntime/Cargo.toml | Bumps axplat/percpu versions for ARM32 support. |
| modules/axnet/src/smoltcp_impl/bench.rs | Switches bandwidth counters to u64 to avoid 32-bit overflow. |
| modules/axmm/src/backend/mod.rs | Updates to new page-table cursor-based protect_region API. |
| modules/axmm/src/backend/linear.rs | Updates to cursor-based map/unmap region APIs. |
| modules/axmm/src/backend/alloc.rs | Updates populate/map/unmap/remap to cursor-based APIs. |
| modules/axmm/src/aspace.rs | Updates copy/protect logic to cursor API and truncates access flags. |
| modules/axipi/Cargo.toml | Bumps percpu dependency version. |
| modules/axhal/src/tls.rs | Adds ARM32 TLS layout constants and __aeabi_read_tp hook. |
| modules/axhal/src/percpu.rs | Adds ARM32 IRQ-guarded current task access; updates percpu init API. |
| modules/axhal/src/paging.rs | Adapts paging handler to multi-frame allocation API; adds ARM page table type. |
| modules/axhal/src/lib.rs | Links ARM platform crate when targeting ARM32. |
| modules/axhal/linker.lds.S | Changes .data alignment to 16K (affects all targets). |
| modules/axhal/Cargo.toml | Updates feature lists and bumps deps (percpu, axplat, page_table_multiarch); adds ARM platform dep. |
| examples/shell/Cargo.toml | Formatting-only change (no functional impact). |
| examples/helloworld-myplat/src/main.rs | Adds ARM platform extern crate selection. |
| examples/helloworld-myplat/Cargo.toml | Adds arm-qemu-virt feature and ARM target dependency. |
| arceos-apps | Updates the subproject git commit pointer. |
| api/arceos_posix_api/src/imp/time.rs | Changes tv_sec conversion casts (likely for 32-bit compatibility). |
| api/arceos_posix_api/src/imp/pthread/mutex.rs | Adds alignment static assert for pthread mutex ABI. |
| api/arceos_posix_api/build.rs | Adds 32-bit variants for pthread mutex initializer and forces 8-byte alignment. |
| Makefile | Adds arm ARCH option and sets Rust target triple for ARM. |
| Cargo.toml | Adds workspace-level deps and patches crates.io deps to git repos/branches for ARM32. |
| .github/workflows/test.yml | Adds ARM to test matrix; switches arceos-apps source/commit. |
| .github/workflows/build.yml | Adds ARM to build matrices and installs ARM target. |
Comments suppressed due to low confidence (2)
ulib/axlibc/src/setjmp.rs:1
- For ARM32,
longjmpcurrently becomes an infinite loop (b .). While it does technically make the function non-returning, it will hard-hang the CPU and mask the real failure mode. If ARM32longjmpisn't implemented yet, prefer an explicit trap/abort path (so failures are diagnosable) or implement the actual register restore/jump sequence consistent with the__jmp_bufABI used by your headers.
ulib/axlibc/include/setjmp.h:1 __jmp_buf[64]appears inconsistent with the comment (r4-r14 is 11 regs; d8-d15 is 8 double-precision regs = 16 32-bit words under typical AAPCS; total is far below 64 words even after adding SP/LR/PC/flags). A mismatch here will break the C ABI and any Rust asm implementation that assumes a particular buffer layout/size. Please align the buffer size (and ideally document exact saved slots/ordering) to match the actual ARM32 setjmp/longjmp implementation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 37 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (1)
Cargo.toml:84
- The
[patch.crates-io]entries point at moving git branches (e.g.branch = "arm32") and unpinned repos, which makes builds non-reproducible and can silently change dependencies without a lockfile update. Please pin to specificrevhashes (or tags) and consider scoping these patches behind an opt-in feature/profile so default builds keep using published crates.
[patch.crates-io]
axcpu = { git = "https://github.com/luodeb/axcpu.git" }
axplat = { git = "https://github.com/luodeb/axplat_crates.git", branch = "arm32" }
axplat-x86-pc = { git = "https://github.com/luodeb/axplat_crates.git", branch = "arm32" }
axplat-arm-qemu-virt = { git = "https://github.com/luodeb/axplat_crates.git", branch = "arm32" }
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
In ulib/axlibc/include/limits.h, __LONG_MAX should be 0x7fffffffL for 32-bit platforms. Otherwise, the following warning will appear when compiling the C application:
In file included from ulib/axlibc/c/stdlib.c:3:
ulib/axlibc/c/stdlib.c: In function ‘strtoul’:
/home/jyk/arceos/ulib/axlibc/include/limits.h:17:25: warning: integer overflow in expression of type ‘long long int’ results in ‘-2’ [-
Woverflow]
17 | #define ULONG_MAX (2UL * LONG_MAX + 1)
| ^
ulib/axlibc/c/stdlib.c:174:29: note: in expansion of macro ‘ULONG_MAX’
174 | cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
| ^~~~~~~~~
/home/jyk/arceos/ulib/axlibc/include/limits.h:17:25: warning: integer overflow in expression of type ‘long long int’ results in ‘-2’ [-
Woverflow]
17 | #define ULONG_MAX (2UL * LONG_MAX + 1)
| ^
ulib/axlibc/c/stdlib.c:175:29: note: in expansion of macro ‘ULONG_MAX’
175 | cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
| ^~~~~~~~~
/home/jyk/arceos/ulib/axlibc/include/limits.h:17:25: warning: integer overflow in expression of type ‘long long int’ results in ‘-2’ [-
Woverflow]
17 | #define ULONG_MAX (2UL * LONG_MAX + 1)
| ^
ulib/axlibc/c/stdlib.c:197:15: note: in expansion of macro ‘ULONG_MAX’
197 | acc = ULONG_MAX;
| ^~~~~~~~~
```
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 38 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…MappingFlags directly
…EMU configurations
…t jmp_buf size in setjmp.h
Introduces support for the ARM QEMU Virt platform, enabling both example and shell use. Upgrades and aligns various dependencies and platform crates to newer versions, improving consistency and compatibility. Increases default memory allocation for QEMU runs, improves driver probing diagnostics, and fixes potential integer truncation in time and network benchmarking logic. Enables additional features in the shell and driver modules for better out-of-the-box experience.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nment in linker script; refine setjmp/longjmp implementations for ARM architecture
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
scripts/make/qemu.mk:33
qemu_args-x86_64now passes$(FINAL_IMG)to-kernel, butFINAL_IMGis a stripped binary or uImage (not the ELF). If the x86_64 boot flow expects an ELF (e.g., for multiboot/segment loading), this will regressmake runfor x86_64. Please confirm QEMU x86_64 can boot the chosenFINAL_IMGformat; otherwise keep using$(OUT_ELF)for x86_64 or setFINAL_IMGto an ELF-compatible image for that arch.
qemu_args-x86_64 := \
-machine $(machine) \
-kernel $(OUT_ELF)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…pport in ARM architecture fix: update timeval conversion to use c_longlong for tv_sec in time module fix: change MemoryControlBlock representation to C-compatible in malloc module fix: enhance setjmp/longjmp implementations with architecture checks and error handling
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…jmp implementation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fn from(d: Duration) -> Self { | ||
| ctypes::timespec { | ||
| tv_sec: d.as_secs() as c_long, | ||
| tv_sec: d.as_secs() as i64, |
| endif | ||
| endif | ||
|
|
||
| ifeq ($(ARCH), arm) |
There was a problem hiding this comment.
Merge with the above libgcc :=
No description provided.