Make script easily support both rv32 and rv64.

toolchain_update
dzy 6 years ago
parent 98c94a0d83
commit 1d1d4109c3

@ -1,423 +0,0 @@
#!/bin/bash
# The contents are adopted from xbuild verbose output.
if ! [ -d outdir ]
then
echo "You have to \`mkdir outdir\` first."
echo "If you know what you're doing, do this yourself, otherwise quit."
exit 1
fi
rustc --crate-name core /home/dzy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=3 \
-C debuginfo=2 \
-Z force-unstable-if-unmarked \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json
# omit build_script_build
rustc --crate-name compiler_builtins /home/dzy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcompiler_builtins/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=3 \
-C debuginfo=2 \
-Z force-unstable-if-unmarked \
--cfg 'feature="compiler-builtins"' \
--cfg 'feature="mem"' \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir
rustc --crate-name alloc /home/dzy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=3 \
-C debuginfo=2 \
-Z force-unstable-if-unmarked \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir
rustc --crate-name semver_parser /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name cfg_if /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.6/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name spin /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/spin-0.4.10/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="const_fn"' \
--cfg 'feature="default"' \
--cfg 'feature="once"' \
--cfg 'feature="unstable"' \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name cc /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.25/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name static_assertions /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/static_assertions-0.3.1/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name bit_field /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/bit_field-0.9.0/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name zero /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/zero-0.1.2/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name bit_vec /home/dzy/.cargo/git/checkouts/bit-vec-437fa4a002bd318d/9861a58d6e76/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name bitflags /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.4/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="default"' \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name volatile /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/volatile-0.2.5/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name once /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/once-0.3.3/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name bbl /home/dzy/rust/RustOS/crate/bbl/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir
rustc --crate-name log /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.6/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name linked_list_allocator /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/linked_list_allocator-0.6.3/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="default"' \
--cfg 'feature="spin"' \
--cfg 'feature="use_spin"' \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name lazy_static /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.2.0/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="spin"' \
--cfg 'feature="spin_no_std"' \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name xmas_elf /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/xmas-elf-0.6.2/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name bit_allocator /home/dzy/rust/RustOS/crate/bit-allocator/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
rustc --edition=2018 --crate-name simple_filesystem /home/dzy/.cargo/git/checkouts/simplefilesystem-rust-868ccb44dbeefdea/249383f7e3f1/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--extern bit_vec=$PWD/outdir/libbit_vec.rlib \
--extern spin=$PWD/outdir/libspin.rlib \
--extern static_assertions=$PWD/outdir/libstatic_assertions.rlib \
--cap-lints allow
rustc --edition=2018 --crate-name ucore_process /home/dzy/rust/RustOS/crate/process/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
--extern log=$PWD/outdir/liblog.rlib \
--extern spin=$PWD/outdir/libspin.rlib \
-L $PWD/outdir
rustc --edition=2018 --crate-name ucore_memory /home/dzy/rust/RustOS/crate/memory/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
--extern log=$PWD/outdir/liblog.rlib \
-L $PWD/outdir
rustc --crate-name semver /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--cfg 'feature="default"' \
--out-dir $PWD/outdir \
-L $PWD/outdir \
--extern semver_parser=$PWD/outdir/libsemver_parser.rlib \
--cap-lints allow
# omit build_script_build
rustc --crate-name rustc_version /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.2.3/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
-L $PWD/outdir \
--extern semver=$PWD/outdir/libsemver.rlib \
--cap-lints allow
# omit build_script_build
rustc --crate-name bare_metal /home/dzy/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.4/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--cap-lints allow
rustc --crate-name riscv /home/dzy/.cargo/git/checkouts/riscv-1e845b622ce46f1d/966eb26d5e8d/src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--extern bare_metal=$PWD/outdir/libbare_metal.rlib \
--extern bit_field=$PWD/outdir/libbit_field.rlib \
--extern bitflags=$PWD/outdir/libbitflags.rlib \
--cap-lints allow
rustc --edition=2018 --crate-name ucore src/lib.rs \
--color never --crate-type lib --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--extern bbl=$PWD/outdir/libbbl.rlib \
--extern bit_allocator=$PWD/outdir/libbit_allocator.rlib \
--extern bit_field=$PWD/outdir/libbit_field.rlib \
--extern bitflags=$PWD/outdir/libbitflags.rlib \
--extern lazy_static=$PWD/outdir/liblazy_static.rlib \
--extern linked_list_allocator=$PWD/outdir/liblinked_list_allocator.rlib \
--extern log=$PWD/outdir/liblog.rlib \
--extern once=$PWD/outdir/libonce.rlib \
--extern riscv=$PWD/outdir/libriscv.rlib \
--extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \
--extern spin=$PWD/outdir/libspin.rlib \
--extern ucore_memory=$PWD/outdir/libucore_memory.rlib \
--extern ucore_process=$PWD/outdir/libucore_process.rlib \
--extern volatile=$PWD/outdir/libvolatile.rlib \
--extern xmas_elf=$PWD/outdir/libxmas_elf.rlib \
-L native=/home/dzy/rust/RustOS/kernel/target/riscv32-blog_os/debug/build/ucore-6787973a04115b52/out \
-l static=atomic_rt -l static=sfsimg
rustc --edition=2018 --crate-name ucore src/main.rs \
--color never --crate-type bin --emit=dep-info,link \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target /home/dzy/rust/RustOS/kernel/riscv32-blog_os.json \
-L $PWD/outdir \
--extern bbl=$PWD/outdir/libbbl.rlib \
--extern bit_allocator=$PWD/outdir/libbit_allocator.rlib \
--extern bit_field=$PWD/outdir/libbit_field.rlib \
--extern bitflags=$PWD/outdir/libbitflags.rlib \
--extern lazy_static=$PWD/outdir/liblazy_static.rlib \
--extern linked_list_allocator=$PWD/outdir/liblinked_list_allocator.rlib \
--extern log=$PWD/outdir/liblog.rlib \
--extern once=$PWD/outdir/libonce.rlib \
--extern riscv=$PWD/outdir/libriscv.rlib \
--extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \
--extern spin=$PWD/outdir/libspin.rlib \
--extern ucore=$PWD/outdir/libucore.rlib \
--extern ucore_memory=$PWD/outdir/libucore_memory.rlib \
--extern ucore_process=$PWD/outdir/libucore_process.rlib \
--extern volatile=$PWD/outdir/libvolatile.rlib \
--extern xmas_elf=$PWD/outdir/libxmas_elf.rlib \
-L native=/home/dzy/rust/RustOS/kernel/target/riscv32-blog_os/debug/build/ucore-6787973a04115b52/out
cd ../riscv-pk && mkdir -p build && cd build
../configure \
--with-arch=rv32imac \
--disable-fp-emulation \
--host=riscv32-unknown-elf \
--with-payload=../../kernel/outdir/ucore
make -j8
cp bbl ../../kernel/outdir/kernel.bin
cd ../../kernel
qemu-system-riscv32 -smp cores=4 -nographic -machine virt -kernel outdir/kernel.bin || [ $? -eq 11 ] # run qemu and assert it exit 11

@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
# The contents are adopted from xbuild verbose output. # The contents are adopted from xbuild verbose output.
# Output files are in $PWD/outdir # Output files are in $PWD/outdir
#
# Usage: # Usage:
# Just run # Just run
# $ ./run-qemu-script-custom-llc # $ ./run-qemu-script-custom-llc
#
# By default riscv32 is built. To build for riscv64,
# set the environment variable `RV64` to "1"
set -e set -e
if ! [[ -d outdir ]] if ! [[ -d outdir ]]
@ -13,17 +17,31 @@ then
exit 1 exit 1
fi fi
# CONFIGURATIONS if [[ ${RV64} = 1 ]]; then
export LOG=info TARGET_ARCH=riscv64
export LLC=$PWD/../tools/llc LOG=info
export LLC_ARCH=riscv64 COMPILER_RT_CFLAGS="-march=rv64ia -mabi=lp64 -DTARGET_IS_64BITS -O3"
export RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/src SFSIMG_CFLAGS="-march=rv64ia -mabi=lp64"
export TARGET_JSON=$PWD/riscv64-blog_os.json RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv64imac --disable-fp-emulation --host=riscv64-unknown-elf"
export CARGO_PATH=~/.cargo UCORE_USER_IMAGE="../user/img/ucore-riscv64.img"
export CC=riscv64-unknown-elf-gcc else
export AR=riscv64-unknown-elf-ar exit 1
export OBJCOPY=riscv64-unknown-elf-objcopy TARGET_ARCH=riscv32
export QEMU=$PWD/../../@github/qemu/build/riscv64-softmmu/qemu-system-riscv64 COMPILER_RT_CFLAGS="-march=rv32ia -mabi=ilp32 -O3"
SFSIMG_CFLAGS="-march=rv32ia -mabi=ilp32"
RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv32imac --disable-fp-emulation --host=riscv32-unknown-elf"
UCORE_USER_IMAGE="../user/img/ucore-rv32.img"
fi
LLC=llc
RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/src
CARGO_PATH=~/.cargo
LLC_ARCH=${TARGET_ARCH}
TARGET_JSON=$PWD/${TARGET_ARCH}-blog_os.json
CC=${TARGET_ARCH}-unknown-elf-gcc
AR=${TARGET_ARCH}-unknown-elf-ar
OBJCOPY=${TARGET_ARCH}-unknown-elf-objcopy
QEMU=qemu-system-${TARGET_ARCH}
#============================================================================ #============================================================================
@ -213,21 +231,6 @@ rustc --crate-name bitflags $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823
gen_full_rlib gen_full_rlib
fi fi
CNAME=tock_registers
if ! [[ -f outdir/${CNAME}.o ]]
then
rustc --edition=2018 --crate-name tock_registers $CARGO_PATH/registry/src/github.com-1ecc6299db9ec823/tock-registers-0.3.0/src/lib.rs \
--color always --crate-type lib --emit=metadata,llvm-bc \
-C opt-level=1 \
-C debuginfo=2 \
-C debug-assertions=on \
--out-dir $PWD/outdir \
--target $TARGET_JSON \
-L $PWD/outdir \
--cap-lints allow
gen_full_rlib
fi
CNAME=volatile CNAME=volatile
if ! [[ -f outdir/${CNAME}.o ]] if ! [[ -f outdir/${CNAME}.o ]]
then then
@ -472,7 +475,7 @@ fi
# Hand generate build.rs # Hand generate build.rs
if ! [[ -f outdir/libatomic_rt.a ]] if ! [[ -f outdir/libatomic_rt.a ]]
then then
${CC} src/arch/riscv32/compiler_rt.c -march=rv64ia -mabi=lp64 -O3 -c -o outdir/compiler_rt.o ${CC} src/arch/riscv32/compiler_rt.c ${COMPILER_RT_CFLAGS} -c -o outdir/compiler_rt.o
${AR} r outdir/libatomic_rt.a outdir/compiler_rt.o ${AR} r outdir/libatomic_rt.a outdir/compiler_rt.o
fi fi
@ -484,10 +487,10 @@ cat >outdir/sfsimg.S <<EOF
.global _user_img_start .global _user_img_start
.global _user_img_end .global _user_img_end
_user_img_start: _user_img_start:
.incbin "../user/img/ucore-riscv64.img" .incbin "${UCORE_USER_IMAGE}"
_user_img_end: _user_img_end:
EOF EOF
${CC} outdir/sfsimg.S -march=rv64ia -mabi=lp64 -c -o outdir/sfsimg.o ${CC} outdir/sfsimg.S ${SFSIMG_CFLAGS} -c -o outdir/sfsimg.o
${AR} r outdir/libsfsimg.a outdir/sfsimg.o ${AR} r outdir/libsfsimg.a outdir/sfsimg.o
fi fi
@ -520,7 +523,6 @@ rustc --edition=2018 --crate-name ucore src/lib.rs \
--extern riscv=$PWD/outdir/libriscv.rlib \ --extern riscv=$PWD/outdir/libriscv.rlib \
--extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \ --extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \
--extern spin=$PWD/outdir/libspin.rlib \ --extern spin=$PWD/outdir/libspin.rlib \
--extern tock_registers=$PWD/outdir/libtock_registers.rlib \
--extern ucore_memory=$PWD/outdir/libucore_memory.rlib \ --extern ucore_memory=$PWD/outdir/libucore_memory.rlib \
--extern ucore_process=$PWD/outdir/libucore_process.rlib \ --extern ucore_process=$PWD/outdir/libucore_process.rlib \
--extern volatile=$PWD/outdir/libvolatile.rlib \ --extern volatile=$PWD/outdir/libvolatile.rlib \
@ -551,7 +553,6 @@ rustc --edition=2018 --crate-name ucore src/main.rs \
--extern riscv=$PWD/outdir/libriscv.rlib \ --extern riscv=$PWD/outdir/libriscv.rlib \
--extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \ --extern simple_filesystem=$PWD/outdir/libsimple_filesystem.rlib \
--extern spin=$PWD/outdir/libspin.rlib \ --extern spin=$PWD/outdir/libspin.rlib \
--extern tock_registers=$PWD/outdir/libtock_registers.rlib \
--extern ucore=$PWD/outdir/libucore.rlib \ --extern ucore=$PWD/outdir/libucore.rlib \
--extern ucore_memory=$PWD/outdir/libucore_memory.rlib \ --extern ucore_memory=$PWD/outdir/libucore_memory.rlib \
--extern ucore_process=$PWD/outdir/libucore_process.rlib \ --extern ucore_process=$PWD/outdir/libucore_process.rlib \
@ -564,14 +565,14 @@ if [[ ${K210} = 1 ]]; then
${OBJCOPY} outdir/ucore --strip-all -O binary outdir/ucore.bin ${OBJCOPY} outdir/ucore --strip-all -O binary outdir/ucore.bin
${QEMU} -nographic -cpu sifive-e51 -machine sifive_e -kernel outdir/ucore -d in_asm 2> dump ${QEMU} -nographic -cpu sifive-e51 -machine sifive_e -kernel outdir/ucore -d in_asm 2> dump
else else
cd ../riscv-pk && mkdir -p build && cd build cd ../riscv-pk
rm build -r || true
mkdir -p build && cd build
../configure \ ../configure \
--with-arch=rv64imac \ ${RISCV_PK_CONFIGURE_FLAGS} \
--disable-fp-emulation \
--host=riscv64-unknown-elf \
--with-payload=../../kernel/outdir/ucore --with-payload=../../kernel/outdir/ucore
make make
cp bbl ../../kernel/outdir/kernel.bin cp bbl ../../kernel/outdir/kernel.bin
cd ../../kernel cd ../../kernel
qemu-system-riscv64 -smp cores=4 -nographic -machine virt -kernel outdir/kernel.bin ${QEMU} -smp cores=4 -nographic -machine virt -kernel outdir/kernel.bin
fi fi

Loading…
Cancel
Save