1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 00:16:17 +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 sudo: false
dist: xenial dist: bionic
language: rust language: rust
rust: nightly-2019-09-01 rust: nightly-2019-07-15
os: os:
- linux - linux
@ -18,8 +18,11 @@ cache:
addons: addons:
homebrew: homebrew:
update: true
brewfile: true
packages: packages:
- qemu - qemu
- dtc
env: env:
matrix: matrix:
@ -35,26 +38,11 @@ env:
install: install:
- if [ $TRAVIS_OS_NAME = linux ]; then - 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; export PATH=$PATH:$PWD/qemu-4.1.0/$ARCH-softmmu:$PWD/qemu-4.1.0;
sudo apt update; sudo apt update;
sudo apt install device-tree-compiler -y; sudo apt install device-tree-compiler -y;
fi 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: before_script:
- rustup component add rust-src llvm-tools-preview - 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) - (test -x $HOME/.cargo/bin/cargo-xbuild || cargo install cargo-xbuild)
script: 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 .. - cd kernel && make build arch=$ARCH $OPTS && cd ..
- if [ $ARCH = riscv32 ]; then - cd kernel && make test arch=$ARCH $OPTS && cd ..
cd tests && ./test.sh && cd ..;
fi before_cache:
- if [ $TRAVIS_OS_NAME = osx ]; then brew cleanup; fi

View File

@ -19,7 +19,7 @@ Supported architectures and boards:
### Environment ### 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) * Cargo tools: [cargo-xbuild](https://github.com/rust-osdev/cargo-xbuild)
* [QEMU](https://www.qemu.org) >= 3.1.0 * [QEMU](https://www.qemu.org) >= 3.1.0
* [musl-based GCC toolchains](https://musl.cc/) * [musl-based GCC toolchains](https://musl.cc/)

View File

@ -2,10 +2,8 @@
# make build Build # make build Build
# make run Build and run in QEMU # make run Build and run in QEMU
# make justrun Run the last build # make justrun Run the last build
# make runnet Build and run in QEMU with nic # make test Build and run in QEMU with specified program
# make justrunnet Run the last build with nic # make justtest Run the last build with specified program
# make runtest Build and run in QEMU with specified program
# make justruntest Run the last build with specified program
# make doc Generate docs # make doc Generate docs
# make asm Open the deassemble file of the last build # make asm Open the deassemble file of the last build
# make header Open 'objdump -h' 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 # | k210 Only available on riscv64, run on K210, use Sv39
# | rocket_chip Only available on riscv64, run on Rocket Chip, 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+ # | 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 # 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 # 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 # extra_nic = on | off Only available on x86_64, add an additional e1000 nic
@ -41,6 +40,7 @@ pci_passthru ?=
init ?= init ?=
extra_nic ?= off extra_nic ?= off
qemu := qemu-system-$(arch)
target := $(arch) target := $(arch)
build_path := target/$(target)/$(mode) build_path := target/$(target)/$(mode)
kernel := $(build_path)/rcore kernel := $(build_path)/rcore
@ -180,6 +180,11 @@ ifeq ($(graphic), off)
qemu_opts += -nographic qemu_opts += -nographic
endif endif
ifeq ($(net), on)
qemu_opts += $(qemu_net_opts)
qemu := sudo $(qemu)
endif
### build args ### ### build args ###
ifeq ($(graphic), off) ifeq ($(graphic), off)
features += nographic features += nographic
@ -236,7 +241,7 @@ strip := cargo strip --
dtc := dtc dtc := dtc
hostcc := gcc 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 all: kernel
@ -248,20 +253,17 @@ doc:
@cargo rustdoc -- --document-private-items @cargo rustdoc -- --document-private-items
run: build justrun run: build justrun
runnet: build justrunnet test: build justtest
runtest: build justruntest
justrun: justrun:
@qemu-system-$(arch) $(qemu_opts) @$(qemu) $(qemu_opts)
justrunnet: build justtest:
@sudo qemu-system-$(arch) $(qemu_opts) $(qemu_net_opts) # unavailable now
@#$(qemu) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
justruntest: build
@qemu-system-$(arch) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
debug: $(kernel) $(kernel_img) debug: $(kernel) $(kernel_img)
@qemu-system-$(arch) $(qemu_opts) -s -S & @$(qemu) $(qemu_opts) -s -S &
@sleep 1 @sleep 1
@$(gdb) $(kernel) -x ../tools/gdbinit @$(gdb) $(kernel) -x ../tools/gdbinit
@ -309,8 +311,6 @@ kernel: $(dtb)
@echo Building $(arch) kernel @echo Building $(arch) kernel
ifeq ($(arch), x86_64) ifeq ($(arch), x86_64)
@cargo xbuild $(build_args) @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)) else ifeq ($(arch), $(filter $(arch), riscv32 riscv64))
ifeq ($(board), k210) ifeq ($(board), k210)
@cp src/arch/riscv32/board/k210/linker.ld src/arch/riscv32/boot/linker64.ld @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, yres_virtual: 600,
xoffset: 0, xoffset: 0,
yoffset: 0, yoffset: 0,
depth: fb::ColorDepth::try_from(8)?, depth: fb::ColorDepth::ColorDepth8,
format: fb::ColorFormat::VgaPalette, format: fb::ColorFormat::VgaPalette,
paddr: 0xb0000000, paddr: 0xb0000000,
vaddr: 0xb0000000, vaddr: 0xb0000000,

View File

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