我在QEMU https://wiki.qemu.org/Documentation/Platforms/Nios2中发现,我从他们的网站下载了英特尔工具链:工具包/dev-kit/altera/kit-niosii-2s60.html,我有几个问题:
基本上,我没有找到任何关于如何在QEMU中使用NIOS2的文档/示例。你能帮我提供一些额外的信息吗?即使是一些基本的“hello将”(在QEMU中编译和运行)也是很棒的…。
发布于 2021-04-02 15:34:24
更新:对这个问题最最新的答案可能是分析console.py#L1029上的linux控制台nios测试(当然也可以与维护人员联系)。2018年日历第14天的内核图像运行得很好。看起来这一切都可以用buildroot来完成。
我的评论开始结出硕果,所以我会尽量把部分的答案放在一起。我还没有让它发挥作用,但也许这会对其他可能工作更远的人有所帮助。
注意:如果您只想运行一个nios2二进制文件,可以直接将它传递给qemu-nios2。qemu-system-nios2用于运行linux。
# set up a toolchain (note: this old step is redundant with buildroot, lower down, which also installs a toolchain and even builds a kernel if asked)
wget https://toolchains.bootlin.com/downloads/releases/toolchains/nios2/tarballs/nios2--glibc--stable-2020.08-1.tar.bz2
tar -jxvf nios2--glibc--stable-2020.08-1.tar.bz2
# get kernel sources (pass --depth 1 to speed up)
git clone https://github.com/altera-opensource/linux-socfpga.git
# build kernel and device tree
cd linux-socfpga
make ARCH=nios2 CROSS_COMPILE=$(pwd)/../nios2--glibc--stable-2020.08-1/bin/nios2-linux- 10m50_defconfig 10m50_devboard.dtb vmlinux -j5
cd ..
# kernel is now at linux-socfpga/vmlinux
# device tree is now at linux-socfpga/arch/nios2/boot/dts/10m50_devboard.dtb
# set up buildroot to build a root image
git clone https://github.com/buildroot/buildroot.git
cd buildroot
# configure for qemu nios2
make qemu_nios2_10m50_defconfig
# build root image
PERL_MM_OPT= LDFLAGS= CPPFLAGS= LD_LIBRARY_PATH= make
cd ..
# rootfs images are now in buildroot/output/images/qemu-system-nios2 -M <machine> -kernel <kernel file> -dtb <dtb file> <rootfs image file>。示例机器是我们为上面构建的内核的10m50-ghrd,这可能是唯一的一台。https://stackoverflow.com/questions/66478025
复制相似问题