You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/rust/quick-start.rst
+19-6
Original file line number
Diff line number
Diff line change
@@ -5,43 +5,56 @@ Quick Start
5
5
6
6
This document describes how to get started with Rust kernel development.
7
7
8
+
8
9
Requirements
9
10
------------
10
11
11
-
A recent nightly Rust toolchain (at least ``rustc``, ``cargo`` and ``rustfmt``) is required, e.g. `nightly-2020-08-27`. In the future, this restriction will be lifted. If you are using ``rustup``, run::
12
+
A recent nightly Rust toolchain (at least ``rustc``, ``cargo`` and ``rustfmt``)
13
+
is required, e.g. ``nightly-2020-08-27``. In the future, this restriction
14
+
will be lifted. If you are using ``rustup``, run::
12
15
13
16
rustup toolchain install nightly
14
17
15
18
Otherwise, fetch a standalone installer from:
16
19
17
20
https://www.rust-lang.org
18
21
19
-
The sources for the compiler are required to be available. If you are using ``rustup``, run::
22
+
The sources for the compiler are required to be available. If you are using
23
+
``rustup``, run::
20
24
21
25
rustup component add rust-src
22
26
23
-
Otherwise, if you used a standalone installer, you can clone the Rust compiler sources and create a symlink to them in the installation folder of your nightly toolchain::
27
+
Otherwise, if you used a standalone installer, you can clone the Rust compiler
28
+
sources and create a symlink to them in the installation folder of
If the kernel configuration system is able to find ``rustc`` and ``cargo``, it will enable Rust support (``CONFIG_HAS_RUST``). In turn, this will make visible the rest of options that depend on Rust.
38
+
If the kernel configuration system is able to find ``rustc`` and ``cargo``,
39
+
it will enable Rust support (``CONFIG_HAS_RUST``). In turn, this will make
40
+
visible the rest of options that depend on Rust.
32
41
33
-
A simple driver you can compile to test things out is at ``drivers/char/rust_example`` (``CONFIG_RUST_EXAMPLE``). Enable it and compile the kernel with:
42
+
A simple driver you can compile to test things out is at
43
+
``drivers/char/rust_example`` (``CONFIG_RUST_EXAMPLE``). Enable it and compile
44
+
the kernel with:
34
45
35
46
make LLVM=1
36
47
37
48
TODO: drop LLVM=1, allowing to mix GCC with LLVM
38
49
50
+
39
51
Avoiding the network
40
52
--------------------
41
53
42
54
You can prefetch the dependencies that ``cargo`` will download by running::
43
55
44
56
cargo fetch
45
57
46
-
in the kernel sources root. After this step, a network connection is not needed anymore.
58
+
in the kernel sources root. After this step, a network connection is
0 commit comments