Skip to content

Commit eba03d8

Browse files
bors[bot]japaric
andcommitted
Merge #18
18: move cargo-binutils v0.1.2; add tests r=therealprof a=japaric this commit does several things: - it moves to cargo-binutils v0.1.2 simplifying the commands used in the text - it adds tests (see /ci/script.sh) to test the instructions at different stages (see the subdirectories of /ci) - it replaces lots of code blocks (```) with `{{#include ..}}` to avoid repeating code between the text and the tests. This also ensures that the tests won't get out of sync with the text. closes #10 r? @rust-embedded/resources (anyone) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents 3c3f413 + 5e7c3ad commit eba03d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1016
-492
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
.stderr
2+
.stdout
3+
Cargo.lock
14
book
5+
target

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
language: rust
2+
rust: nightly
3+
4+
addons:
5+
apt:
6+
packages:
7+
- qemu-system-arm
28

39
install:
410
- bash ci/install.sh

ci/exceptions/app/.cargo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../memory-layout/.cargo

ci/exceptions/app/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "app"
3+
version = "0.1.0"
4+
authors = ["Jorge Aparicio <jorge@japaric.io>"]
5+
6+
[dependencies]
7+
rt = { path = "../rt" }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
app: file format ELF32-arm-little
3+
4+
Contents of section .vector_table:
5+
0000 00000120 45000000 7f000000 7f000000 ... E...........
6+
0010 7f000000 7f000000 7f000000 00000000 ................
7+
0020 00000000 00000000 00000000 7f000000 ................
8+
0030 00000000 00000000 7f000000 7f000000 ................

ci/exceptions/app/src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(core_intrinsics)]
2+
#![no_main]
3+
#![no_std]
4+
5+
#[macro_use]
6+
extern crate rt;
7+
8+
use core::intrinsics;
9+
10+
entry!(main);
11+
12+
fn main() -> ! {
13+
// this executes the undefined instruction (UDF) and causes a HardFault exception
14+
unsafe { intrinsics::abort() }
15+
}

ci/exceptions/app2/.cargo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../memory-layout/.cargo

ci/exceptions/app2/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../main/app/Cargo.toml

ci/exceptions/app2/src/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![feature(core_intrinsics)]
2+
#![no_main]
3+
#![no_std]
4+
5+
#[macro_use]
6+
extern crate rt;
7+
8+
use core::intrinsics;
9+
10+
entry!(main);
11+
12+
fn main() -> ! {
13+
unsafe { intrinsics::abort() }
14+
}
15+
16+
#[no_mangle]
17+
pub extern "C" fn HardFault() -> ! {
18+
// do something interesting here
19+
loop {}
20+
}

ci/exceptions/rt/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../main/rt/Cargo.toml

0 commit comments

Comments
 (0)