From ac4fdd4ba8fe7865b965821a9854bf08cdda8bdc Mon Sep 17 00:00:00 2001 From: Sheng-Liang Song Date: Wed, 30 Mar 2022 15:37:51 -0700 Subject: [PATCH 1/2] Fix typo in md document --- src/asm.md | 4 ++-- src/compiler-support.md | 2 +- src/exceptions.md | 2 +- src/main.md | 2 +- src/preface.md | 16 +++++++++++----- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/asm.md b/src/asm.md index 9dbede9..11517c0 100644 --- a/src/asm.md +++ b/src/asm.md @@ -89,7 +89,7 @@ by writing a very simple program. Here's the disassembly. Look at the address of `HardFaultTrampoline`. ``` console -$ cargo objdump --bin app --release -- -d -no-show-raw-insn -print-imm-hex +$ cargo objdump --bin app --release -- -d --no-show-raw-insn --print-imm-hex ``` ``` text @@ -178,7 +178,7 @@ Now we can test this new version against the simple program from before and we'll get the same output. ``` console -$ cargo objdump --bin app --release -- -d -no-show-raw-insn -print-imm-hex +$ cargo objdump --bin app --release -- -d --no-show-raw-insn --print-imm-hex ``` ``` text diff --git a/src/compiler-support.md b/src/compiler-support.md index 91162e1..53e082f 100644 --- a/src/compiler-support.md +++ b/src/compiler-support.md @@ -20,7 +20,7 @@ following command: ``` console $ # you need to have `cargo-binutils` installed to run this command -$ cargo objdump -- -version +$ cargo objdump -- --version LLVM (http://llvm.org/): LLVM version 7.0.0svn Optimized build. diff --git a/src/exceptions.md b/src/exceptions.md index 7deb499..cb7995c 100644 --- a/src/exceptions.md +++ b/src/exceptions.md @@ -145,7 +145,7 @@ Breakpoint 1, DefaultExceptionHandler () And for completeness, here's the disassembly of the optimized version of the program: ``` console -$ cargo objdump --bin app --release -- -d -no-show-raw-insn -print-imm-hex +$ cargo objdump --bin app --release -- -d --no-show-raw-insn --print-imm-hex ``` ``` text diff --git a/src/main.md b/src/main.md index 87ad1e0..2a749d2 100644 --- a/src/main.md +++ b/src/main.md @@ -89,7 +89,7 @@ $ cat src/main.rs The disassembly will be similar but will now include the user `main` function. ``` console -$ cargo objdump --bin app -- -d -no-show-raw-insn +$ cargo objdump --bin app -- -d --no-show-raw-insn ``` ``` text diff --git a/src/preface.md b/src/preface.md index 131ae4e..b7a5e95 100644 --- a/src/preface.md +++ b/src/preface.md @@ -70,20 +70,26 @@ book: Instructions common to all OSes ``` console -$ # Rust toolchain -$ # If you start from scratch, get rustup from https://rustup.rs/ +# Rust toolchain (add +nightly for nightly rust version) +# If you start from scratch, get rustup from https://rustup.rs/ $ rustup default stable +$ rustup +nightly default stable -$ # toolchain should be newer than this one +# toolchain should be newer than this one $ rustc -V -rustc 1.31.0 (abe02cefd 2018-12-04) +rustc 1.59.0 (9d1b2106e 2022-02-23) +$ rustc +nightly -V +rustc 1.61.0-nightly (9c06e1ba4 2022-03-29) $ rustup target add thumbv7m-none-eabi +$ rustup +nightly target add thumbv7m-none-eabi -$ # cargo-binutils +# cargo-binutils $ cargo install cargo-binutils +$ cargo +nightly install cargo-binutils $ rustup component add llvm-tools-preview +$ rustup +nightly component add llvm-tools-preview ``` From 2bfbc608f63b93e4c1af5abbb9e252f026e89923 Mon Sep 17 00:00:00 2001 From: Sheng-Liang Song Date: Tue, 12 Apr 2022 13:26:22 -0700 Subject: [PATCH 2/2] Update comments --- src/preface.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/preface.md b/src/preface.md index b7a5e95..9f174e4 100644 --- a/src/preface.md +++ b/src/preface.md @@ -69,15 +69,24 @@ book: Instructions common to all OSes -``` console -# Rust toolchain (add +nightly for nightly rust version) +``` +console +# Rust toolchain # If you start from scratch, get rustup from https://rustup.rs/ + +# Change rustc to default stable version. $ rustup default stable -$ rustup +nightly default stable +$ rustc -V +$ rustc +nightly -V + +# Change rustc to default nightly version. +$ rustup default nightly +$ rustc -V -# toolchain should be newer than this one +# toolchain should be newer than this one. $ rustc -V rustc 1.59.0 (9d1b2106e 2022-02-23) + $ rustc +nightly -V rustc 1.61.0-nightly (9c06e1ba4 2022-03-29)