1

I've been trying to install xv6 on my macOSX through terminal. I used the command brew install qemu to install qemu and have hit the codes:

sudo port install i386-elf-gcc

and after modifying the Makefile from i386-jos-elf to i386-elf- I'm receiving the following message on trying to run xv6 when I hit the code:

cd xv6-public 
make

the following message:

Error: Couldn't find an i386--elf version of GCC/binutils. Is the directory with i386-jos-elf-gcc in your PATH? If your i386--elf toolchain is installed with a command prefix other than 'i386-jos-elf-', set your TOOLPREFIX environment variable to that prefix and run 'make' again. To turn off this error, run 'gmake TOOLPREFIX= ...'.

gcc -m32 -gdwarf-2 -Wa,-divide -c -o usys.o usys.S

Any help would be greatly appreciated.

Ken White
  • 123,280
  • 14
  • 225
  • 444
LeoWan
  • 23
  • 6

2 Answers2

1

Maybe the xv6 version you downloaded is out of date. I also encountered this problem today. After updating to the latest version, it can be successfully compiled. The version downloaded with this command seems to be more advanced.

git clone git://github.com/mit-pdos/xv6-riscv-fall19.git

You can try this tutorial. I succeeded by his method today. This is the tutorial but written in Chinese

1278132270
  • 11
  • 1
1
  • Installing pre-requisite libraries

    brew install python3 gawk gnu-sed gmp mpfr libmpc isl zlib expat
    
  • Installing the RISC-V GNU toolchain

    brew tap riscv/riscv
    brew install riscv-tools
    path=(/usr/local/opt/riscv-gnu-toolchain/bin ${path})
    
  • Installing QEMU

    brew install qemu
    
  • Installing xv6

    git clone --depth 1 --single-branch \
        https://github.com/mit-pdos/xv6-riscv.git \
        ./xv6
    
  • Running xv6:

    cd ./xv6
    make qemu
    
chahu418
  • 327
  • 3
  • 8