lutoma / xelix

💻⚙ Xelix is a hobby Unix-like kernel with GNU userland for x86
https://xelix.org
GNU General Public License v3.0
61 stars 6 forks source link

Errors while building the system after building toolchain. #94

Open JustVic opened 3 years ago

JustVic commented 3 years ago

if I make menuconfig after cloning repository and making toolchain when I get: "make: *** No rule to make target 'menuconfig'. Stop." If I call ./configure it gets me some warning or error: "sed: can't read src/lib/config.h: No such file or directory" After configure make menuconfig is working. But make command fails while trying building system with : "/bin/sh: 1: i786-pc-xelix-gcc: not found." If I try to build picotcp from picotcp directory it builds ok. After that if try to build system again I get another error: "i786-pc-xelix-objcopy: architecture -I unknown" Maybe it something with debian setting or something. Maybe I an not so familiar with this project but currently I was not able to quickly deal with the problems by myself.

lutoma commented 3 years ago

As for the i786-pc-xelix-gcc not found, does that binary exist in the toolchain/local/bin folder? Normally the makefile should automatically add that to your path, but can you try doing export PATH="/full/path/to/xelix/toolchain/local/bin:$PATH" before running the other commands?

You're right about the missing Makefile/menucofing target, I missed that while switching the Kconfig system in one of the last commits. The architecture -I unknown error is also related to that. I've made some changes to account for that.

Can you try running ./configure and make again with the PATH set and the latest changes from the repository?

Sorry for all the hassle, all this code is rarely compiled outside of my computer so there's lots of underlying assumptions in the build system that may no always be true.

JustVic commented 3 years ago

Ok. Thanks for helping. I trought I alredy tried it, but maybe I misstyped something. This time it works good with exprot full path to the PATH variable. It has built well. Next I try "make image" and I get: "Usage: util/build-image.sh ". It needs path to dir as a second parameter but in makefile writed : "util/build-image.sh xelix.qcow2". After correction it gives next error : "qemu-nbd: Failed to set NBD socket qemu-nbd: Disconnect client, due to: Failed to read request: Unexpected end-of-file before all bytes were read"

lutoma commented 3 years ago

Instead of building your own userland image, I would recommend just downloading the 0.3.0-alpha image which is identical to the current userland state of the git repository anyway. I've added some instructions to the docs yesterday that describe how you can use your compiled kernel with the existing image: https://xelix.org/compiling/#using-the-compiled-kernel

If you really want to build your own userland image, that should also be possible, but the entire process is very experimental and fiddly. You would have to start with

util/xpkg/xpkg -a -e gcc -e dialog -e fontconfig

You will probably have to install some Python dependencies (toposort package).

This will compile every package in the land/ directory for Xelix except for gcc/dialog/fontconfig (which are broken right now), and build a full system image in the xpkg-build/image directory. You can then transform that into a bootable qcow2 image with the build-image command you have already discovered. You will need to have grub, fdisk and the nbd kernel module installed:

sudo modprobe nbd
util/build-image.sh xpkg-build/image xelix.qcow2

If everything went well, you should then end up with a xelix.qcow2 image which you can run in QEMU:

qemu-system-i386 -accel kvm -vga qxl -m 1024 -cpu host -serial mon:stdio -device ac97 -drive file=xelix.qcow2,if=ide -netdev user,id=mnet0 -device virtio-net,netdev=mnet0