Skip to content

Commit bd270fb

Browse files
committed
Create setup pages for the one-day classes
1 parent a4d80d3 commit bd270fb

File tree

7 files changed

+104
-61
lines changed

7 files changed

+104
-61
lines changed

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@
305305
---
306306

307307
- [Welcome](bare-metal.md)
308+
- [Setup](bare-metal/setup.md)
308309
- [`no_std`](bare-metal/no_std.md)
309310
- [A Minimal Example](bare-metal/minimal.md)
310311
- [`alloc`](bare-metal/alloc.md)
@@ -356,6 +357,7 @@
356357
---
357358

358359
- [Welcome](concurrency/welcome.md)
360+
- [Fearless Concurrency](concurrency/fearless.md)
359361
- [Threads](concurrency/threads.md)
360362
- [Plain Threads](concurrency/threads/plain.md)
361363
- [Scoped Threads](concurrency/threads/scoped.md)

src/android.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ session: Android
55

66
# Welcome to Rust in Android
77

8-
Rust is supported for system software on Android. This means that you can write
9-
new services, libraries, drivers or even firmware in Rust (or improve existing
10-
code as needed).
8+
This is a one-day course about Rust in Android: you can write new Android
9+
platform services, libraries, drivers or even firmware in Rust.
10+
11+
## Target Audience
12+
13+
This course builds on [Rust Fundamentals](welcome-day-1.md) and we expect you
14+
are familiar with the basics of Rust. You should also be familiar with
15+
development on the Android Platform (AOSP).
1116

1217
> We will attempt to call Rust from one of your own projects today. So try to
1318
> find a little corner of your code base where we can move some lines of code to

src/bare-metal.md

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,18 @@ session: Morning
55

66
# Welcome to Bare Metal Rust
77

8-
This is a standalone one-day course about bare-metal Rust, aimed at people who
9-
are familiar with the basics of Rust (perhaps from completing the Comprehensive
10-
Rust course), and ideally also have some experience with bare-metal programming
11-
in some other language such as C.
8+
This is a one-day course about bare-metal Rust: running Rust code without an OS
9+
underneath us.
1210

13-
Today we will talk about 'bare-metal' Rust: running Rust code without an OS
14-
underneath us. This will be divided into several parts:
11+
The class is divided into several parts:
1512

1613
- What is `no_std` Rust?
1714
- Writing firmware for microcontrollers.
1815
- Writing bootloader / kernel code for application processors.
1916
- Some useful crates for bare-metal Rust development.
2017

21-
For the microcontroller part of the course we will use the
22-
[BBC micro:bit](https://microbit.org/) v2 as an example. It's a
23-
[development board](https://tech.microbit.org/hardware/) based on the Nordic
24-
nRF52833 microcontroller with some LEDs and buttons, an I2C-connected
25-
accelerometer and compass, and an on-board SWD debugger.
18+
## Target Audience
2619

27-
To get started, install some tools we'll need later. On gLinux or Debian:
28-
29-
<!-- mdbook-xgettext: skip -->
30-
31-
```bash
32-
sudo apt install gcc-aarch64-linux-gnu gdb-multiarch libudev-dev picocom pkg-config qemu-system-arm
33-
rustup update
34-
rustup target add aarch64-unknown-none thumbv7em-none-eabihf
35-
rustup component add llvm-tools-preview
36-
cargo install cargo-binutils cargo-embed
37-
```
38-
39-
And give users in the `plugdev` group access to the micro:bit programmer:
40-
41-
<!-- mdbook-xgettext: skip -->
42-
43-
```bash
44-
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", MODE="0664", GROUP="plugdev"' |\
45-
sudo tee /etc/udev/rules.d/50-microbit.rules
46-
sudo udevadm control --reload-rules
47-
```
48-
49-
On MacOS:
50-
51-
<!-- mdbook-xgettext: skip -->
52-
53-
```bash
54-
xcode-select --install
55-
brew install gdb picocom qemu
56-
brew install --cask gcc-aarch64-embedded
57-
rustup update
58-
rustup target add aarch64-unknown-none thumbv7em-none-eabihf
59-
rustup component add llvm-tools-preview
60-
cargo install cargo-binutils cargo-embed
61-
```
20+
This course builds on [Rust Fundamentals](welcome-day-1.md) and we expect you
21+
are familiar with the basics of Rust. You should ideally also have some
22+
experience with bare-metal programming in some other language such as C.

src/bare-metal/setup.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Setup
2+
3+
For the microcontroller part of the course we will use the
4+
[BBC micro:bit](https://microbit.org/) v2 as an example. It's a
5+
[development board](https://tech.microbit.org/hardware/) based on the Nordic
6+
nRF52833 microcontroller with some LEDs and buttons, an I2C-connected
7+
accelerometer and compass, and an on-board SWD debugger.
8+
9+
To get started, install some tools we'll need later.
10+
11+
## Linux
12+
13+
Please run the following on gLinux or Debian:
14+
15+
<!-- mdbook-xgettext: skip -->
16+
17+
```bash
18+
sudo apt install gcc-aarch64-linux-gnu gdb-multiarch libudev-dev picocom pkg-config qemu-system-arm
19+
rustup update
20+
rustup target add aarch64-unknown-none thumbv7em-none-eabihf
21+
rustup component add llvm-tools-preview
22+
cargo install cargo-binutils cargo-embed
23+
```
24+
25+
And give users in the `plugdev` group access to the micro:bit programmer:
26+
27+
<!-- mdbook-xgettext: skip -->
28+
29+
```bash
30+
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", MODE="0664", GROUP="plugdev"' |\
31+
sudo tee /etc/udev/rules.d/50-microbit.rules
32+
sudo udevadm control --reload-rules
33+
```
34+
35+
## MacOS
36+
37+
Please run the following on MacOS:
38+
39+
<!-- mdbook-xgettext: skip -->
40+
41+
```bash
42+
xcode-select --install
43+
brew install gdb picocom qemu
44+
brew install --cask gcc-aarch64-embedded
45+
rustup update
46+
rustup target add aarch64-unknown-none thumbv7em-none-eabihf
47+
rustup component add llvm-tools-preview
48+
cargo install cargo-binutils cargo-embed
49+
```

src/chromium.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ code to connect between Rust and existing Chromium C++ code.
1212
> a corner of the code where you're displaying a UTF8 string to the user, feel
1313
> free to follow this recipe in your part of the codebase instead of the exact
1414
> part we talk about.
15+
16+
## Target Audience
17+
18+
This course builds on [Rust Fundamentals](welcome-day-1.md) and we expect you
19+
are familiar with the basics of Rust. You should also be familiar with Chromium
20+
development.

src/concurrency/fearless.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Fearless Concurrency
2+
3+
Rust has great support for concurrency and its powerful type system is able to
4+
prevent many concurrency bugs at compile time. This is often referred to as
5+
_fearless concurrency_ since you can rely on the compiler to ensure correctness
6+
at runtime.
7+
8+
<details>
9+
10+
- Rust lets us access OS concurrency primitives such as threads and mutexes.
11+
- We will see how the type system gives prevents certain kinds of concurrency
12+
bugs when using multiple threads.
13+
14+
</details>

src/concurrency/welcome.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,29 @@ target_minutes: 180
66

77
# Welcome to Concurrency in Rust
88

9-
Rust has full support for concurrency using OS threads with mutexes and
10-
channels.
9+
This is one-day course about concurrency in Rust: structuring your program so it
10+
does multiple things concurrently or in parallel.
1111

12-
The Rust type system plays an important role in making many concurrency bugs
13-
compile time bugs. This is often referred to as _fearless concurrency_ since you
14-
can rely on the compiler to ensure correctness at runtime.
12+
We will cover two major parts of Rust today:
13+
14+
- Multi-threaded programming using threads and mutexes.
15+
- Concurrent programming using the `async` keyword.
1516

1617
## Schedule
1718

1819
{{%session outline}}
1920

20-
<details>
21+
## Target Audience
2122

22-
- Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc.
23-
- The type system gives us safety for concurrency without any special features.
24-
- The same tools that help with "concurrent" access in a single thread (e.g., a
25-
called function that might mutate an argument or save references to it to read
26-
later) save us from multi-threading issues.
23+
This course builds on [Rust Fundamentals](../welcome-day-1.md). To get the most
24+
out of the class, we expect that you are familiar with the basics of Rust, as
25+
well as concepts such as:
2726

28-
</details>
27+
- [Borrowing](../borrowing.md): you should understand the difference between
28+
shared borrows (`&T`) and exclusive borrows (`&mut T`),
29+
- [Generics](../generics.md): we will use a lot of
30+
[trait bounds](../generics/trait-bounds.md).
31+
- [Closures](../std-traits/closures.md): make sure you understand how closures
32+
capture values from their environment.
33+
- [`Rc`](../smart-pointers/rc.md): we will use a similar type for shared
34+
ownership.

0 commit comments

Comments
 (0)