基于archlinux完成jserv/mini-arm-os编译环境搭建
安装python2
yay -S python2-bin
安装arm工具链
gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
编译qemu
# wget https://github.com/beckus/qemu_stm32/archive/refs/tags/stm32_v0.1.3.tar.gz
./configure --python=/usr/bin/python2 --disable-libnfs --disable-werror --enable-debug --target-list="arm-softmmu" --extra-cflags=-DSTM32_UART_NO_BAUD_DELAY --extra-cflags=-DSTM32_UART_ENABLE_OVERRUN --disable-gtk --prefix=$HOME/.usr/qemu-stm32
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 5861a5b..7c6e9c7 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -20,6 +20,7 @@
#include "virtio-9p-coth.h"
#include "trace.h"
#include "migration/migration.h"
+#include <sys/sysmacros.h>
int open_fd_hw;
int total_open_fd;
make install
验证
(master) ~/workspace/git/mini-arm-os/01-HelloWorld ✘ cat /proc/version
Linux version 7.0.13-arch1-1 (linux@archlinux) (gcc (GCC) 16.1.1 20260430, GNU ld (GNU Binutils) 2.46.0) #1 SMP PREEMPT_DYNAMIC Tue, 23 Jun 2026 11:14:21 +0000
(master) ~/workspace/git/mini-arm-os/01-HelloWorld ✘ make qemu
arm-none-eabi-gcc -fno-common -ffreestanding -O0 -gdwarf-2 -g3 -Wall -Werror -mcpu=cortex-m3 -mthumb -Wl,-Thello.ld -nostartfiles hello.c startup.c -o hello.elf
arm-none-eabi-objcopy -Obinary hello.elf hello.bin
arm-none-eabi-objdump -S hello.elf > hello.list
(process:146606): GLib-WARNING **: 14:55:55.407: ../glib/glib/gmem.c:579: custom memory allocation vtable not supported
Press Ctrl-A and then X to exit QEMU
qemu-system-arm -M stm32-p103 -nographic -kernel hello.bin
(process:146610): GLib-WARNING **: 14:55:55.428: ../glib/glib/gmem.c:579: custom memory allocation vtable not supported
LED Off
Hello World!
QEMU: Terminated
(master) ~/workspace/git/mini-arm-os/01-HelloWorld ✘

浙公网安备 33010602011771号