当前位置:网站首页>RISCV64
RISCV64
2022-07-07 16:49:00 【InfoQ】
安装 Linux Lab
# 使用普通用户下载 Cloud Lab,然后再选择 linux-lab 仓库:
git clone https://gitee.com/tinylab/cloud-lab.git
cd cloud-lab/
# 启动 Linux Lab 并根据控制台上打印的用户名和密码登录实验环境
tools/docker/run linux-lab
安装 qemu-system-riscv64
export QEMU_VERSION=5.0.0
wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz
tar xvJf qemu-${QEMU_VERSION}.tar.xz
cd qemu-${QEMU_VERSION}
./configure --target-list=riscv64-softmmu --prefix=/opt/qemu
make -j $(nproc)
sudo make install
sudo apt-get install libglib2.0-dev
sudo apt-get install libpixman-1-dev
下载最新的 Linux 源码
wget -c https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.18.9.tar.gz
tar xvf linux-5.18.9.tar.gz
cd linux-5.18.9
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- defconfig
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- -j $(nproc)
下载最新的 BusyBox
wget -c https://www.busybox.net/downloads/busybox-1.35.0.tar.bz2
tar xvf busybox-1.35.0.tar.bz2
cd busybox-1.35.0
cd busybox
CROSS_COMPILE=riscv64-linux-gnu- make defconfig
CROSS_COMPILE=riscv64-linux-gnu- make -j $(nproc)
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- install
制作 rootfs
cd _install
mkdir proc sys dev etc etc/init.d
ls
# bin dev etc linuxrc proc sbin sys usr
sudo mknod dev/console c 5 1
sudo mknod dev/ram b 1 0
cat etc/init.d/rcS
etc/init.d/rcS
#!bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
/sbin/mdev -s
chmod +x etc/init.d/rcS
find -print0 | cpio -0oH newc | gzip -9 > ../rootfs.img
运行
/opt/qemu/bin/qemu-system-riscv64 \
-nographic -machine virt \
-kernel linux-5.18.9/arch/riscv/boot/Image \
-initrd busybox-1.35.0/rootfs.img \
-bios fw_jump.elf \
-append "root=/dev/ram rdinit=/sbin/init"

uname

参考
边栏推荐
- [论文分享] Where’s Crypto?
- 『HarmonyOS』DevEco的下载安装与开发环境搭建
- Yearning-SQL审核平台
- A few simple steps to teach you how to see the K-line diagram
- debian10编译安装mysql
- gsap动画库
- 小程序中实现付款功能
- Performance test process and plan
- [Tawang methodology] Tawang 3W consumption strategy - U & a research method
- Classification of regression tests
猜你喜欢
socket编程之常用api介绍与socket、select、poll、epoll高并发服务器模型代码实现
Kirk Borne的本周学习资源精选【点击标题直接下载】
Thread pool and singleton mode and file operation
学习open62541 --- [67] 添加自定义Enum并显示名字
Backup Alibaba cloud instance OSS browser
go语言的字符串类型、常量类型和容器类型
How to clean when win11 C disk is full? Win11 method of cleaning C disk
Disk storage chain B-tree and b+ tree
单臂路由和三层交换的简单配置
More than 10000 units were offline within ten days of listing, and the strength of Auchan Z6 products was highly praised
随机推荐
财富证券证券怎么开户?通过链接办理股票开户安全吗
Standard ACL and extended ACL
Redis的发布与订阅
Hash, bitmap and bloom filter for mass data De duplication
Introduction of common API for socket programming and code implementation of socket, select, poll, epoll high concurrency server model
[trusted computing] Lesson 12: TPM authorization and conversation
[trusted computing] Lesson 10: TPM password resource management (II)
Disk storage chain B-tree and b+ tree
2022年理财产品的一般收益率是多少?
Tips for this week 140: constants: safety idioms
[principles and technologies of network attack and Defense] Chapter 5: denial of service attack
[network attack and defense principle and technology] Chapter 4: network scanning technology
Reinforcement learning - learning notes 8 | Q-learning
Yearning-SQL审核平台
PIP related commands
Is it safe to open an online futures account now? How many regular futures companies are there in China?
Live broadcast software construction, canvas Text Bold
Skills of embedded C language program debugging and macro use
String type, constant type and container type of go language
直播软件搭建,canvas文字加粗