I am trying do mit6.828 lab on mac m1. After installed riscv-tool-chain
, I tried to run make qemu
which seems to be used start the kernel, but at first I got this error:
mkfs/mkfs fs.img README user/xargstest.sh user/_cat user/_echo user/_forktest user/_grep user/_init user/_kill user/_ln user/_ls user/_mkdir user/_rm user/_sh user/_stressfs user/_usertests user/_wc user/_zombie user/_cowtest user/_uthread user/_call user/_testsh user/_kalloctest user/_bcachetest user/_alloctest user/_bigfile
nmeta 46 (boot, super, log blocks 30 inode blocks 13, bitmap blocks 1) blocks 1954 total 2000
balloc: first 766 blocks have been allocated
balloc: write bitmap block at sector 45
qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 1 -nographic -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
Could not allocate dynamic translator buffer
make: *** [qemu] Error 1
So I clone the qemu reposiroty from the github to get the source code,and check the version to v5.1.0, then I apply the patch from this link pathch which is mentioned by this link
configure run as the belows:
./configure --disable-kvm --disable-werror --prefix=/usr/local --target-list="riscv64-softmmu"`
The make
and make install
seems work well, but when I execute make qemu
again in the lab, it appeared another error, I still not found how to solve this problem:
qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 3 -nographic -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
qemu-system-riscv64: qemu_mprotect__osdep: mprotect failed: Permission denied
**
ERROR:/Users/rezero/Desktop/6.828-note/qemus/qemu-5.1.0/tcg/tcg.c:733:tcg_region_init: assertion failed: (!rc)
Bail out! ERROR:/Users/rezero/Desktop/6.828-note/qemus/qemu-5.1.0/tcg/tcg.c:733:tcg_region_init: assertion failed: (!rc)
make: *** [qemu] Abort trap: 6