an x86 operating system project built using C 20
I develop XOS on an Arch machine, so I don't guarantee buildability for any of the other distributions (Debian, Ubuntu, etc.). The toolchain I currently use is GCC 10.2.0
Dependency | Arch package |
---|---|
Compiler | base-devel |
Make | base-devel |
Bison | base-devel |
Flex | base-devel |
GMP | gmp |
MPC | libmpc |
MPFR | mpfr |
Texinfo | base-devel |
pacman -Syu base-devel gmp libmpc mpfr
Download the newest Binutils and GCC and extract them wherever.
Set PREFIX
to the directory you want your toolchain installed into. If
the prefix is not a root directory, you don't need sudo for make install
commands.
export PREFIX="/usr/local/gcc/i686-elf"
export TARGET="i686-elf"
export PATH="$PREFIX/bin:$PATH"
binutils
is the source directory you extracted them to.
cd binutils
mkdir build
cd build
../configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
sudo make install
gcc
is the source directory you extracted them to.
cd gcc
mkdir build
cd build
../configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c --without-headers
make all-gcc
make all-target-libgcc
sudo make install-gcc
sudo make install-target-libgcc
The only way currently to get the sources is via the xos git repository. You can download a zip archive or use git.
git clone [email protected]:xgallom/xos.git
Set XOS_SYSROOT
to the directory you have installed your toolchain into.
cd xos
mkdir build
cd build
XOS_BUILD_TYPE=Release XOS_ARCH=i386 XOS_SYSROOT=/usr/local/gcc/i686-elf ../configure
Making a bootable iso requires GRUB v2 and xorriso.
# For building a multiboot executable
make xos
# For building an iso via grub-mkrescue
make build_image_root
qemu-system-i386 -kernel "./xos/xos"
qemu-system-i386 -cdrom "./xos.iso"
This software is licensed with the GPLv2, available in the attached LICENSE.md file.
Copyright (C) 2020 Milan Gallo