RWTH-OS / eduOS-rs

A teaching operating system written in Rust
https://rwth-os.github.io/eduOS-rs/
Apache License 2.0
412 stars 26 forks source link

Can't run a newly compiled of demo/hello #34

Open WattleFoxxo opened 1 year ago

WattleFoxxo commented 1 year ago

When i try to run the newly compiled program i get this error while running:

[ERROR] Error: file depends on following libraries: ["libc.so"]
[ERROR] Unable to load elf64 binary /bin/demo

if i change -pie to -static-pie i get this error while running:

[ERROR] Page Fault (#PF) Exception: ExceptionStackFrame {
    instruction_pointer: 0x20000000077,
    code_segment: 0x2b,
    cpu_flags: 0x1202,
    stack_pointer: 0x20000400000,
    stack_segment: 0x23,
}
[ERROR] virtual_address = 0x23, page fault error = The fault was caused by a non-present page.
The access causing the fault was a read.
The access causing the fault originated when the processor was executing in user mode.
The fault was not caused by reserved bit violation.
The fault was not caused by an instruction fetch.
stlankes commented 1 year ago

Shared libraries are currently not supported. I used a test program, which based on the MUSL C library. Everything is statically linked.

WattleFoxxo commented 1 year ago

another question, how would make the hello world user space program in rust and compile it?

stlankes commented 1 year ago

Hm, Rust supports also Musl. The target has the name x86_64-unknown-linux-musl. See also https://doc.rust-lang.org/rustc/platform-support.html Consequently, a C library is still the base of the application.

I think that you are able to build pure Rust application with Redox and RustyHermit.

WattleFoxxo commented 1 year ago

hi sorry to bother you but im still having trouble getting newly compiled elf binaries to load, is there a specific version of the musl-gcc compiler you use?

stlankes commented 1 year ago

Hm, I have to take a look in the code. I don't tested with the latest version of musl. I come back to you.