Skip to content

Commit

Permalink
Merge branch 'lib' into intr
Browse files Browse the repository at this point in the history
  • Loading branch information
MRNIU committed Jan 14, 2022
2 parents eefdabb + 57646c8 commit 9b463a6
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ iso
*.iso
*.bin
null.d
tools/opensbi/
tools/aarch64-unknown-linux-gnu*
2 changes: 1 addition & 1 deletion cmake/toolchain_linux_riscv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)
find_program(QEMU qemu-system-riscv64)
if (NOT QEMU)
message(FATAL_ERROR "qemu not found.\n"
"Please install qemu first.")
"Please install qemu-system-riscv64 first.")
else ()
message(STATUS "Found qemu ${QEMU}")
endif ()
2 changes: 1 addition & 1 deletion cmake/toolchain_linux_x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif ()
find_program(XORRISO xorriso)
if (NOT XORRISO)
message(FATAL_ERROR "xorriso not found.\n"
"Run `brew install xorriso` to install the toolchain")
"Run `sudo apt-get install -y xorriso` to install the toolchain")
else ()
message(STATUS "Found xorriso ${XORRISO}")
endif ()
Expand Down
8 changes: 0 additions & 8 deletions cmake/toolchain_mac_riscv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,3 @@ if (NOT QEMU)
else ()
message(STATUS "Found qemu ${QEMU}")
endif ()

# opensbi
# cd tools
# git clone https://github.com/riscv/opensbi.git
# cd opensbi
# export CROSS_COMPILE=riscv64-unknown-elf-
# make PLATFORM=generic clean
# make PLATFORM=generic FW_JUMP_ADDR=0x80200000
2 changes: 2 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ fi
if [ ${ARCH} == "riscv64" ]; then
# OPENSBI 不存在则编译
if [ ! -f ${OPENSBI} ]; then
echo build opensbi.
git submodule init
git submodule update
cd ./tools/opensbi
mkdir -p build
export CROSS_COMPILE=${TOOLCHAIN_PREFIX}
make PLATFORM=generic FW_JUMP_ADDR=0x80200000
cd ../..
echo build opensbi done.
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion tools/bochsrc_linux.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# This file is a part of Simple-XX/SimpleKernel (https://github.com/Simple-XX/SimpleKernel).
#
# bochsrc_mac.txt for Simple-XX/SimpleKernel
# bochsrc_linux.txt for Simple-XX/SimpleKernel

ata1-master: type=cdrom, path="simplekernel.iso", status=inserted
boot: cdrom
Expand Down
7 changes: 3 additions & 4 deletions tools/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ ARCH="riscv64"
# Use qeme for i386/x86_64, bochs for default
IA32_USE_QEMU=0

# Use for riscv64, compile opensbi
# for linux, use riscv64-linux-gnu-
TOOLCHAIN_PREFIX=riscv64-unknown-elf-

# 内核映像
kernel='./build/bin/kernel.elf'
iso_boot_grub='./iso/boot/grub'
Expand All @@ -35,7 +31,9 @@ if [ "${OS}" == "Linux" ]; then
TOOLS="toolchain_linux_aarch64.cmake"
elif [ "${ARCH}" == "riscv64" ]; then
TOOLS="toolchain_linux_riscv.cmake"
TOOLCHAIN_PREFIX=riscv64-linux-gnu-
fi
OPENSBI="$(pwd)/tools/opensbi/build/platform/generic/firmware/fw_jump.elf"
GRUB_PATH="$(dirname $(which grub-file))"
bochsrc="./tools/bochsrc_linux.txt"
elif [ "${OS}" == "Darwin" ]; then
Expand All @@ -45,6 +43,7 @@ elif [ "${OS}" == "Darwin" ]; then
TOOLS="toolchain_mac_aarch64.cmake"
elif [ "${ARCH}" == "riscv64" ]; then
TOOLS="toolchain_mac_riscv.cmake"
TOOLCHAIN_PREFIX=riscv64-unknown-elf-
fi
OPENSBI="$(pwd)/tools/opensbi/build/platform/generic/firmware/fw_jump.elf"
GRUB_PATH="$(pwd)/tools/grub-2.04/build/grub/bin"
Expand Down
1 change: 1 addition & 0 deletions tools/opensbi
Submodule opensbi added at f41196

0 comments on commit 9b463a6

Please sign in to comment.