xv6 icon indicating copy to clipboard operation
xv6 copied to clipboard

xv6 won't boot on MacOS qemu?

Open anta40 opened this issue 3 years ago • 0 comments

I'm building xv6 on MacOS Big Sur with x86_64-elf-gcc installed:

$ x86_64-elf-gcc --version x86_64-elf-gcc (GCC) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Running make (after editing the Makefile: changed TOOLPREFIX="" to TOOLPREFIX=x86_64-elf-gcc-) yields this error:

x86_64-elf-gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -O -o out/bootmain.o -c kernel/bootmain.c x86_64-elf-gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -o out/bootasm.o -c kernel/bootasm.S x86_64-elf-ld -m elf_i386 -nodefaultlibs -N -e start -Ttext 0x7C00 -o out/bootblock.o out/bootasm.o out/bootmain.o x86_64-elf-ld: Error: unable to disambiguate: -nodefaultlibs (did you mean --nodefaultlibs ?) make: *** [out/bootblock] Error 1

So I did some modifications on Makefile. Then after running make, I got a xv6.img and fs.img The problem is after running make qemu, xv6 won't boot. qemu stuck at print "Booting from hard disk...", and nothing happens after that. On the other side, the original xv6 can be build and works fine on Linux and MacOS.

anta40 avatar Oct 12 '22 20:10 anta40