Various fixes

- Make cortex-a crate an optional dependecy of the rpi3 bsp
- Introduce wildcards for dependencies
- Change readme diff generation
This commit is contained in:
Andre Richter 2019-10-05 19:20:30 +02:00
parent 294538e323
commit 678bec0eca
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E
9 changed files with 60 additions and 50 deletions

View File

@ -13,4 +13,4 @@ default = []
bsp_rpi3 = []
[dependencies]
r0 = "0.2.2"
r0 = "0.2.*"

View File

@ -19,46 +19,46 @@ We are calling into Rust code for the first time.
```diff
diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml
--- 01_wait_forever/Cargo.toml 2019-09-23 15:09:10.919233495 +0200
+++ 02_runtime_init/Cargo.toml 2019-09-23 15:10:15.775036819 +0200
--- 01_wait_forever/Cargo.toml
+++ 02_runtime_init/Cargo.toml
@@ -13,4 +13,4 @@
bsp_rpi3 = []
[dependencies]
-
+r0 = "0.2.2"
+r0 = "0.2.*"
diff -uNr 01_wait_forever/src/bsp/rpi3/link.ld 02_runtime_init/src/bsp/rpi3/link.ld
--- 01_wait_forever/src/bsp/rpi3/link.ld 2019-09-23 15:09:10.919233495 +0200
+++ 02_runtime_init/src/bsp/rpi3/link.ld 2019-09-23 15:10:15.767036845 +0200
--- 01_wait_forever/src/bsp/rpi3/link.ld
+++ 02_runtime_init/src/bsp/rpi3/link.ld
@@ -13,5 +13,23 @@
*(.text)
*(.text._start) *(.text*)
}
+ .rodata :
+ {
+ *(.rodata)
+ *(.rodata*)
+ }
+
+ .data :
+ {
+ *(.data)
+ *(.data*)
+ }
+
+ /* Align to 8 byte boundary */
+ .bss ALIGN(8):
+ {
+ __bss_start = .;
+ *(.bss);
+ *(.bss*);
+ __bss_end = .;
+ }
+
/DISCARD/ : { *(.comment) }
/DISCARD/ : { *(.comment*) }
}
diff -uNr 01_wait_forever/src/bsp/rpi3/start.S 02_runtime_init/src/bsp/rpi3/start.S
--- 01_wait_forever/src/bsp/rpi3/start.S 2019-09-23 15:09:10.919233495 +0200
+++ 02_runtime_init/src/bsp/rpi3/start.S 2019-09-23 15:10:15.767036845 +0200
--- 01_wait_forever/src/bsp/rpi3/start.S
+++ 02_runtime_init/src/bsp/rpi3/start.S
@@ -7,5 +7,15 @@
.global _start
@ -79,8 +79,8 @@ diff -uNr 01_wait_forever/src/bsp/rpi3/start.S 02_runtime_init/src/bsp/rpi3/star
+ // park this core aswell
diff -uNr 01_wait_forever/src/main.rs 02_runtime_init/src/main.rs
--- 01_wait_forever/src/main.rs 2019-09-24 22:57:44.947372097 +0200
+++ 02_runtime_init/src/main.rs 2019-09-24 22:57:32.811412514 +0200
--- 01_wait_forever/src/main.rs
+++ 02_runtime_init/src/main.rs
@@ -16,4 +16,11 @@
// `_start()` function, the first function to run.
mod bsp;
@ -96,8 +96,8 @@ diff -uNr 01_wait_forever/src/main.rs 02_runtime_init/src/main.rs
+}
diff -uNr 01_wait_forever/src/runtime_init.rs 02_runtime_init/src/runtime_init.rs
--- 01_wait_forever/src/runtime_init.rs 1970-01-01 01:00:00.000000000 +0100
+++ 02_runtime_init/src/runtime_init.rs 2019-09-24 22:32:25.569243801 +0200
--- 01_wait_forever/src/runtime_init.rs
+++ 02_runtime_init/src/runtime_init.rs
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: MIT
+//

View File

@ -13,4 +13,4 @@ default = []
bsp_rpi3 = []
[dependencies]
r0 = "0.2.2"
r0 = "0.2.*"

View File

@ -15,8 +15,8 @@ enabled step-by-step in following tutorials.
```diff
diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile
--- 02_runtime_init/Makefile 2019-09-23 15:10:43.906916928 +0200
+++ 03_hacky_hello_world/Makefile 2019-09-23 15:11:53.602555646 +0200
--- 02_runtime_init/Makefile
+++ 03_hacky_hello_world/Makefile
@@ -13,7 +13,7 @@
OUTPUT = kernel8.img
QEMU_BINARY = qemu-system-aarch64
@ -24,12 +24,12 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile
- QEMU_MISC_ARGS = -d in_asm
+ QEMU_MISC_ARGS = -serial null -serial stdio
LINKER_FILE = src/bsp/rpi3/link.ld
RUSTC_MISC_ARGS = -C target-feature=-fp-armv8 -C target-cpu=cortex-a53
RUSTC_MISC_ARGS = -C target-cpu=cortex-a53
endif
diff -uNr 02_runtime_init/src/bsp/rpi3/panic_wait.rs 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs
--- 02_runtime_init/src/bsp/rpi3/panic_wait.rs 2019-09-23 15:10:15.767036845 +0200
+++ 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs 2019-09-24 00:48:21.431980264 +0200
--- 02_runtime_init/src/bsp/rpi3/panic_wait.rs
+++ 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs
@@ -4,10 +4,17 @@
//! A panic handler that infinitely waits.
@ -51,8 +51,8 @@ diff -uNr 02_runtime_init/src/bsp/rpi3/panic_wait.rs 03_hacky_hello_world/src/bs
asm!("wfe" :::: "volatile")
diff -uNr 02_runtime_init/src/bsp/rpi3.rs 03_hacky_hello_world/src/bsp/rpi3.rs
--- 02_runtime_init/src/bsp/rpi3.rs 2019-09-23 15:10:15.767036845 +0200
+++ 03_hacky_hello_world/src/bsp/rpi3.rs 2019-09-24 22:34:35.220657927 +0200
--- 02_runtime_init/src/bsp/rpi3.rs
+++ 03_hacky_hello_world/src/bsp/rpi3.rs
@@ -6,4 +6,38 @@
mod panic_wait;
@ -94,8 +94,8 @@ diff -uNr 02_runtime_init/src/bsp/rpi3.rs 03_hacky_hello_world/src/bsp/rpi3.rs
+}
diff -uNr 02_runtime_init/src/interface.rs 03_hacky_hello_world/src/interface.rs
--- 02_runtime_init/src/interface.rs 1970-01-01 01:00:00.000000000 +0100
+++ 03_hacky_hello_world/src/interface.rs 2019-09-24 22:35:18.288465568 +0200
--- 02_runtime_init/src/interface.rs
+++ 03_hacky_hello_world/src/interface.rs
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: MIT
+//
@ -135,8 +135,8 @@ diff -uNr 02_runtime_init/src/interface.rs 03_hacky_hello_world/src/interface.rs
+}
diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs
--- 02_runtime_init/src/main.rs 2019-09-24 22:57:32.811412514 +0200
+++ 03_hacky_hello_world/src/main.rs 2019-09-24 22:56:54.635538411 +0200
--- 02_runtime_init/src/main.rs
+++ 03_hacky_hello_world/src/main.rs
@@ -6,9 +6,17 @@
#![doc(html_logo_url = "https://git.io/JeGIp")]
@ -171,8 +171,8 @@ diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs
}
diff -uNr 02_runtime_init/src/print.rs 03_hacky_hello_world/src/print.rs
--- 02_runtime_init/src/print.rs 1970-01-01 01:00:00.000000000 +0100
+++ 03_hacky_hello_world/src/print.rs 2019-09-24 22:30:10.489867506 +0200
--- 02_runtime_init/src/print.rs
+++ 03_hacky_hello_world/src/print.rs
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: MIT
+//

View File

@ -10,8 +10,10 @@ sysroot_path = "../xbuild_sysroot"
# The features section is used to select the target board.
[features]
default = []
bsp_rpi3 = []
bsp_rpi3 = ["cortex-a"]
[dependencies]
r0 = "0.2.2"
cortex-a = "2.7.0"
r0 = "0.2.*"
# Optional dependencies
cortex-a = { version = "2.*", optional = true }

View File

@ -11,17 +11,24 @@ which provides zero-overhead abstractions and wraps the `unsafe` parts.
```diff
diff -uNr 03_hacky_hello_world/Cargo.toml 04_zero_overhead_abstraction/Cargo.toml
--- 03_hacky_hello_world/Cargo.toml 2019-09-25 14:41:51.089487788 +0200
+++ 04_zero_overhead_abstraction/Cargo.toml 2019-09-25 13:59:33.588482692 +0200
@@ -14,3 +14,4 @@
--- 03_hacky_hello_world/Cargo.toml
+++ 04_zero_overhead_abstraction/Cargo.toml
@@ -10,7 +10,10 @@
# The features section is used to select the target board.
[features]
default = []
-bsp_rpi3 = []
+bsp_rpi3 = ["cortex-a"]
[dependencies]
r0 = "0.2.2"
+cortex-a = "2.7.0"
r0 = "0.2.*"
+
+# Optional dependencies
+cortex-a = { version = "2.*", optional = true }
diff -uNr 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs 04_zero_overhead_abstraction/src/bsp/rpi3/panic_wait.rs
--- 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs 2019-09-25 14:41:51.093487759 +0200
+++ 04_zero_overhead_abstraction/src/bsp/rpi3/panic_wait.rs 2019-09-25 15:26:48.988205284 +0200
--- 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs
+++ 04_zero_overhead_abstraction/src/bsp/rpi3/panic_wait.rs
@@ -6,6 +6,7 @@
use crate::println;
@ -44,8 +51,8 @@ diff -uNr 03_hacky_hello_world/src/bsp/rpi3/panic_wait.rs 04_zero_overhead_abstr
}
diff -uNr 03_hacky_hello_world/src/bsp/rpi3/start.S 04_zero_overhead_abstraction/src/bsp/rpi3/start.S
--- 03_hacky_hello_world/src/bsp/rpi3/start.S 2019-09-25 15:07:28.593140386 +0200
+++ 04_zero_overhead_abstraction/src/bsp/rpi3/start.S 1970-01-01 01:00:00.000000000 +0100
--- 03_hacky_hello_world/src/bsp/rpi3/start.S
+++ 04_zero_overhead_abstraction/src/bsp/rpi3/start.S
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: MIT
-//
@ -70,8 +77,8 @@ diff -uNr 03_hacky_hello_world/src/bsp/rpi3/start.S 04_zero_overhead_abstraction
- // park this core aswell
diff -uNr 03_hacky_hello_world/src/bsp/rpi3.rs 04_zero_overhead_abstraction/src/bsp/rpi3.rs
--- 03_hacky_hello_world/src/bsp/rpi3.rs 2019-09-25 14:41:51.093487759 +0200
+++ 04_zero_overhead_abstraction/src/bsp/rpi3.rs 2019-09-25 15:19:14.474175689 +0200
--- 03_hacky_hello_world/src/bsp/rpi3.rs
+++ 04_zero_overhead_abstraction/src/bsp/rpi3.rs
@@ -8,8 +8,34 @@
use crate::interface::console;
@ -110,8 +117,8 @@ diff -uNr 03_hacky_hello_world/src/bsp/rpi3.rs 04_zero_overhead_abstraction/src/
struct QEMUOutput;
diff -uNr 03_hacky_hello_world/src/main.rs 04_zero_overhead_abstraction/src/main.rs
--- 03_hacky_hello_world/src/main.rs 2019-09-25 14:41:52.341478676 +0200
+++ 04_zero_overhead_abstraction/src/main.rs 2019-09-25 15:22:45.433268740 +0200
--- 03_hacky_hello_world/src/main.rs
+++ 04_zero_overhead_abstraction/src/main.rs
@@ -13,9 +13,7 @@
//!
//! [`kernel::interface`]: interface/index.html
@ -133,8 +140,8 @@ diff -uNr 03_hacky_hello_world/src/main.rs 04_zero_overhead_abstraction/src/main
}
diff -uNr 03_hacky_hello_world/src/runtime_init.rs 04_zero_overhead_abstraction/src/runtime_init.rs
--- 03_hacky_hello_world/src/runtime_init.rs 2019-09-25 14:41:51.093487759 +0200
+++ 04_zero_overhead_abstraction/src/runtime_init.rs 2019-09-25 14:00:32.560262587 +0200
--- 03_hacky_hello_world/src/runtime_init.rs
+++ 04_zero_overhead_abstraction/src/runtime_init.rs
@@ -13,7 +13,7 @@
///
/// - Only a single core must be active and running this function.

Binary file not shown.

View File

@ -7,7 +7,8 @@ DIFF=$(
-x kernel8.img \
-x Cargo.lock \
-x target \
$1 $2
$1 $2 \
| sed -r "s/[12][90][127][90]-.*//g"
)
printf "\n\n## Diff to previous\n" >> "$2/README.md"