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

https://os.phil-opp.com/minimal-rust-kernel/#Target%20Specification #464

Closed
utterances-bot opened this issue Aug 17, 2018 · 12 comments
Closed

Comments

@utterances-bot
Copy link

A Minimal Rust Kernel | Writing an OS in Rust

https://os.phil-opp.com/minimal-rust-kernel/#Target%20Specification

Copy link

1600 commented Aug 17, 2018

followed exact instructions, could not "cargo xbuild --target x86_64-blog_os.json". still "error[E0463]: can't find crate for core"

@phil-opp
Copy link
Owner

Hmm, do you have your code online somewhere so that I can test it? Are you seeing the "Compiling core v0.0.0 (file:///…/rust/src/libcore)" lines?

Copy link

1600 commented Aug 18, 2018

I have the exact main.rs and Cargo.toml as yours, except maybe I'm on Windows 10. and no, I didnt see that line.

@phil-opp
Copy link
Owner

Could you give me the full output that you see? Maybe the problem is that you try to use a stable rust compiler instead of a nightly compiler.

@phil-opp
Copy link
Owner

phil-opp commented Oct 1, 2018

@1600 Were you able to solve your problem?

@le-bananafish
Copy link

Hi, I think I might have the same problem. What should I comment for reduplication? Just for reference, I use the nightly compiler as my default.

@phil-opp
Copy link
Owner

phil-opp commented Oct 7, 2018

Hi @le-bananafish,

could you give me the full command line output and the content of your main.rs?

@le-bananafish
Copy link

le-bananafish commented Oct 8, 2018

Hi @phil-opp

main.rs

#![no_std] // don't link the Rust standard library
#![no_main] // disable all Rust-level entry points

use core::panic::PanicInfo;

/// This function is called on panic.
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

#[no_mangle] // don't mangle the name of this function
pub extern "C" fn _start() -> ! {
    // this function is the entry point, since the linker looks for a function
    // named `_start` by default
    loop {}
}

command output:

cargo xbuild --target os.json
   Compiling core v0.0.0 (C:\Users\Sebastian Lau\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore)
    Finished release [optimized] target(s) in 25.44s
   Compiling compiler_builtins v0.1.0 (C:\Users\Sebastian Lau\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcompiler_builtins)
    Finished release [optimized] target(s) in 6.69s
   Compiling alloc v0.0.0 (C:\Users\SEBAST~1\AppData\Local\Temp\xargo.Y1tBY4X0UsYx)
    Finished release [optimized] target(s) in 4.52s
   Compiling kernel-starter-18-10-05 v0.1.0 (C:\Users\Sebastian Lau\Documents\Projects\kernel-starter-18-10-05)
error[E0463]: can't find crate for `core`
  |
  = note: the `os-15361375669166016168` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `kernel-starter-18-10-05`.

To learn more, run the command again with --verbose.

I'm using the rls-plugin for vscode and it's also giving me this weird error:

{
	"resource": "/C:/Users/Sebastian Lau/Documents/Projects/kernel-starter-18-10-05/src/main.rs",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "E0152",
	"severity": 8,
	"message": "duplicate lang item found: `panic_impl`.\n\nnote: first defined in crate `std`.",
	"source": "rustc",
	"startLineNumber": 8,
	"startColumn": 1,
	"endLineNumber": 10,
	"endColumn": 2
}

P.S. I haven't submitted code blocks on GitHub yet apologies for the formatting.

@phil-opp
Copy link
Owner

phil-opp commented Oct 8, 2018

@le-bananafish Seems like you're running into rust-lang/cargo#6139, because your username contains a space. We tried our best to work around it, but we found no working way to escape the space. I hope that this gets fixed from the cargo side soon.

@le-bananafish
Copy link

@phil-opp Oh lol well that's a funny problem to have. I guess I shouldn't have put a space in my username...

Thanks anyway!

@phil-opp
Copy link
Owner

phil-opp commented Oct 8, 2018

@le-bananafish You're welcome!

@phil-opp
Copy link
Owner

Closing this issue since there already exists a comment thread for the "A Minimal Rust Kernel" post.

@1600 If you're still having this problem please open a new issue!

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

4 participants