mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 12:16:31 +00:00
使得DragonOS kernel 能为riscv64编译通过(尚未能启动) (#457)
* 使得DragonOS kernel 能为riscv64编译通过(尚未能启动) * 修正了系统调用号声明不正确的问题,同时添加了编译配置文档
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
target remote localhost:1234
|
||||
file bin/kernel/kernel.elf
|
||||
set follow-fork-mode child
|
||||
set follow-fork-mode child
|
||||
|
@ -47,7 +47,7 @@ install_ubuntu_debian_pkg()
|
||||
lsb-release \
|
||||
llvm-dev libclang-dev clang gcc-multilib \
|
||||
gcc build-essential fdisk dosfstools dnsmasq bridge-utils iptables libssl-dev pkg-config \
|
||||
sphinx
|
||||
sphinx gcc-riscv64-unknown-elf
|
||||
|
||||
# 如果python3没有安装
|
||||
if [ -z "$(which python3)" ]; then
|
||||
@ -142,7 +142,7 @@ rustInstall() {
|
||||
echo "Rust 还未被安装"
|
||||
echo "请再次运行脚本,接受rustup安装"
|
||||
echo "或通过以下方式手动安装rustc(不推荐):"
|
||||
echo "curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly"
|
||||
echo "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly"
|
||||
exit
|
||||
else
|
||||
echo "是否为Rust换源为国内镜像源?(Tuna)"
|
||||
@ -162,11 +162,20 @@ rustInstall() {
|
||||
rustup toolchain install nightly-2023-08-15-x86_64-unknown-linux-gnu
|
||||
rustup component add rust-src --toolchain nightly-2023-01-21-x86_64-unknown-linux-gnu
|
||||
rustup component add rust-src --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu
|
||||
rustup component add rust-src
|
||||
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
rustup component add llvm-tools-preview
|
||||
rustup target add x86_64-unknown-none --toolchain nightly-2023-01-21-x86_64-unknown-linux-gnu
|
||||
rustup target add x86_64-unknown-none --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu
|
||||
|
||||
rustup toolchain install nightly-2023-01-21-riscv64gc-unknown-linux-gnu --force-non-host
|
||||
rustup toolchain install nightly-2023-08-15-riscv64gc-unknown-linux-gnu --force-non-host
|
||||
rustup target add riscv64gc-unknown-none-elf --toolchain nightly-2023-01-21-riscv64gc-unknown-linux-gnu
|
||||
rustup target add riscv64imac-unknown-none-elf --toolchain nightly-2023-01-21-riscv64gc-unknown-linux-gnu
|
||||
rustup target add riscv64gc-unknown-none-elf --toolchain nightly-2023-08-15-riscv64gc-unknown-linux-gnu
|
||||
rustup target add riscv64imac-unknown-none-elf --toolchain nightly-2023-08-15-riscv64gc-unknown-linux-gnu
|
||||
|
||||
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
rustup component add rust-src
|
||||
rustup component add llvm-tools-preview
|
||||
rustup default nightly
|
||||
|
||||
echo "Rust已经成功的在您的计算机上安装!请运行 source ~/.cargo/env 以使rust在当前窗口生效!"
|
||||
fi
|
||||
@ -265,7 +274,8 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
rustInstall # 安装rust
|
||||
# 安装rust
|
||||
rustInstall
|
||||
|
||||
|
||||
# 初始化DragonOS的musl交叉编译工具链
|
||||
|
@ -68,7 +68,7 @@ QEMU_MEMORY_BACKEND="dragonos-qemu-shm.ram"
|
||||
QEMU_MEMORY_BACKEND_PATH_PREFIX="/dev/shm"
|
||||
QEMU_SHM_OBJECT="-object memory-backend-file,size=${QEMU_MEMORY},id=${QEMU_MEMORY_BACKEND},mem-path=${QEMU_MEMORY_BACKEND_PATH_PREFIX}/${QEMU_MEMORY_BACKEND},share=on "
|
||||
QEMU_SMP="2,cores=2,threads=1,sockets=1"
|
||||
QEMU_MONITOR="stdio"
|
||||
QEMU_MONITOR="-monitor stdio"
|
||||
QEMU_TRACE="${qemu_trace_std}"
|
||||
QEMU_CPU_FEATURES=""
|
||||
QEMU_RTC_CLOCK=""
|
||||
@ -96,12 +96,17 @@ fi
|
||||
QEMU_DEVICES="-device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -netdev user,id=hostnet0,hostfwd=tcp::12580-:12580 -device virtio-net-pci,vectors=5,netdev=hostnet0,id=net0 -usb -device qemu-xhci,id=xhci,p2=8,p3=4 "
|
||||
# E1000E
|
||||
# QEMU_DEVICES="-device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -netdev user,id=hostnet0,hostfwd=tcp::12580-:12580 -net nic,model=e1000e,netdev=hostnet0,id=net0 -netdev user,id=hostnet1,hostfwd=tcp::12581-:12581 -device virtio-net-pci,vectors=5,netdev=hostnet1,id=net1 -usb -device qemu-xhci,id=xhci,p2=8,p3=4 "
|
||||
QEMU_ARGUMENT="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -smp ${QEMU_SMP} -boot order=d -monitor ${QEMU_MONITOR} -d ${qemu_trace_std} "
|
||||
QEMU_ARGUMENT="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -smp ${QEMU_SMP} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "
|
||||
|
||||
QEMU_ARGUMENT+="-s ${QEMU_MACHINE} ${QEMU_CPU_FEATURES} ${QEMU_RTC_CLOCK} ${QEMU_SERIAL} -drive ${QEMU_DRIVE} ${QEMU_DEVICES} --nographic"
|
||||
QEMU_ARGUMENT+="-s ${QEMU_MACHINE} ${QEMU_CPU_FEATURES} ${QEMU_RTC_CLOCK} ${QEMU_SERIAL} -drive ${QEMU_DRIVE} ${QEMU_DEVICES} "
|
||||
QEMU_ARGUMENT+=" ${QEMU_SHM_OBJECT} "
|
||||
QEMU_ARGUMENT+=" ${QEMU_ACCELARATE} "
|
||||
|
||||
# 如果是riscv64架构,就不需要图形界面
|
||||
if [ ${ARCH} == "riscv64" ]; then
|
||||
QEMU_ARGUMENT+=" -nographic "
|
||||
fi
|
||||
|
||||
# 安装riscv64的uboot
|
||||
install_riscv_uboot()
|
||||
{
|
||||
|
Reference in New Issue
Block a user