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

thread 'main' panicked at 'no entry found for key', src\tools\cargo\src/cargo\core\compiler\unit_dependencies.rs #329

Closed
LovesAsuna opened this issue Jan 20, 2023 · 10 comments

Comments

@LovesAsuna
Copy link

LovesAsuna commented Jan 20, 2023

As you submitted the issue earlier,I don't know how to solve this problem.

@phil-opp
Copy link
Member

Could you clarify what you're trying to do and how this is related to the bootloader crate?

@LovesAsuna
Copy link
Author

I am now migrating from bootloader v0.9.X to bootloader v0.11. I follow the guide and use the build script to build kernel.But ran into the problem I mentioned above.


In the root package, I created a config.toml

[unstable]
bindeps = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins", "alloc"]

[build]
target = "x86_64-simple_os.json"

In the root package, the Cargo.toml is

[package]
name = "simple_os"
version = "0.1.0"
edition = "2021"

[build-dependencies]
bootloader = "0.11"
kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none"}

[workspace]
members = ["kernel"]

In the kernel package, I created a config.toml as well

[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins", "alloc"]

[build]
target = "x86_64-simple_os.json"

The problem is that when I execute command Cargo build, the error occurs.

SW0FWSFZ8IN4DZ75_PSMIEO


By the way, I've tried leaving only bindeps option in the root package's config.toml.Then the error would be

FH~UF(7ET%N%BA53PK8KHI0

@phil-opp
Copy link
Member

Thanks for the information! You don't need the custom target file and build-std config keep keys anymore.

By the way, I've tried leaving only bindeps option in the root package's config.toml.Then the error would be

That's the right approach. To fix that error, run rustup target add x86_64-unknown-none.

@LovesAsuna
Copy link
Author

I've added target x86_64-unknown-none. But the error is still not resolved
ZO4_POL3QFJZWL6 QUXOH)3

@phil-opp
Copy link
Member

Try removing the build.target key from your Cargo.toml. And make sure that your kernel is declared as no_std.

@LovesAsuna
Copy link
Author

LovesAsuna commented Jan 21, 2023

Thanks, now I can successfully build and run the os. But I have another problem that with BIOSbooting, the println macro doesn't seem to work while with UEFI booting, it does work.
3R57U7X AV431@LMYTK2EG3

@phil-opp
Copy link
Member

But I have another problem that with BIOSbooting, the println macro doesn't seem to work while with UEFI booting, it does work.

What does your println macro do? Be aware that the v0.11 version of the bootloader sets up a pixel-based framebuffer, so the VGA text mode won't work anymore (it's not compatible with UEFI anyway). See https://github.com/rust-osdev/bootloader/blob/main/docs/migration/v0.9.md for details.

@LovesAsuna
Copy link
Author

I know that. But there is still an option to create a BIOS with a bootloader in the build.rs. This issue is present in the BIOS image I built

@phil-opp
Copy link
Member

We also set up a framebuffer for BIOS booting so that you don't need to special-case your output code depending on the boot mode.

(The screenshot you posted above just shows the output from the bootloader, no kernel output yet.)

@LovesAsuna
Copy link
Author

My output is based on framebuffer and doesn't change anything else. Completely consistent code applied to UEFI booting is correct, while BIOS booting is wrong

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

2 participants