[SQ] Replace runscript.sh with ninja file
This commit is contained in:
parent
b0ed5d0c17
commit
e81c6ddf84
|
@ -1,2 +1 @@
|
||||||
[target.aarch64-vesper-metta]
|
[target.aarch64-vesper-metta]
|
||||||
runner=".cargo/runscript.sh"
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
aarch64-unknown-linux-musl-objcopy -O binary $1 $1.bin
|
|
||||||
|
|
||||||
# -d in_asm,unimp,int -S
|
|
||||||
/usr/local/Cellar/qemu/HEAD-3365de01b5-custom/bin/qemu-system-aarch64 -M raspi3 -serial null -serial stdio -kernel $1.bin
|
|
|
@ -40,4 +40,3 @@ memcpy = true
|
||||||
|
|
||||||
[package.metadata.bootimage]
|
[package.metadata.bootimage]
|
||||||
default-target = "targets/aarch64-vesper-metta.json"
|
default-target = "targets/aarch64-vesper-metta.json"
|
||||||
#run-command = ".cargo/runscript.sh"
|
|
||||||
|
|
23
README.md
23
README.md
|
@ -33,22 +33,17 @@ Vesper has been influenced by the kernels in L4 family, notably seL4. Fawn and N
|
||||||
Use rustc nightly 2018-04-01 or later because of [bugs fixed](https://github.com/rust-lang/rust/issues/48884).
|
Use rustc nightly 2018-04-01 or later because of [bugs fixed](https://github.com/rust-lang/rust/issues/48884).
|
||||||
|
|
||||||
```
|
```
|
||||||
cargo xbuild --target=targets/aarch64-vesper-metta.json --release
|
ninja qemu
|
||||||
|
|
||||||
# Post-command:
|
|
||||||
sh .cargo/runscript.sh
|
|
||||||
cp target/aarch64-vesper-metta/release/vesper.bin /Volumes/boot/vesper
|
|
||||||
|
|
||||||
# config.txt on RPi3
|
|
||||||
kernel=vesper
|
|
||||||
arm_64bit=1
|
|
||||||
|
|
||||||
# To run in qemu, `brew install qemu --HEAD --with-libusb` and
|
|
||||||
### This command is not supported by cargo-xbuild yet: xargo run --target=aarch64-vesper-metta
|
|
||||||
# Use this instead:
|
|
||||||
sh .cargo/runscript.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Will run `cargo xbuild` to create kernel and run it in qemu emulator.
|
||||||
|
|
||||||
|
```
|
||||||
|
ninja device
|
||||||
|
```
|
||||||
|
|
||||||
|
Will build kernel, and copy it to sdcard at /Volumes/BOOT/
|
||||||
|
|
||||||
## OSdev help
|
## OSdev help
|
||||||
|
|
||||||
Based on [Raspi3 tutorials by Andre Richter](https://github.com/rust-embedded/rust-raspi3-tutorial/blob/master/05_uart0/src/uart.rs),
|
Based on [Raspi3 tutorials by Andre Richter](https://github.com/rust-embedded/rust-raspi3-tutorial/blob/master/05_uart0/src/uart.rs),
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
TARGET = aarch64-vesper-metta
|
||||||
|
FEATURES = --features "noserial"
|
||||||
|
|
||||||
|
UTILS_CONTAINER = andrerichter/raspi3-utils
|
||||||
|
DOCKER_CMD = docker run -it --rm -v ./:/work -w /work
|
||||||
|
QEMU_CMD = qemu-system-aarch64 -M raspi3 -kernel
|
||||||
|
|
||||||
|
# -d in_asm,unimp,int -S
|
||||||
|
QEMU = /usr/local/Cellar/qemu/HEAD-3365de01b5-custom/bin/qemu-system-aarch64 -M raspi3 -d int -serial null -serial stdio -kernel
|
||||||
|
|
||||||
|
rule cargo_build
|
||||||
|
command = cargo xbuild --target=targets/$TARGET.json --release $FEATURES
|
||||||
|
|
||||||
|
rule strip
|
||||||
|
command = cargo objcopy -- --strip-all -O binary $in $out
|
||||||
|
|
||||||
|
rule docker_qemulate
|
||||||
|
command = $DOCKER_CMD $UTILS_CONTAINER $QEMU_CMD $in
|
||||||
|
|
||||||
|
rule qemulate
|
||||||
|
command = $QEMU $in
|
||||||
|
|
||||||
|
build kernel: cargo_build
|
||||||
|
|
||||||
|
build kernel8.img: strip target/${TARGET}/release/vesper | kernel
|
||||||
|
|
||||||
|
build qemu: qemulate kernel8.img
|
||||||
|
|
||||||
|
default kernel8.img
|
||||||
|
|
Loading…
Reference in New Issue