mit-pdos / xv6-riscv

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

I was able to run xv6-x86 on my m1 mac running ubuntu arm64. Perform the following steps: #198

Open DRedDevil04 opened 10 months ago

DRedDevil04 commented 10 months ago
          I was able to run xv6-x86 on my m1 mac running ubuntu arm64. Perform the following steps:
  1. clone the xv6 from git
  2. Now you need to install a cross compiler: sudo apt install gcc-i686-linux-gnu
  3. Go to the directory and instead of make , type make TOLLPREFIX=i686-linux-gnu-
  4. Now, instead of make qemu-nox, type make TOLLPREFIX=i686-linux-gnu- qemu-nox
  5. Voilà!!

Originally posted by @Mazz84002 in https://github.com/mit-pdos/xv6-riscv/issues/76#issuecomment-1494996001

DRedDevil04 commented 10 months ago
          I was able to run xv6-x86 on my m1 mac running ubuntu arm64. Perform the following steps:
  1. clone the xv6 from git
  2. Now you need to install a cross compiler: sudo apt install gcc-i686-linux-gnu
  3. Go to the directory and instead of make , type make TOLLPREFIX=i686-linux-gnu-
  4. Now, instead of make qemu-nox, type make TOLLPREFIX=i686-linux-gnu- qemu-nox
  5. Voilà!!

Originally posted by @Mazz84002 in #76 (comment)

This solution leads to an error in the mpconfig file on my m1 mac: 14: mp.c:83:10: error: array subscript -48806446 is outside array bounds of ‘void[2147483647]’ [-Werror=array-bounds=] 83 | if(conf->version != 1 && conf->version != 4) | ~~^~~ mp.c:78:34: note: at offset -2147483648 into object ‘_119 = PHI <_86(14), _16(4), _63(6)>.physaddr’ of size [0, 2147483647] 78 | if((mp = mpsearch()) == 0 || mp->physaddr == 0) | ^~~~ mp.c:85:28: error: array subscript -48806446 is outside array bounds of ‘void[2147483647]’ [-Werror=array-bounds=] 85 | if(sum((uchar)conf, conf->length) != 0) . . . . . . "

Please provide a solution to this

fengxiaohu commented 5 months ago

it seems your physical memory run out