Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
verify:
name: Verify and QEMU Boot Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-none, aarch64-unknown-uefi
components: clippy, rustfmt

- name: Install QEMU and AAVMF firmware
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-arm qemu-efi-aarch64

- name: Run verification harness and QEMU boot test
run: bash scripts/verify_all.sh
2 changes: 2 additions & 0 deletions crates/aienos-kernel/src/fatal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ impl fmt::Display for FaultInfo {
/// Called for a fault once vectors are installed. Must not return.
pub type FaultHook = fn(&FaultInfo) -> !;

#[cfg_attr(not(target_arch = "aarch64"), allow(dead_code))]
static HOOK: AtomicUsize = AtomicUsize::new(0);

pub fn set_fault_hook(hook: FaultHook) {
HOOK.store(hook as usize, Ordering::SeqCst);
}

#[cfg_attr(not(target_arch = "aarch64"), allow(dead_code))]
fn call_hook(info: &FaultInfo) -> ! {
let raw = HOOK.load(Ordering::SeqCst);
if raw != 0 {
Expand Down
9 changes: 9 additions & 0 deletions scripts/verify_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ cargo run --quiet --release -p aienos-evidence -- verify-efi target/aarch64-unkn
cargo build --release -p aienos-boot --target aarch64-unknown-uefi --features handoff --bin aienos-handoff
cargo run --quiet --release -p aienos-evidence -- verify-efi target/aarch64-unknown-uefi/release/aienos-handoff.efi

# Step 6: QEMU AArch64 UEFI Boot Verification (Emulator Boot Test)
echo ""
echo "--- [QEMU AArch64 UEFI Boot Verification] ---"
if command -v qemu-system-aarch64 >/dev/null && [[ -r "${AAVMF_CODE:-/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd}" ]]; then
./scripts/qemu_boot_test.sh
else
echo "SKIPPED: qemu-system-aarch64 or AAVMF firmware not present on host."
fi

echo ""
echo "============================================================"
echo "HOST VERIFICATIONS PASSED."
Expand Down
Loading