Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init segfaulting #23

Open
anholt opened this issue Sep 10, 2024 · 0 comments
Open

init segfaulting #23

anholt opened this issue Sep 10, 2024 · 0 comments

Comments

@anholt
Copy link

anholt commented Sep 10, 2024

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: [email protected]: nmeta 70 (boot, super, log blocks 30 inode blocks 13, bitmap blocks 25) blocks 199930 total 200000
warning: [email protected]: mkfs:balloc: first 3221 blocks have benen allocated
warning: [email protected]: 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]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant