/gw-kernel

GNUWeeb Kernel - This is not yet a mother of any operating system

Primary LanguageAssemblyGNU General Public License v2.0GPL-2.0

GNU/Weeb kernel
============

This is not yet a mother of any operating system. Under development.

The target arch is i686.

Assuming you're working from x86-64 environment, you will need a cross
compiler to work with, below are the setup instructions.

[Setup Instructions]
------------------------------------------------
# Install dependencies.
sudo apt-get install build-essential bison flex libgmp3-dev git \
libmpc-dev libmpfr-dev texinfo libisl-dev make nasm \
qemu-system-x86 -y;

# Clone the repository.
git clone https://github.com/GNUWeeb/gw-kernel;

# Create build dir and change working dir to it.
mkdir -pv gw-kernel/build;
cd gw-kernel/build;

# Download binutils.
wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz;

# Download GCC.
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-11.2.0/gcc-11.2.0.tar.xz;

# Extract downloaded files.
tar -xf binutils-2.37.tar.xz;
tar -xf gcc-11.2.0.tar.xz;

# Set several env vars.
# Make sure you are working in 'build' directory when using $PWD.
export PREFIX="$PWD/opt/cross";
export TARGET=i686-elf;
export PATH="$PREFIX/bin:$PATH";

# Build binutils.
mkdir -pv build-binutils;
cd build-binutils;
../binutils-2.37/configure --target=$TARGET --prefix="$PREFIX" \
  --with-sysroot --disable-nls --disable-werror;
make -j$(nproc) && \
make -j$(nproc) install;

# Back to 'build' directory.
cd ..;

# Build GCC.
mkdir -pv build-gcc;
cd build-gcc;
../gcc-11.2.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers;
make -j4 all-gcc && \
make -j4 all-target-libgcc && \
make -j4 install-gcc && \
make -j4 install-target-libgcc;

# Back to root project directory.
cd ../..;

# Build the kernel.
make;

# Boot the kernel under QEMU.
make boot;
------------------------------------------------

Maintainer:
  - Ammar Faizi <ammarfaizi2@gnuweeb.org>