Skip to content

Commit

Permalink
pref(build): add submodel
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.N <[email protected]>
  • Loading branch information
MRNIU committed Jun 6, 2021
1 parent c8b5d1e commit fef4671
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ bochsout.txt
build
cmake-build-debug
cmake-build-debug_simplekernel
objconv-2.50.zip
objconv-2.50
grub-2.04.tar.xz
grub-2.04
tools/opensbi
iso
*.img
*.iso
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/opensbi"]
path = tools/opensbi
url = https://github.com/riscv/opensbi.git
15 changes: 15 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then
fi
fi

if [ ${ARCH} == "riscv64" ]; then
# 如果 tools/opensbi 不存在,则 pull
if [ ! -d "./tools/opensbi" ]; then
git submodule update
fi
# OPENSBI 不存在则编译
if [ ! -f ${OPENSBI} ]; then
cd ./tools/opensbi
mkdir -p build
export CROSS_COMPILE=riscv64-unknown-elf-
make PLATFORM=generic FW_JUMP_ADDR=0x80200000
cd ../..
fi
fi

# 检测路径是否合法,发生过 rm -rf -f /* 的惨剧
if [ "${iso_boot}" == "" ]; then
echo iso_boot path error.
Expand Down
4 changes: 2 additions & 2 deletions tools/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#!/bin/bash

# ARCH: i386, x86_64, arm, riscv64
ARCH="i386"
# ARCH="i386"
# ARCH="x86_64"
# ARCH="arm"
# ARCH="riscv64"
ARCH="riscv64"

# 内核映像
kernel='./build/bin/kernel.elf'
Expand Down
1 change: 1 addition & 0 deletions tools/opensbi
Submodule opensbi added at f41196

0 comments on commit fef4671

Please sign in to comment.