From 678bec0eca2983c9aa1e2eecfef06f4aef80d4a1 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sat, 5 Oct 2019 19:20:30 +0200 Subject: [PATCH] Various fixes - Make cortex-a crate an optional dependecy of the rpi3 bsp - Introduce wildcards for dependencies - Change readme diff generation --- 02_runtime_init/Cargo.toml | 2 +- 02_runtime_init/README.md | 32 ++++++++++---------- 03_hacky_hello_world/Cargo.toml | 2 +- 03_hacky_hello_world/README.md | 26 ++++++++-------- 04_zero_overhead_abstraction/Cargo.toml | 8 +++-- 04_zero_overhead_abstraction/README.md | 37 ++++++++++++++--------- 04_zero_overhead_abstraction/kernel | Bin 79088 -> 79088 bytes 04_zero_overhead_abstraction/kernel8.img | Bin 6661 -> 6661 bytes utils/diff_tut_folders.bash | 3 +- 9 files changed, 60 insertions(+), 50 deletions(-) diff --git a/02_runtime_init/Cargo.toml b/02_runtime_init/Cargo.toml index ef7d6d86..da487f1a 100644 --- a/02_runtime_init/Cargo.toml +++ b/02_runtime_init/Cargo.toml @@ -13,4 +13,4 @@ default = [] bsp_rpi3 = [] [dependencies] -r0 = "0.2.2" +r0 = "0.2.*" diff --git a/02_runtime_init/README.md b/02_runtime_init/README.md index f0139dc9..5d588cfb 100644 --- a/02_runtime_init/README.md +++ b/02_runtime_init/README.md @@ -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 +// diff --git a/03_hacky_hello_world/Cargo.toml b/03_hacky_hello_world/Cargo.toml index ef7d6d86..da487f1a 100644 --- a/03_hacky_hello_world/Cargo.toml +++ b/03_hacky_hello_world/Cargo.toml @@ -13,4 +13,4 @@ default = [] bsp_rpi3 = [] [dependencies] -r0 = "0.2.2" +r0 = "0.2.*" diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index 72096033..1773905a 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -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 +// diff --git a/04_zero_overhead_abstraction/Cargo.toml b/04_zero_overhead_abstraction/Cargo.toml index 85b3a052..a0734bd3 100644 --- a/04_zero_overhead_abstraction/Cargo.toml +++ b/04_zero_overhead_abstraction/Cargo.toml @@ -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 } diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index b5dd1077..c18d7d19 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -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. diff --git a/04_zero_overhead_abstraction/kernel b/04_zero_overhead_abstraction/kernel index 04f2c470083d87a5c2025d49d50eca9e44558a1b..900565068d58e435c50f2743c459924be592e5d5 100755 GIT binary patch delta 2591 zcmah}U2GIp6h3FR%TEPar0udT&|O+6g|eNWJAaC?6^S57Y|{|qL)+Qe8EI&1sYNh8 z>>^JZB5bU=KKKBdh~-60NY)39U`QZQBPIA3UqD}4Uc@&VN$Z`Nd-+*5VUoFL?sxva zbMCowd$#8GY)x?zUn!&!Cex6<4$w76B&fR(8~Al0hSM`KDBX;~*&9qsi;BJTEwQPV zI7}kIxf_2&DFY3qznIRHV6q6H&o_0=F~3sa56mXUUbs+Ka^l5aw^$$APVrn}j_ol0 z97yFK5SL2z$7>#qe5yPf!zSFma15vCx4_&rfJunK`K16SXIh}t?qKQGF(?I$77DSc z8=t|{PAK-yu7EjabFSSt8HF)|`2|vyF^m2A zM?F~A*}b|{i^blc6$}4KQws&0nrVZnTdQF1&-n!!I0K|gtmLqjbXgp~!IR~$7UKad zlf`&m&0p7F)y~X*v+R)S&$U%^Y9759Q~!w&>; zMgsqy{Hi^3PNF%NK&_%7QAPd~>+Vk?5-JjX@i zW!(NM??+THn*y0T)Y9&Cn8b7>j8G_hq(Cddxr+AmhfWe)sK8x%x(SoJdbr!~6>2dB zOKKi2x{qyx!4mit&S_snW;hfnLFP_H)P8z#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3lvWz}+B)$eNXm0&$di8v_e(!tAx`Sw#9zBso16>>o(J*r%L?L z@rdiGmKPA;4s^>84b9bvBb&Y-g!&BzRkLK7Rc#Sn)^&YAHWl(eDa3L#P$Uea!KgR> z3_T#D-QrrrwjAOaVQ6}~9&D#GRlGlUXwsROr0;FPuwL)SnM{3L#eImc(~BB*{R0}d B&RYNg diff --git a/04_zero_overhead_abstraction/kernel8.img b/04_zero_overhead_abstraction/kernel8.img index 37798266a8d48f5ec80ab30a69dfd231353a3591..761489e8663d5ba4670265c8fe864917b6756fd0 100755 GIT binary patch delta 515 zcmZvYyGsK>5XQf`^?W}HbBRI33sEEpM&ZQ5!dIi%XbM{ml0p;_TZp zSw+s$B87!uV?=ChqBb#qfroPEUUFig#m?~U{AT9cJvNSw{90Bg6m;m1z`SE92$k99 zlgFr1W8g0g7gd>+Rx{$ zA1}+S>KUwMn5p+ZIFczP(h*)y!jV43EJc+?5*wte5#P8tqM_K7Gy~T&{xvHHpY!!l za$$gXl9}>9!TVG!FH2T!3|74#&a>;C`n^Du%f~i8QFN=!2V8iF_!MJL~9krZJA$}s@N7#@gDRAhvx zo0uRYD#pq%g%K$J;4#BQ#Rn1-A2Bmb)S5U^CaOVfVj^opP_lzKSZoed&;Mq|i~qD4 zeoh1O8JHQia56AVc%jTNQBzQ4;;Uwci6FE7*E6qtu$W<`2hjeP{0u*VYBp#lN=$sE z&+rpy$7F97NhUU?$!RPKtP&tgCwH^RDt-kS`0u|7$dSxI%z*3wput%i_ewK~`m$g; zH*xb@CTT{XhaG-$GBSuv=3(8#bmrgYQ>o&z zb3^$mK$>;3uBb8Nl*x&r@`B!}MR}> "$2/README.md"