mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
7.18k stars 2.66k forks source link

build fail #255

Open shyisme opened 2 months ago

shyisme commented 2 months ago

kernel/riscv.h:197: Error: unknown CSR menvcfg' kernel/riscv.h:204: Error: unknown CSRmenvcfg' kernel/riscv.h:189: Error: unknown CSR `stimecmp'

Donglin-SHI commented 2 months ago

I met the same issue here.

OS: Windows 11/WSL/Ubuntu 22.04.4 LTS

A quick workaround would be to revert below commit. 92e60dd8335b49e426760dbcbf1ef54c601f098e

I'm waiting for Ubuntu 24.04 for WSL, maybe then this issue will be fixed.

awasay905 commented 2 months ago

I faced the same issue using same Win 11 with Ubuntu 22.04.4 WSL , althought i did not install the riscv-gnu-toolchain for xv6. (i only ran this command 'sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu')

But using @Donglin-SHI solution made the qemu work.

Donglin-SHI commented 2 months ago

WSL/Ubuntu 24.04.1 LTS was published at 2024-08-30. After I upgraded Ubuntu to Win11/WSL/Ubuntu 24.04.1 LTS, this issue was solved.

TroyMitchell911 commented 1 month ago

Sometimes, WSL will encounter inexplicable errors