Skip to content

Commit

Permalink
Merge pull request phil-opp#1234 from Connortsui20/post-02-beginner-c…
Browse files Browse the repository at this point in the history
…argo-tips

Update post 2 with beginner friendly cargo tips
  • Loading branch information
phil-opp authored Aug 17, 2023
2 parents e2a4464 + 63dc179 commit 2e3230e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ That's where the [`build-std` feature] of cargo comes in. It allows to recompile
[`build-std` feature]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[nightly Rust compilers]: #installing-rust-nightly

To use the feature, we need to create a [cargo configuration] file at `.cargo/config.toml` with the following content:
To use the feature, we need to create a local [cargo configuration] file at `.cargo/config.toml` (the `.cargo` folder should be next to your `src` folder) with the following content:

```toml
# in .cargo/config.toml
Expand Down Expand Up @@ -410,15 +410,15 @@ Adding the bootloader as a dependency is not enough to actually create a bootabl

[post-build scripts]: https://github.com/rust-lang/cargo/issues/545

To solve this problem, we created a tool named `bootimage` that first compiles the kernel and bootloader, and then links them together to create a bootable disk image. To install the tool, execute the following command in your terminal:
To solve this problem, we created a tool named `bootimage` that first compiles the kernel and bootloader, and then links them together to create a bootable disk image. To install the tool, go into your home directory (or any directory outside of your cargo project) and execute the following command in your terminal:

```
cargo install bootimage
```

For running `bootimage` and building the bootloader, you need to have the `llvm-tools-preview` rustup component installed. You can do so by executing `rustup component add llvm-tools-preview`.

After installing `bootimage` and adding the `llvm-tools-preview` component, we can create a bootable disk image by executing:
After installing `bootimage` and adding the `llvm-tools-preview` component, we can create a bootable disk image by going back into your cargo project directory and executing:

```
> cargo bootimage
Expand Down

0 comments on commit 2e3230e

Please sign in to comment.