MQuy/mos

mOS in Ubuntu

sxmxr opened this issue · 34 comments

sxmxr commented

Hi @MQuy, I and my teammates have successfully installed GCC Cross-complier using that Wikipedia page which was mentioned in one of the earlier issues. (https://wiki.osdev.org/GCC_Cross-Compiler) I have installed i686-elf-gcc successfully(Screenshot-1) Now while installing the whole project, using the mentioned shell scripts in the read.me, I got error like, "./create_image.sh: line 6: hdiutil: command not found".(Screenshot 2). My host OS is Windows 10 and I'm using Ubuntu 20.04 within the virtual box.
Screenshot from 2020-10-21 15-15-24
Screenshot from 2020-10-24 15-31-48

MQuy commented

@sxmxr if you check out master branch and run like this I think it will work

$ cd src
$ ./create_image.sh
$ ./build qemu iso
MQuy commented

you shouldn't need to change anything, I changed create_image.sh to support ubuntu if you pull master.

To build toolchain

$ cd src
$ cd toolchain && ./build.sh

Run

$ cd src
$ ./create_image.sh
$ ./build.sh qemu iso
sxmxr commented

@MQuy Thank you for your response. ./create_image.sh was compiled successfully but while running "./build qemu iso" command I'm getting this error.
Screenshot from 2020-10-24 16-17-28

MQuy commented

can you send a screenshot if you run the command below

cd src/kernel && make clean && make
sxmxr commented

@MQuy I compiled that command and here what I got :
Screenshot from 2020-10-24 16-24-15

MQuy commented

hum, what is your ubuntu version? my guess is the latest gcc have breaking changes, could you try with gcc 9.x

sxmxr commented

hum, what is your ubuntu version? my guess is the latest gcc have breaking changes, could you try with gcc 9.x

@MQuy My ubuntu version is 20.04. So I have to make cross compiler again. Right?

MQuy commented

yes, try with gcc 9.x :)

sxmxr commented

yes, try with gcc 9.x :)

Thank you, for your response. I'll get back to you in case of any queries.

sxmxr commented

Screenshot from 2020-10-27 14-58-25
I have installed gcc 9.1 cross compiler and tried to build file in toolchain but I'm getting this error while running this command "cd toolchain && ./build.sh"

sxmxr commented

@MQuy Ubuntu isn't working for me. So I am thinking to install Mac-OS on VirtualBox and will run it. Is it possible?

MQuy commented

can you give more details about the error above? I think Ubuntu is better in long term

sxmxr commented

@MQuy Here are the steps I have followed, Please correct me if I'm wrong :

  1. Followed steps of https://wiki.osdev.org/GCC_Cross-Compiler and installed GCC 9.1.0 and Binutils 2.32, so basically activated new cross-compiler.
  2. Downloaded the source code of mOS and moved to src directory.
  3. Then I entered this command "$ cd toolchain && ./build.sh"
  4. After that I got the above error.
MQuy commented

could you try to open build.sh and modify these variables to fit in your case and run again?

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

@MQuy Thank you for your response. Just to confirm, according to this (https://wiki.osdev.org/GCC_Cross-Compiler) my target variable will be TARGET=i686-elf. Right? or do I have to change target to i386-mos?
P.S. I have changed the SYSROOT.

MQuy commented

No, only SYSROOT, make sure that folder exist

sxmxr commented

@MQuy Thank you for your help. ToolChain is compiled successfully. Now while compiling the "./create_image.sh" I'm getting this error.
Screenshot from 2020-10-29 00-19-04

MQuy commented

you should umount like this first

sudo umount /mnt/mos
sudo rm -rf /mnt/mos
sxmxr commented

you should umount like this first

sudo umount /mnt/mos
sudo rm -rf /mnt/mos

Yess.. I have
Screenshot from 2020-10-29 00-31-01
done the same but lead to this error :/

MQuy commented

can you comment this line from ./create_image.sh and run it again

# cd ports/figlet && ./package.sh && cd ../..
sxmxr commented

@MQuy Sorry for the inconvenience I have caused. But I'm totally new to these topics and my faculty has given a project to implement a new feature in existing features. I'm planning to implement SMP and 2 level paging.

MQuy commented

no np, feel free to ask, I will answer when I am online ;)

sxmxr commented

Screenshot from 2020-10-29 00-37-41
After compiling "cd ports/figlet && ./package.sh && cd ../.."

MQuy commented

did you remove that line? you don't need that program to run

sxmxr commented

Yes, I commented it.
And here is the results.

  1. After compiling "./create_image.sh"
    Screenshot from 2020-10-29 00-44-01

  2. After compiling "$ ./build.sh qemu iso"
    Screenshot from 2020-10-29 00-45-26

MQuy commented

you don't have logs folder

$ cd src && mkdir logs
sxmxr commented

@MQuy After creating it, I run that again and I got this screen.
Screenshot from 2020-10-29 00-48-33

MQuy commented

can you open another terminal

$ cd src && gdb isodir/boot/mos.bin
``
in that gdb, type c and enter
sxmxr commented

Screenshot from 2020-10-29 00-53-16
Here's the output

MQuy commented

ops, I forget it should be

target remote localhost:1234
c
sxmxr commented

Screenshot from 2020-10-29 00-55-24
Finallyyyyy!

sxmxr commented

So whenever I make changes, I have to run "$ ./build.sh qemu iso" , $ cd src && gdb isodir/boot/mos.bin, target remote localhost:1234, c" commands. Right?

MQuy commented

if you make changes to src/apps or src/libraries you have to run ./create_image.sh

sxmxr commented

Ohh, Okay. Thank you so much @MQuy for your quick responses. Now I'll analyze the whole project, and will try to implement the capstones for the project.