Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/patches/9feaab8303f642b2 # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aienux#123 (code only) closed derived `9feaab8303f642b2` #123 Imported from GitHub aien-dev/aienux#123 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `3a6174a0b2de7cf1e028f40ef8d72b00f3ad9fa4` · Head `0c939a26649247fe934e964c1661999a3e066acd` ### Apply it ``` git checkout -b patch-9feaab8303f642b2 3a6174a0b2de7cf1e028f40ef8d72b00f3ad9fa4 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/9feaab8303f642b2.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aienux 123 0c939a26649247fe934e964c1661999a3e066acd ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aienux","number":123,"url":"https://github.com/aien-dev/aienux/pull/123","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:35:46Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/crates/aienos-boot/src/handoff.rs b/crates/aienos-boot/src/handoff.rs index 320ac312..d2554ff9 100644 --- a/crates/aienos-boot/src/handoff.rs +++ b/crates/aienos-boot/src/handoff.rs @@ -281,6 +281,7 @@ fn configure_smmu_for_xhci( Ok(stream_id) } +#[allow(clippy::too_many_arguments)] fn enter_kernel_mmu( memory_map: &impl MemoryMap, pool_base: usize, @@ -1856,7 +1857,7 @@ fn main() -> Status { "gic_madt: gicd={:#x} gicr={:#x} arch_rev={} icc_sre={}", w.distributor, w.redistributor, w.arch_rev, w.icc_sre ); - let avg = if w.ticks == 0 { 0 } else { w.span / w.ticks }; + let avg = w.span.checked_div(w.ticks).unwrap_or(0); let _ = writeln!( report, "timer_stats: intid=30 freq_hz={} period_us={} min_us={} avg_us={} max_us={}", diff --git a/crates/aienos-boot/src/usb_keyboard.rs b/crates/aienos-boot/src/usb_keyboard.rs index 5b0d2d24..45a0bb8a 100644 --- a/crates/aienos-boot/src/usb_keyboard.rs +++ b/crates/aienos-boot/src/usb_keyboard.rs @@ -241,6 +241,7 @@ fn revoke_dma(screen: &mut Option, ecam: &mut Ecam, at: &XhciLocation) { } /// Post-exit: bring up the keyboard and echo keys until Enter or timeout. +#[allow(clippy::too_many_arguments)] pub fn run( xhci: Option, takeover: Option, @@ -410,11 +411,7 @@ pub fn run( say(screen, "keyboard: done (enter)\n"); let elapsed = counter_ticks().wrapping_sub(start); let hz = counter_frequency_hz(); - let uptime_ms = if hz == 0 { - 0 - } else { - elapsed.saturating_mul(1000) / hz - }; + let uptime_ms = elapsed.saturating_mul(1000).checked_div(hz).unwrap_or(0); let input = core::str::from_utf8(&line[..length]).unwrap_or(""); let parsed = aienos_kernel::shell::parse_line(input); let output = aienos_kernel::shell::dispatch( diff --git a/crates/aienos-kernel/src/boot.rs b/crates/aienos-kernel/src/boot.rs index 1994e872..f6a177be 100644 --- a/crates/aienos-kernel/src/boot.rs +++ b/crates/aienos-kernel/src/boot.rs @@ -532,6 +532,10 @@ mod tests { } /// Canonical bare-metal entry point when compiling for `#![no_std]` targets. +/// +/// # Safety +/// Only the boot loader may call this, once, on the boot CPU at EL1 with a +/// valid stack; it never returns. #[cfg(all(target_os = "none", not(feature = "std"), not(test)))] #[no_mangle] pub unsafe extern "C" fn _start() -> ! { diff --git a/scripts/verify_all.sh b/scripts/verify_all.sh index 31ef9ca0..e0e73b86 100755 --- a/scripts/verify_all.sh +++ b/scripts/verify_all.sh @@ -61,6 +61,17 @@ echo "--- [Clippy Verification: -D warnings] ---" cargo clippy --workspace --all-targets -- -D warnings echo "PASS clippy: zero warnings with -D warnings" +# Step 3b: target-only code (bare-metal kernel, UEFI images) is invisible to +# the host clippy run above, so lint each shipped target/feature set too. +echo "" +echo "--- [Clippy Verification: AArch64 targets, -D warnings] ---" +cargo clippy -p aienos-kernel --target aarch64-unknown-none --no-default-features -- -D warnings +cargo clippy -p aienos-kernel --target aarch64-unknown-none --no-default-features --features seed0b-test-anchor -- -D warnings +for features in firmware handoff seed0b-qualification usb-keyboard; do + cargo clippy -p aienos-boot --target aarch64-unknown-uefi --features "${features}" --bins -- -D warnings +done +echo "PASS clippy: aarch64-unknown-none kernel and aarch64-unknown-uefi images, zero warnings" + # Step 4: Bare-metal library compilation check (not a boot test) echo "" echo "--- [Bare-Metal Target Compilation Check] ---" ```