Skip to content

Commit 91efc7f

Browse files
committed
Update Readme for rewrite
1 parent df0ea1f commit 91efc7f

File tree

1 file changed

+26
-30
lines changed

1 file changed

+26
-30
lines changed

Readme.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,56 @@ If you want to use a custom bootloader with a different name, you can use Cargo'
2828
Now you can build the kernel project and create a bootable disk image from it by running:
2929

3030
```
31-
bootimage build --target your_custom_target.json [other_args]
31+
cargo bootimage --target your_custom_target.json [other_args]
3232
```
3333

3434
The command will invoke [`cargo xbuild`](https://github.com/rust-osdev/cargo-xbuild), forwarding all passed options. Then it will build the specified bootloader together with the kernel to create a bootable disk image.
3535

36-
If you prefer a cargo subcommand, you can use the equivalent `cargo bootimage` command:
36+
### Running
3737

38-
```
39-
cargo bootimage --target your_custom_target.json [other_args]
40-
```
38+
To run your kernel in QEMU, you can set a `bootimage runner` as a custom runner in a `.cargo/config` file:
4139

42-
### Running
40+
```toml
41+
[target.'cfg(target_os = "none")']
42+
runner = "bootimage runner"
43+
```
4344

44-
To run your kernel in QEMU, you can use `bootimage run`:
45+
Then you can run your kernel through:
4546

4647
```
47-
bootimage run --target your_custom_target.json [other_args] -- [qemu args]
48+
cargo xrun --target your_custom_target.json [other_args] -- [qemu args]
4849
```
4950

5051
All arguments after `--` are passed to QEMU. If you want to use a custom run command, see the _Configuration_ section below.
5152

52-
If you prefer working directly with cargo, you can use `bootimage runner` as a custom runner in your `.cargo/config`:
53-
54-
```toml
55-
[target.'cfg(target_os = "none")']
56-
runner = "bootimage runner"
57-
```
53+
### Testing
5854

59-
Now you can run your kernel through `cargo xrun --target […]`.
55+
The `bootimage` has built-in support for running unit and integration tests of your kernel. For this, you need to use the `custom_tests_framework` feature of Rust as described [here](https://os.phil-opp.com/testing/#custom-test-frameworks).
6056

6157
## Configuration
6258

6359
Configuration is done through a through a `[package.metadata.bootimage]` table in the `Cargo.toml` of your kernel. The following options are available:
6460

6561
```toml
66-
[package.metadata.bootimage]
67-
# The command invoked with the created bootimage (the "{}" will be replaced
68-
# with the path to the bootable disk image)
69-
# Applies to `bootimage run` and `bootimage runner`
70-
run-command = ["qemu-system-x86_64", "-drive", "format=raw,file={}"]
62+
[package.metadata.bootimage]
63+
# The command invoked with the created bootimage (the "{}" will be replaced
64+
# with the path to the bootable disk image)
65+
# Applies to `bootimage run` and `bootimage runner`
66+
run-command = ["qemu-system-x86_64", "-drive", "format=raw,file={}"]
7167

72-
# Additional arguments passed to the run command for non-test executables
73-
# Applies to `bootimage run` and `bootimage runner`
74-
run-args = []
68+
# Additional arguments passed to the run command for non-test executables
69+
# Applies to `bootimage run` and `bootimage runner`
70+
run-args = []
7571

76-
# Additional arguments passed to the run command for test executables
77-
# Applies to `bootimage runner`
78-
test-args = []
72+
# Additional arguments passed to the run command for test executables
73+
# Applies to `bootimage runner`
74+
test-args = []
7975

80-
# An exit code that should be considered as success for test executables
81-
test-success-exit-code = {integer}
76+
# An exit code that should be considered as success for test executables
77+
test-success-exit-code = {integer}
8278

83-
# The timeout for running a test through `bootimage test` or `bootimage runner` (in seconds)
84-
test-timeout = 300
79+
# The timeout for running a test through `bootimage test` or `bootimage runner` (in seconds)
80+
test-timeout = 300
8581
```
8682

8783
## License

0 commit comments

Comments
 (0)