Skip to content

Commit 856f761

Browse files
authored
Merge pull request #437 from rust-osdev/v0.9-fix-warning
Rename `.cargo/config` to `.cargo/config.toml`
2 parents 2b7bd95 + 318b60e commit 856f761

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed
File renamed without changes.

.github/workflows/build.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,16 @@ jobs:
3636
3737
- name: "Install Rustup Components"
3838
run: rustup component add rust-src llvm-tools-preview
39-
- name: "Install cargo-xbuild"
40-
run: cargo install cargo-xbuild --debug
39+
4140
- name: "Install cargo-binutils"
4241
run: cargo install cargo-binutils --version 0.1.7 --debug
4342

44-
- run: cargo xbuild
43+
- run: cargo build -Zbuild-std=core
4544
working-directory: test-kernel
4645
name: 'Build Test Kernel'
4746

4847
- name: 'Build Bootloader'
49-
run: cargo xbuild --bin bootloader --features binary --release
48+
run: cargo build -Zbuild-std=core --bin bootloader --features binary --release
5049
env:
5150
KERNEL: "test-kernel/target/x86_64-test-kernel/debug/test-kernel"
5251
KERNEL_MANIFEST: "test-kernel/Cargo.toml"
@@ -96,10 +95,8 @@ jobs:
9695
- uses: actions/checkout@v1
9796
- name: "Install Rustup Components"
9897
run: rustup component add rust-src llvm-tools-preview
99-
- name: "Install cargo-xbuild"
100-
run: cargo install cargo-xbuild --debug
10198
- name: 'Build Example Kernel'
102-
run: cargo xbuild
99+
run: cargo build -Zbuild-std=core
103100
working-directory: example-kernel
104101

105102

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,28 +108,28 @@ Note that the addresses **must** be given as strings (in either hex or decimal f
108108

109109
## Requirements
110110

111-
You need a nightly [Rust](https://www.rust-lang.org) compiler and [cargo xbuild](https://github.com/rust-osdev/cargo-xbuild). You also need the `llvm-tools-preview` component, which can be installed through `rustup component add llvm-tools-preview`.
111+
You need a nightly [Rust](https://www.rust-lang.org) compiler. You also need the `llvm-tools-preview` component, which can be installed through `rustup component add llvm-tools-preview`.
112112

113113
## Build
114114

115115
The simplest way to use the bootloader is in combination with the [bootimage](https://github.com/rust-osdev/bootimage) tool. This crate **requires at least bootimage 0.7.7**. With the tool installed, you can add a normal cargo dependency on the `bootloader` crate to your kernel and then run `bootimage build` to create a bootable disk image. You can also execute `bootimage run` to run your kernel in [QEMU](https://www.qemu.org/) (needs to be installed).
116116

117-
To compile the bootloader manually, you need to invoke `cargo xbuild` with two environment variables:
117+
To compile the bootloader manually, you need to invoke `cargo build -Zbuild-std=core` with two environment variables:
118118
* `KERNEL`: points to your kernel executable (in the ELF format)
119119
* `KERNEL_MANIFEST`: points to the `Cargo.toml` describing your kernel
120120

121121
For example:
122122
```
123-
KERNEL=/path/to/your/kernel/target/debug/your_kernel KERNEL_MANIFEST=/path/to/your/kernel/Cargo.toml cargo xbuild
123+
KERNEL=/path/to/your/kernel/target/debug/your_kernel KERNEL_MANIFEST=/path/to/your/kernel/Cargo.toml cargo build -Zbuild-std=core
124124
```
125125

126126
As an example, you can build the bootloader with example kernel from the `example-kernel` directory with the following commands:
127127

128128
```
129129
cd example-kernel
130-
cargo xbuild
130+
cargo build -Zbuild-std=core
131131
cd ..
132-
KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel KERNEL_MANIFEST=example-kernel/Cargo.toml cargo xbuild --release --features binary
132+
KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel KERNEL_MANIFEST=example-kernel/Cargo.toml cargo build -Zbuild-std=core --release --features binary
133133
```
134134

135135
The `binary` feature is required to enable the dependencies required for compiling the bootloader executable. The command results in a bootloader executable at `target/x86_64-bootloader.json/release/bootloader`. This executable is still an ELF file, which can't be run directly.

0 commit comments

Comments
 (0)