init segfaulting
Opened this issue · 0 comments
anholt commented
As of recent rust nightlies, I get:
cargo run --target riscv64gc-unknown-none-elf
Compiling octox v0.1.0 (/home/anholt/src/octox)
warning: the feature `asm_const` has been stable since 1.82.0 and no longer requires an attribute to enable
--> src/kernel/lib.rs:10:12
|
10 | #![feature(asm_const)]
| ^^^^^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: the feature `new_uninit` has been stable since 1.82.0 and no longer requires an attribute to enable
--> src/kernel/lib.rs:6:66
|
6 | #![cfg_attr(all(target_os = "none", feature = "kernel"), feature(new_uninit))]
| ^^^^^^^^^^
warning: `libkernel` (lib) generated 2 warnings
warning: octox@0.1.0: nmeta 70 (boot, super, log blocks 30 inode blocks 13, bitmap blocks 25) blocks 199930 total 200000
warning: octox@0.1.0: mkfs:balloc: first 3221 blocks have benen allocated
warning: octox@0.1.0: mkfs:balloc: write bitmap block at sector 45
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.40s
Running `qemu-system-riscv64 -machine virt -bios none -m 524M -smp 4 -nographic -serial 'mon:stdio' -global virtio-mmio.force-legacy=false -drive file=target/fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -kernel target/riscv64gc-unknown-none-elf/debug/octox`
octox kernel is booting
bd: memory sz is 535633920 bytes; allocate an size array of length 26
bd: 12584176 meta bytes for managing 536870912 bytes of memory
bd: 1236992 bytes unavailable
hart 2 starting
hart 3 starting
hart 1 starting
usertrap(): unexcepted scause Exception(StorePageFault), pid=PId(0)
sepc=3B0, stval=B010
core 1: panicked at src/kernel/proc.rs:726:5:
init exiting
By dropping channel = "nightly"
from config.toml, I've bisected a bit, and it seems it's between nightly 2024-07-25 and 2024-09-01 that it fails. In between, there are a lot of compile failures about:
--> src/kernel/trampoline.rs:96:5
|
94 | #[naked]
| -------- function marked with `#[naked]` here
95 | #[no_mangle]
96 | #[repr(align(16))]
| ^^^^^^^^^^^^^^^^^^ the `repr` attribute is incompatible with `#[naked]`