rust-osdev / bootimage

Tool to create bootable disk images from a Rust OS kernel.
Apache License 2.0
767 stars 67 forks source link

Can't install bootimage #90

Closed sytzemeijer closed 1 year ago

sytzemeijer commented 2 years ago

I cannot install boot image. I am using the nightly-2020-07-15. When I run cargo install bootimage it stops with three dependencies with about 2000 errors.

I won't be able to access my laptop until tomorrow, so I'll forward the errors then.

phil-opp commented 2 years ago

It's difficult to guess without the actual errors, but the problem might be that you're running the cargo install command from a folder that contains a .cargo/config.toml file with build-std settings. If that's the case, try running it again from a parent directory or from your home directory.

sytzemeijer commented 2 years ago

If I run cargo install bootimage on C: I get this error

C:\>cargo install bootimage
warning: unused config key `unstable.build-std-features` in `C:\Users\Sytze Meijer\.cargo\config.toml`
    Updating crates.io index
  Installing bootimage v0.10.3
   Compiling compiler_builtins v0.1.32
   Compiling core v0.0.0 (C:\Users\Sytze Meijer\.rustup\toolchains\nightly-2020-07-15-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore)
   Compiling proc-macro2 v1.0.47
   Compiling unicode-ident v1.0.5
   Compiling quote v1.0.21
   Compiling syn v1.0.103
   Compiling serde v1.0.147
   Compiling serde_json v1.0.89
   Compiling serde_derive v1.0.147
   Compiling thiserror v1.0.37
   Compiling anyhow v1.0.66
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> C:\Users\Sytze Meijer\.cargo\registry\src\github.com-1ecc6299db9ec823\proc-macro2-1.0.47\src\lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
    Building [========================>                                ] 20/44: core
phil-opp commented 2 years ago

Two things:

sytzemeijer commented 2 years ago

It now installs but the bin file has no extension and when I run it in qemu nothing happens.

phil-opp commented 2 years ago

Which bin file are you talking about?

sytzemeijer commented 2 years ago

I'm following your tutorial on how to create a operating system in rust. edition-2, A Minimal Rust Kernel

phil-opp commented 2 years ago

Does the cargo bootimage command work? If so, what error occurs when you're trying to start the bootimage-blog_os.bin in QEMU?

sytzemeijer commented 2 years ago

thanks it's now working

sytzemeijer commented 2 years ago

but are you going to continue writing the tutorial?

phil-opp commented 1 year ago

Great to hear that it's working now!

but are you going to continue writing the tutorial?

I'm planning to create a new third edition, which will do some things a bit differently (bootimage is no longer needed, support for UEFI booting, APIC instead of PIC, etc.).