MQuy / mos

A hobby operating system developed from scratch
MIT License
365 stars 28 forks source link

/bin/bash is not exist #7

Closed sxmxr closed 3 years ago

sxmxr commented 3 years ago

I have installed the recent version of the mOS. It is showing this error. "/bin/bash is not exist". Is it in the development? image

MQuy commented 3 years ago

ah, I forget to note, you have to do following steps

cd src/ports/bash
./package.sh
cd src/ports/coreutils
./package.sh
sxmxr commented 3 years ago

After running this command, I got this: image

sxmxr commented 3 years ago

After running this command, I got this: image

P.S.: I have already activated the cross-compiler

MQuy commented 3 years ago

I think you have to rename the cross-compiler in package.sh to your version

sxmxr commented 3 years ago

While compiling this: cd src/ports/coreutils ./package.sh I don't know but somehow I'm getting this error. I think program isn't able to enter in the "if" image

sxmxr commented 3 years ago

While compiling this: cd src/ports/coreutils ./package.sh I don't know but somehow I'm getting this error. I think program isn't able to enter in the "if" image

I have renamed the cross-compiler to i386-mos

MQuy commented 3 years ago

can you run this echo $HOME in your terminal to check the output? try removing $HOME/coreutils-8.1 🤔

sxmxr commented 3 years ago

image Here it is.

sxmxr commented 3 years ago

I think I should change the path of this directory: COREUTILS_DIR to Current working directory?

MQuy commented 3 years ago

no, it has to be outside of mos, can you try removing that folder $HOME/coreutils-8.1 and run ./package

sxmxr commented 3 years ago

no, it has to be outside of mos, can you try removing that folder $HOME/coreutils-8.1 and run ./package

I have done the same and got 2 errors :/ --> image

MQuy commented 3 years ago

seem like you use the wrong cross-compiler tool, can you paste tool name here?

sxmxr commented 3 years ago

seem like you use the wrong cross-compiler tool, can you paste tool name here?

Sorry, I don't know. How can I find the tool name?

sxmxr commented 3 years ago

seem like you use the wrong cross-compiler tool, can you paste tool name here?

Sorry, I don't know. How can I find the tool name? Here's the cross-compiler version, I have been using image

sxmxr commented 3 years ago

Here is the SS of package.sh

image

MQuy commented 3 years ago

you have to use i386-mos-gcc, I think you already installed src/toolchain/build.sh, right?

sxmxr commented 3 years ago

you have to use i386-mos-gcc, I think you already installed src/toolchain/build.sh, right?

Yes yes, I have already installed but the target variable is i386-mos

sxmxr commented 3 years ago

you have to use i386-mos-gcc, I think you already installed src/toolchain/build.sh, right?

Yes yes, I have already installed but the target variable is i386-mos

image

sxmxr commented 3 years ago

Here is the SS of package.sh

image

so, Where should I have to make changes in this package.sh file?

MQuy commented 3 years ago

could be the issue with naming of cross compiler in src/toolchain/build.sh, can you try changing TARGET=i386-mos -> TARGET=i386-pc-mos and running it again together without changing anything in package.sh

sxmxr commented 3 years ago

could be the issue with naming of cross compiler in src/toolchain/build.sh, can you try changing TARGET=i386-mos -> TARGET=i386-pc-mos and running it again together without changing anything in package.sh

I have successfully executed both the commands but it's still showing the same error: image

sxmxr commented 3 years ago

could be the issue with naming of cross compiler in src/toolchain/build.sh, can you try changing TARGET=i386-mos -> TARGET=i386-pc-mos and running it again together without changing anything in package.sh

I have successfully executed both the commands but it's still showing the same error: image These 2 are successfully executed and also ./build.sh from src folder along with ./create_image.sh cd src/ports/bash ./package.sh cd src/ports/coreutils ./package.sh

MQuy commented 3 years ago

can you check

cd src
debugfs hdd.img # enter new flow
cd bin
ls
sxmxr commented 3 years ago

It is showing this image

MQuy commented 3 years ago

there is no bash there, something is wrong. when doing cd src/ports/bash && ./package, is there any error logs

sxmxr commented 3 years ago

Actually I didn't received any error. If you want to look at the output of the above command: terminal output.txt

sxmxr commented 3 years ago

Actually I didn't received any error. If you want to look at the output of the above command: terminal output.txt

@MQuy I have installed the cross-compiler using this target variable export TARGET=i686-elf In the toolchain, ./build.sh has a target variable : i386-pc-mos Is this a mistake here? or it's fine?

MQuy commented 3 years ago

Looking at your logs, I cannot spot any issues there. They should use different toolchain. What are your variables

PREFIX="$HOME/opt/cross"
TARGET=i386-mos
# SYSROOT cannot locate inside PREFIX
SYSROOT="$HOME/Projects/mos/src/toolchain/sysroot" 
JOBCOUNT=$(nproc)

can you try commenting them out and do it again?

sxmxr commented 3 years ago

@MQuy
These are my variables --> PREFIX="$HOME/opt/cross" TARGET=i386-pc-mos SYSROOT="/home/sxmxr/OS_Project/mos/src/toolchain/sysroot" JOBCOUNT=$(nproc)

sxmxr commented 3 years ago

could be the issue with naming of cross compiler in src/toolchain/build.sh, can you try changing TARGET=i386-mos -> TARGET=i386-pc-mos and running it again together without changing anything in package.sh

after following this, I had changed the target variable.

MQuy commented 3 years ago

let remove those variables and run it again to see what happen 🤔

sxmxr commented 3 years ago

It is showing this. image image

MQuy commented 3 years ago

no, not compiling toolchain, commenting out only for running for bash and coreutils

sxmxr commented 3 years ago

no, not compiling toolchain, commenting out only for running for bash and coreutils

Sorry, @MQuy but can you please suggest which line I have to comment and in which file. I'm lit bit confused.

MQuy commented 3 years ago

My suggested follow is like below

  1. revert env variables back
  2. compile toolchain
  3. comment en variables
  4. cd src/ports/bash && ./package.sh
  5. cd src/ports/coreutils && ./package.sh
sxmxr commented 3 years ago

My suggested follow is like below

  1. revert env variables back
  2. compile toolchain
  3. comment en variables
  4. cd src/ports/bash && ./package.sh
  5. cd src/ports/coreutils && ./package.sh

ohh okayy Got it. I'm on it.

sxmxr commented 3 years ago

@MQuy I have done the same and didn't get any errors. Should I run ./create_image.sh & ./build.sh?

MQuy commented 3 years ago

ah, could be the issue of order

  1. cd src
  2. ./create_image.sh
  3. cd src/ports/bash && ./package.sh
  4. cd src/ports/coreutils && ./package.sh
  5. ./build.sh qemu iso
sxmxr commented 3 years ago

Yesss Now, it working completely perfectt. Capture23

MQuy commented 3 years ago

could you create a pr to update README.md :D

sxmxr commented 3 years ago

I just had one query that in the older version of the mOS, image Here there were few folders of commands like uname, pwd, ls commands. I'm unable to find the location of the commands in the newer version.

MQuy commented 3 years ago

they are part of coreutils, more details https://github.com/coreutils/coreutils

sxmxr commented 3 years ago

Oh Okayy Thank you. :) Sure I'll create a PR to update README.md by tonight :D