Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ build: clean defconfig all

qemu-run:
qemu-system-riscv64 -m 128M -serial mon:stdio -bios $(SBI) -nographic -machine virt -nographic -machine virt -device virtio-blk-pci,drive=disk0 -drive id=disk0,if=none,format=raw,file=$(DISK)

qemu-run-ramdisknotload:
qemu-system-riscv64 -m 128M -serial mon:stdio -bios $(SBI) -nographic -machine virt -nographic -machine virt -device virtio-blk-pci,drive=disk0 -drive id=disk0,if=none,format=raw,file=$(DISK) -device loader,file=$(RAMDISK_CPIO),addr=0x84000000
19 changes: 19 additions & 0 deletions configs/platforms/riscv64-qemu-virt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,22 @@ timer-frequency = 10_000_000 # uint
# };
# RTC (goldfish) Address
rtc-paddr = 0x10_1000 # uint

#
# Boot configs
#
[boot]
# Whether to use ramdisk
# If ramdisk has already been configured in dtb and no assistance from ArceBoot is needed, please set it to false
# If ArceBoot needs to boot from ramdisk, please set it to true if the next stage boot file that complies with the UEFI standard is saved in ramdisk
use-ramdisk = true
# Does this program need to load the ramdisk
# If the ramdisk file is located in the storage medium and needs to be loaded into memory by Arceboot, set it to true
load-ramdisk = true
# Ramdisk file path, If 'use-ramdisk & load-ramdisk' is false, this item will not be enabled
ramdisk-file = "/ramdisk.cpio"
# Ramdisk location
# If 'use-ramdisk & load-ramdisk' is true, Arceboot will load ramdisk to memory(The address of load is random)
# If 'load-ramdisk' is false, Arceboot will read ramdisk from [ramdisk-start, ramdisk-start + ramdisk-size]
ramdisk-start = 0x84000000
ramdisk-size = 0x400
4 changes: 4 additions & 0 deletions scripts/test/disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ print_info() {
printf "\033[36m%s\033[0m\n" "$1"
}

print_info "开始创建 ramdisk 文件"
bash scripts/test/ramdisk_cpio.sh

print_info "开始执行 virtio-block 类型的 disk 创建脚本"
print_info "此为 FAT32 文件系统镜像, 只含有一个 arceboot.txt 文件, 用于测试 Arceboot"
print_info "即将在当前目录执行创建 -------->"
Expand All @@ -18,6 +21,7 @@ mkdir temp
sudo mount -o loop disk.img temp
sudo mkdir -p temp/test
sudo touch temp/test/arceboot.txt
sudo cp ramdisk.cpio temp
echo "This is a test file for Arceboot." | sudo tee temp/test/arceboot.txt > /dev/null
sudo umount temp
rm -rf temp
Expand Down
Loading