0

I am currently following Phil Opperman's blog to build on a very small OS kernel written in Rust by adding a simple file system. Right now I am trying to get interrupts working for writing to disk, and in the Opperman's blog he recommends adding the PIC8259 crate to the project dependencies. For context, there is a root crate and then within that there is a crate called kernel with its own dependencies. All of my changes will be within the kernel crate, but I run the whole program using cargo make with a Makefile at the root of the project. Everything runs fine up until I add the new dependency in the kernel/cargo.toml file, and then I get this error:

thread 'main' panicked at 'Unable to parse Cargo.toml, `cargo metadata` exited with an error: warning: profiles for the non root package will be ignored, 
package:   /buzz/kernel/Cargo.toml
workspace: /buzz/Cargo.toml
    Updating crates.io index
', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-make-0.36.4/src/lib/environment/crateinfo.rs:277:27

I first thought that the issue had to do with the warning it threw out, but when I moved my profile settings from the kernel crate to the root cargo.toml, the error was still there but the warning was gone. Also, the profiles are in the kernel/cargo.toml for a co-worker and his project runs fine. I tried to do a stacktrace on the error but the stacktrace couldn't give me any useful information, so I'm pretty confused on how to move forward. Also it may be important to know that the original project did have some dependencies, so this is not the first one, and this error is caused no matter which crate I try to add to my kernel/cargo.toml. I have also tried multiple networks to see if it is a network issue, but nothing changed.

EDIT: Here is the contents of my kernel/cargo.toml file

[package]
name = "buzz-os-kernel"
version = "0.1.0"
edition = "2018"

[dependencies]
volatile = "0.2.6" # Volatile allows finer grain control of the compiler
spin = "0.5.2"
bitflags = "1.0.4"
pic8259_x86 = "0.1.0"

[dependencies.lazy_static]
version = "1.0"
features = ["spin_no_std"]

[lib]
crate-type=["staticlib"]

[profile.dev]
panic = "abort"
debug = true
debuginfo = "stabs"

I am trying to add the pic8259_x86 crate, which is just a modified version of the pic8259 crate that Opperman uses. The actual crate shouldn't matter though because any added crate errors.

EDIT 2: When I try to run cargo metadata, I get a progress bar and a message saying "Updating crates.io index," but as soon as the progress bar hits 25.97% the status changes to killed and nothing happens. This happens every time. I am running in a docker container, could that possibly be an issue? I could see a problem where there is not enough allocated memory so it kills the download after it reaches a memory size threshold.

cafce25
  • 15,907
  • 4
  • 25
  • 31
Hayden Rieder
  • 11
  • 1
  • 4
  • Please show the contents of your `kernel/Cargo.toml` file. – Kevin Reid Mar 28 '23 at 00:07
  • try to simplify the problem. for example, can you just run cargo metadata in your workspace to see what output it shows? to see that there are no errors – sagie Mar 28 '23 at 11:12

0 Answers0