Skip to content
Krzysztof Jurkowski edited this page Nov 16, 2023 · 15 revisions

Make

The easiest way to make the file is though Make.

Just make sure you have all essential components (see Dependencies) and run simple command:

make -s floppy_image

Options

All make options are:

  • all - makes Floppy Disk image with all tools
  • floppy_image - makes Floppy Disk image without any tools
  • kernel - only makes kernel files
  • bootloader - only makes bootloader files
  • clean - cleans build folder (THIS WILL PERNAMENTLY DELETE ALL FILES FROM build FOLDER)
  • always - makes working environment (creates folders)
  • tools_fat - makes tools related to FAT filesystem

Dependencies

Please use any Debian/Ubuntu based linux (you can use WSL if you're on Windows)

You will need:

  • Make (part of build-essential)
  • GCC for compiling tools from C (.c & .h) (part of build-essential)
  • NASM for all assembly files (.asm & .inc)
  • mtools for manipulating .img file
  • projectOS toolchain is a special set of tools for compiling C (.c & .h)

Dependency install command

apt install build-essential nasm mtools -y

Toolchain

projectOS toolchain is a special set of tools, compilers, headers and utilities that allow compiling C (.c & .h) and making .bin files targeting i686-elf with full support for projectOS

Tools:

  • Binutils
    • using version: 2.41
    • additional settings:
      • with-sysroot
      • disable-nls
  • GCC Cross Compiler for projectOS
    • using version: 13.2.0
    • languages: C,C++
    • additional settings:
      • disable-nls
      • without-headers

Toolchain deploy command

Just run (it may take some time):

apt build-dep gcc-12 -y
make toolchain

If it isn't your first-time deploying run this before above:

make clean-toolchain

And if you used manual deployment please run this instead:

make clean-toolchain-all
apt remove build-essential -y
apt build-dep gcc-12 -y
apt autoremove -y
make toolchain

Toolchain deployment helpdesk

If you encounter any errors during deploying projectOS toolchain follow these steps:

  1. Install build-essential package and check what versions of tools have native support for your OS.
apt install build-essential wget -y
gcc --version
ld --version
  1. Change BINUTILS_VERSION & GCC_VERSION in build_scripts/config.mk for these versions.

  2. Cleanup after your previous attempt, install dependencies for install, and finally make you toolchain.

make clean-toolchain-all
apt remove build-essential -y
apt build-dep gcc-10 -y
apt autoremove -y
make toolchain

If it doesn't work, you can try manual installation.

Toolchain manual installation (without script)

Please remember to change {} brackets into what they ask you (it may take some time)

mkdir toolchain
cd toolchain
apt install build-essential wget -y
apt build-dep gcc-12 -y
wget {GCC link}
wget {BINUTILS link}
tar -xf {GCC tar.gz}
tar -xf {BINUTILS tar.gz}
mkdir binutils-build
cd binutils-build
../{BINUTILS folder name}/configure --target=i686-elf --prefix="{absolute path to toolchain}/i686-elf" --with-sysroot --disable-nls --disable-werror
make -j 8
make install
cd ..
mkdir gcc-build
cd gcc-build
../{GCC folder name}/configure --target=i686-elf --prefix="{absolute path to toolchain}/i686-elf" --disable-nls --enable-languages=c,c++ --without-headers --disable-werror
make -j8 all-gcc
make -j8 all-target-libgcc
make install-gcc
make install-target-libgcc

If you've deployed toolchain previously, please run this command before:

rm -rf toolchain
apt remove build-essential -y
apt autoremove -y

Clone this wiki locally