mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.52k stars 2.37k forks source link

Running the x86 version of xv6 #242

Open vincentabraham opened 1 month ago

vincentabraham commented 1 month ago

Greetings, I'm running the x86 version of xv6, found at https://github.com/mit-pdos/xv6-public on my Ubuntu 22.04.4 LTS system. While I was able to run it with CPUS > 1 earlier, right now it just runs with 1 CPU no matter the number of CPUS I specify to it. I did not make any changes in the source code and even tried it with a fresh clone of the repository. Could anyone please suggest some possible reasons for it?

Thanks, Vincent

pavi2410 commented 1 month ago

These lines set the number of cores using the CPUS variable

https://github.com/mit-pdos/xv6-public/blob/eeb7b415dbcb12cc362d0783e41c3d1f44066b17/Makefile#L219-L222

On searching for "qemu using only one core", I found that this could happen because the board QEMU is emulating doesn't support multiple cores OR that you are running QEMU inside a VM which restricts to one core.