this is a simply operating system for learning and practice purpose nothing special should be waited from this.
Binutils GCC Make Grep Diffutils perl or Python asm nasm or gas vi, nano, vscode...
- download Binutils from their FTP website https://ftp.gnu.org/gnu/binutils/
- download GCC from their FTP website https://ftp.gnu.org/gnu/gcc/
debian, ubuntu base package manager.
sudo apt-get install bison flex libgmp3-dev libgmp-dev libmpc-dev libmpfr-dev texinfo libisl-dev
these variables are use alongside the compilation, the we can move wherever we want to move it.
export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install
for example im build 13.2.0
configure --prefix=$PREFIX --target=$TARGET --disable-nls --enable-languages=c,c++ --without-headers --enable-interwork --enable-multilib --with-gmp=/usr --with-mpc=/opt/local --with-mpfr=/opt/local
or
# this is the one I used to build the cross compiler in this example.
../gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
remember to use this always, unless you change the sample setup.
export TARGET=i686-elf
$HOME/opt/cross/bin/$TARGET-gcc --version
https://wiki.osdev.org/GCC_Cross-Compiler
https://wiki.osdev.org/Cross-Compiler_Successful_Builds
there would be a lot of things to do.
- try to run a simple boot loader. 1
run:
make install
if it is the first time you do it, edit the Grub.cfg file locate at /boot/grub/grub.cfg
locate the end timeout secuence.. and add the next entry, be carefully not delete something or create a backup...
#### Begin Annette.bin
menuentry 'AnnetteOS v0.0.1'{
multiboot /boot/annette.bin
boot
}
#### END EDITION OF ANNETTE.BIN