klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

Unable to build toaruos from source #247

Closed saksham1345 closed 1 year ago

saksham1345 commented 1 year ago

K Lange sir, I am using your toaruos, so I git clone your GitHub project but the problem here is that I am unable to build an image file using the source when I run your given commands then till step 3 it's ok but when I run the 4th and last command "docker run -v pwd:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:1.99.x util/build-in-docker.sh"

It's throws an error that "unable to find the file/folder specified : build-in-docker.sh"

And when i run "make -f Makefile" it throws "no rule to make target: Makefile"

When i use "cd build" and then when i run "make image.iso" then again it throws me the same error "no rule to make target: image.iso" And after this it throws something like this "process_begin: CreateProcess(NULL, , ...) failed. make (e=2): The system cannot find the file specified. make: *** [setup] Error 2"

Please K Lange sir help me to solve this problem.

And a very kind and humble request to you that please 🥺 can you make a video tutorial on how to build toaruos from source step by step.

Thanks in advance.

klange commented 1 year ago

process_begin: CreateProcess

Are you on Windows?

saksham1345 commented 1 year ago

Yes sir, I am using Windows 10

klange commented 1 year ago

I do not support building under Windows, but will give an explanation of why this doesn't work here. I recommend setting up a WSL2 instance and running the Docker command again in that.

The main problem you are experiencing is that this part of the docker command:

-v `pwd`:/root/misaka

... is supposed to map the current directory into the Docker container. But this is a Unix shell command, and you are trying to run it in Windows, presumably in PowerShell or something and I have no idea what directory it's actually mounting or if that works at all. Then Docker-for-Windows spins up a Linux VM and it doesn't have the code to build, so build-in-docker.sh is missing.

saksham1345 commented 1 year ago

I do not support building under Windows.

Sir, can you please try to make it supported for windows also, it would be a great help by the time I will try Wsl2

klange commented 1 year ago

A suggestion from StackOverflow is to add a leading / to that bind mount argument, something like -v "/${PWD}:/root/misaka" might work (or type out the full path), but may run into permissions or filesystem issues.

I do not provide support for (locally) building ToaruOS from source in general. The Docker container was built for CI builders to run builds automatically, and offers a one-off option for most users. For anyone interested in more involved development, setting up the toolchain is "left as an exercise for the reader" - most of it is "build gcc and binutils" which is a complicated, but "standard", process, and the rest is "install a bunch of other packages for the CD and UEFI parts of the build" which varies too much for me to provide helpful instructions (I can't even manage to keep track of the right package names on Debian/Ubuntu) - and I would strongly recommend against trying to do that on Windows anyway.

I question why anyone would be interested in some rando's boring hobby Unix clone OS and not already be running Linux or BSD themselves...

saksham1345 commented 1 year ago

rando's boring hobby Unix clone OS

It's not like that, your os is really good and you are also a very much skilled programmer i appreciate.

As you suggested to use wsl2 so I tried that one out so first it throws error standard_init_linux.go:228: exec user process caused: no such file or directory So I changed line ending from CRLF to LF then that error solved but after doing this it throws an error make: *** No rule to make traget 'base/lib/libc.so'. Stop.

As you told not to try in windows but the problem is I have no option other that this i haved to do solve it in windows only

klange commented 1 year ago

Please try the complete instructions in the README from within the WSL2 instance with docker.io installed, the docker daemon running, and with a user in the docker group. If you are using a Git checkout you cloned from Windows, it may be corrupted by Windows filesystem limitations.

I was able to successfully complete a build using these instructions under WSL2 with an Ubuntu installation - had to go dig my Surface out of my closet and get it charged and updated first, but wanted to be sure the things I'm telling you work.

saksham1345 commented 1 year ago

In readme WSL2 instance is not there.

klange commented 1 year ago

I am not sure what you mean.

saksham1345 commented 1 year ago

After thinking a lot I have finally decide to switch on Linux from windows but for that i want to know which one should I use Ubuntu/Debian for 4gb ram pc

klange commented 1 year ago

@saksham1345 Have you been able to complete a build under WSL? As I was able to do so reliably, I would like to close this ticket.