mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-22 17:36:25 +04:00
Add recent updates from ch3
This commit is contained in:
parent
e73735e5e4
commit
db2bb39981
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
*/*
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ os/src/link_app.S
|
|||||||
user/target/*
|
user/target/*
|
||||||
user/.idea/*
|
user/.idea/*
|
||||||
user/Cargo.lock
|
user/Cargo.lock
|
||||||
|
tools/
|
||||||
|
40
Dockerfile
Normal file
40
Dockerfile
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
LABEL maintainer="dinghao188" \
|
||||||
|
version="1.1" \
|
||||||
|
description="ubuntu 18.04 with tools for tsinghua's rCore-Tutorial-V3"
|
||||||
|
|
||||||
|
#install some deps
|
||||||
|
RUN set -x \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y curl wget autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
|
||||||
|
gawk build-essential bison flex texinfo gperf libtool patchutils bc xz-utils \
|
||||||
|
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3
|
||||||
|
|
||||||
|
#install rust and qemu
|
||||||
|
RUN set -x; \
|
||||||
|
RUSTUP='/root/rustup.sh' \
|
||||||
|
&& cd $HOME \
|
||||||
|
#install rust
|
||||||
|
&& curl https://sh.rustup.rs -sSf > $RUSTUP && chmod +x $RUSTUP \
|
||||||
|
&& $RUSTUP -y --default-toolchain nightly --profile minimal \
|
||||||
|
|
||||||
|
#compile qemu
|
||||||
|
&& wget https://ftp.osuosl.org/pub/blfs/conglomeration/qemu/qemu-5.0.0.tar.xz \
|
||||||
|
&& tar xvJf qemu-5.0.0.tar.xz \
|
||||||
|
&& cd qemu-5.0.0 \
|
||||||
|
&& ./configure --target-list=riscv64-softmmu,riscv64-linux-user \
|
||||||
|
&& make -j$(nproc) install \
|
||||||
|
&& cd $HOME && rm -rf qemu-5.0.0 qemu-5.0.0.tar.xz
|
||||||
|
|
||||||
|
#for chinese network
|
||||||
|
RUN set -x; \
|
||||||
|
APT_CONF='/etc/apt/sources.list'; \
|
||||||
|
CARGO_CONF='/root/.cargo/config'; \
|
||||||
|
BASHRC='/root/.bashrc' \
|
||||||
|
&& echo 'export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static' >> $BASHRC \
|
||||||
|
&& echo 'export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup' >> $BASHRC \
|
||||||
|
&& touch $CARGO_CONF \
|
||||||
|
&& echo '[source.crates-io]' > $CARGO_CONF \
|
||||||
|
&& echo "replace-with = 'ustc'" >> $CARGO_CONF \
|
||||||
|
&& echo '[source.ustc]' >> $CARGO_CONF \
|
||||||
|
&& echo 'registry = "git://mirrors.ustc.edu.cn/crates.io-index"' >> $CARGO_CONF
|
8
Makefile
Normal file
8
Makefile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
DOCKER_NAME ?= dinghao188/rcore-tutorial
|
||||||
|
.PHONY: docker build_docker
|
||||||
|
|
||||||
|
docker:
|
||||||
|
docker run --rm -it --mount type=bind,source=$(shell pwd),destination=/mnt ${DOCKER_NAME}
|
||||||
|
|
||||||
|
build_docker:
|
||||||
|
docker build -t ${DOCKER_NAME} .
|
@ -1,2 +1,2 @@
|
|||||||
# rCore-Tutorial-v3
|
# rCore-Tutorial-v3
|
||||||
rCore-Tutorial version 3.
|
rCore-Tutorial version 3.
|
@ -58,7 +58,10 @@ disasm-vim: kernel
|
|||||||
@vim $(DISASM_TMP)
|
@vim $(DISASM_TMP)
|
||||||
@rm $(DISASM_TMP)
|
@rm $(DISASM_TMP)
|
||||||
|
|
||||||
run: run-inner
|
run: tools run-inner
|
||||||
|
|
||||||
|
tools:
|
||||||
|
(which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools)
|
||||||
|
|
||||||
run-inner: build
|
run-inner: build
|
||||||
ifeq ($(BOARD),qemu)
|
ifeq ($(BOARD),qemu)
|
||||||
@ -82,4 +85,4 @@ debug: build
|
|||||||
tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \
|
tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \
|
||||||
tmux -2 attach-session -d
|
tmux -2 attach-session -d
|
||||||
|
|
||||||
.PHONY: build env kernel clean disasm disasm-vim run-inner
|
.PHONY: build env kernel clean disasm disasm-vim run-inner tools
|
||||||
|
@ -23,7 +23,7 @@ fn insert_app_data() -> Result<()> {
|
|||||||
apps.sort();
|
apps.sort();
|
||||||
|
|
||||||
writeln!(f, r#"
|
writeln!(f, r#"
|
||||||
.align 4
|
.align 3
|
||||||
.section .data
|
.section .data
|
||||||
.global _num_app
|
.global _num_app
|
||||||
_num_app:
|
_num_app:
|
||||||
|
@ -1 +1 @@
|
|||||||
nightly
|
nightly-2021-01-30
|
||||||
|
280
tools/kflash.py
280
tools/kflash.py
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user