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

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

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

Comments

@utterances-bot
Copy link

@utterances-bot utterances-bot commented Aug 17, 2018

A Minimal Rust Kernel | Writing an OS in Rust

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

This comment has been minimized.

Copy link

@1600 1600 commented Aug 17, 2018 — with utterances

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

@phil-opp

This comment has been minimized.

Copy link
Owner

@phil-opp phil-opp commented Aug 17, 2018

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?

This comment has been minimized.

Copy link

@1600 1600 commented Aug 18, 2018 — with utterances

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

This comment has been minimized.

Copy link
Owner

@phil-opp phil-opp commented Aug 18, 2018

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

This comment has been minimized.

Copy link
Owner

@phil-opp phil-opp commented Oct 1, 2018

@1600 Were you able to solve your problem?

@le-bananafish

This comment has been minimized.

Copy link

@le-bananafish le-bananafish commented Oct 5, 2018

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

This comment has been minimized.

Copy link
Owner

@phil-opp 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

This comment has been minimized.

Copy link

@le-bananafish 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

This comment has been minimized.

Copy link
Owner

@phil-opp 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

This comment has been minimized.

Copy link

@le-bananafish le-bananafish commented Oct 8, 2018

@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

This comment has been minimized.

Copy link
Owner

@phil-opp phil-opp commented Oct 8, 2018

@le-bananafish You're welcome!

@phil-opp

This comment has been minimized.

Copy link
Owner

@phil-opp phil-opp commented Oct 18, 2018

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!

@phil-opp phil-opp closed this Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.