1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 16:16:16 +04:00

Merge branch 'master' into dev

This commit is contained in:
Yuekai Jia 2019-09-26 11:29:39 +08:00 committed by GitHub
commit c99266c013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 43 deletions

View File

@ -1,10 +1,10 @@
sudo: false
dist: xenial
dist: bionic
language: rust
rust: nightly-2019-09-01
rust: nightly-2019-07-15
os:
- linux
@ -18,8 +18,11 @@ cache:
addons:
homebrew:
update: true
brewfile: true
packages:
- qemu
- dtc
env:
matrix:
@ -35,26 +38,11 @@ env:
install:
- if [ $TRAVIS_OS_NAME = linux ]; then
wget https://download.qemu.org/qemu-4.1.0.tar.xz && tar xJf qemu-4.1.0.tar.xz > /dev/null && cd qemu-4.1.0 && ./configure --target-list=$ARCH-softmmu && make && cd ..;
[ ! -d qemu-4.1.0/$ARCH-softmmu ] && wget https://download.qemu.org/qemu-4.1.0.tar.xz && tar xJf qemu-4.1.0.tar.xz > /dev/null && cd qemu-4.1.0 && ./configure --target-list=$ARCH-softmmu && make && cd ..;
export PATH=$PATH:$PWD/qemu-4.1.0/$ARCH-softmmu:$PWD/qemu-4.1.0;
sudo apt update;
sudo apt install device-tree-compiler -y;
fi
- if [ 1 ]; then
[ $ARCH = riscv32 ] && export FILE="riscv32-linux-musl-cross";
[ $ARCH = riscv64 ] && export FILE="riscv64-linux-musl-cross";
[ $ARCH = mipsel ] && export FILE="mipsel-linux-musln32-cross";
[ $ARCH = aarch64 ] && export FILE="aarch64-linux-musl-cross";
[ $ARCH = x86_64 ] && export FILE="x86_64-linux-musl-cross";
if [ $TRAVIS_OS_NAME = linux ]; then
wget https://musl.cc/$FILE.tgz;
elif [ $TRAVIS_OS_NAME = osx ]; then
wget https://mac.musl.cc/$FILE.tgz;
fi;
tar -xf $FILE.tgz;
export PATH=$PATH:$PWD/$FILE/bin;
fi
before_script:
- rustup component add rust-src llvm-tools-preview
@ -62,8 +50,9 @@ before_script:
- (test -x $HOME/.cargo/bin/cargo-xbuild || cargo install cargo-xbuild)
script:
- cd user && make sfsimg arch=$ARCH && cd ..
- cd user && make sfsimg arch=$ARCH prebuilt=1 && cd ..
- cd kernel && make build arch=$ARCH $OPTS && cd ..
- if [ $ARCH = riscv32 ]; then
cd tests && ./test.sh && cd ..;
fi
- cd kernel && make test arch=$ARCH $OPTS && cd ..
before_cache:
- if [ $TRAVIS_OS_NAME = osx ]; then brew cleanup; fi

View File

@ -19,7 +19,7 @@ Supported architectures and boards:
### Environment
* [Rust](https://www.rust-lang.org) toolchain at nightly-2019-09-01
* [Rust](https://www.rust-lang.org) toolchain
* Cargo tools: [cargo-xbuild](https://github.com/rust-osdev/cargo-xbuild)
* [QEMU](https://www.qemu.org) >= 3.1.0
* [musl-based GCC toolchains](https://musl.cc/)

View File

@ -2,10 +2,8 @@
# make build Build
# make run Build and run in QEMU
# make justrun Run the last build
# make runnet Build and run in QEMU with nic
# make justrunnet Run the last build with nic
# make runtest Build and run in QEMU with specified program
# make justruntest Run the last build with specified program
# make test Build and run in QEMU with specified program
# make justtest Run the last build with specified program
# make doc Generate docs
# make asm Open the deassemble file of the last build
# make header Open 'objdump -h' of the last build
@ -26,6 +24,7 @@
# | k210 Only available on riscv64, run on K210, use Sv39
# | rocket_chip Only available on riscv64, run on Rocket Chip, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# net = on | off Only available on x86_64, enable NIC
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
# init = /bin/ls Only available on riscv64, run specified program instead of user shell
# extra_nic = on | off Only available on x86_64, add an additional e1000 nic
@ -41,6 +40,7 @@ pci_passthru ?=
init ?=
extra_nic ?= off
qemu := qemu-system-$(arch)
target := $(arch)
build_path := target/$(target)/$(mode)
kernel := $(build_path)/rcore
@ -180,6 +180,11 @@ ifeq ($(graphic), off)
qemu_opts += -nographic
endif
ifeq ($(net), on)
qemu_opts += $(qemu_net_opts)
qemu := sudo $(qemu)
endif
### build args ###
ifeq ($(graphic), off)
features += nographic
@ -236,7 +241,7 @@ strip := cargo strip --
dtc := dtc
hostcc := gcc
.PHONY: all clean build asm doc debug kernel sfsimg install run justrun runnet justrunnet runtest justruntest
.PHONY: all clean build asm doc debug kernel sfsimg install run justrun test justtest
all: kernel
@ -248,20 +253,17 @@ doc:
@cargo rustdoc -- --document-private-items
run: build justrun
runnet: build justrunnet
runtest: build justruntest
test: build justtest
justrun:
@qemu-system-$(arch) $(qemu_opts)
@$(qemu) $(qemu_opts)
justrunnet: build
@sudo qemu-system-$(arch) $(qemu_opts) $(qemu_net_opts)
justruntest: build
@qemu-system-$(arch) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
justtest:
# unavailable now
@#$(qemu) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
debug: $(kernel) $(kernel_img)
@qemu-system-$(arch) $(qemu_opts) -s -S &
@$(qemu) $(qemu_opts) -s -S &
@sleep 1
@$(gdb) $(kernel) -x ../tools/gdbinit
@ -309,8 +311,6 @@ kernel: $(dtb)
@echo Building $(arch) kernel
ifeq ($(arch), x86_64)
@cargo xbuild $(build_args)
@echo "Now patching kernel symbols onto kernel."
@../tools/fill_symbols/x86_64.sh target/x86_64/$(mode)/rcore
else ifeq ($(arch), $(filter $(arch), riscv32 riscv64))
ifeq ($(board), k210)
@cp src/arch/riscv32/board/k210/linker.ld src/arch/riscv32/boot/linker64.ld

View File

@ -36,7 +36,7 @@ pub fn init_driver() {
yres_virtual: 600,
xoffset: 0,
yoffset: 0,
depth: fb::ColorDepth::try_from(8)?,
depth: fb::ColorDepth::ColorDepth8,
format: fb::ColorFormat::VgaPalette,
paddr: 0xb0000000,
vaddr: 0xb0000000,

View File

@ -25,7 +25,7 @@ pub fn init_driver() {
yres_virtual: 600,
xoffset: 0,
yoffset: 0,
depth: fb::ColorDepth::try_from(8)?,
depth: fb::ColorDepth::ColorDepth8,
format: fb::ColorFormat::RGB332,
paddr: 0xa2000000,
vaddr: 0xa2000000,

View File

@ -1 +1 @@
nightly-2019-09-01
nightly-2019-07-15

2
user

@ -1 +1 @@
Subproject commit 496a65e1d52c112c568f004144900d09e1d008c5
Subproject commit 10ac61f9ee5f64f2884b54719203be189ecb189d