From 10e9348d798d9a683c966480faca00cabc531dd5 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 21 Dec 2025 16:48:51 -0500 Subject: initial commit Signed-off-by: Ian Moffett --- host/bootstrap | 17 +++++++++++++++++ host/iso-limine | 24 ++++++++++++++++++++++++ host/toolchain | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100755 host/bootstrap create mode 100755 host/iso-limine create mode 100755 host/toolchain (limited to 'host') diff --git a/host/bootstrap b/host/bootstrap new file mode 100755 index 0000000..511b88c --- /dev/null +++ b/host/bootstrap @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +mkdir -p var/ +mkdir -p var/root/usr/include/ + +if [[ ! -d var/cc/toolchain ]] +then + git clone https://github.com/sigsegv7/osmora-toolchain var/cc/toolchain +fi + +if [[ ! -d mos/boot ]] +then + git clone https://github.com/limine-bootloader/limine.git --branch=v9.3.0-binary --depth=1 mos/boot/limine/ + make -C mos/boot/limine +fi diff --git a/host/iso-limine b/host/iso-limine new file mode 100755 index 0000000..3d3caa1 --- /dev/null +++ b/host/iso-limine @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +ISO=live-mos.iso + +mkdir -p iso_root/boot/ + +# Copy the kernel to the ISO root +cp mos/sys/sys.mos iso_root/boot + +# Copy boot files +cp admin/conf/limine.conf mos/boot/limine/limine-bios.sys \ + mos/boot/limine/limine-bios-cd.bin \ + mos/boot/limine/limine-uefi-cd.bin \ + iso_root/ + +# Generate the ISO +xorriso -as mkisofs -b limine-bios-cd.bin -no-emul-boot -boot-load-size 4 \ + -boot-info-table --efi-boot limine-uefi-cd.bin -efi-boot-part \ + --efi-boot-image --protective-msdos-label iso_root/ -o $ISO 1>/dev/null + +mos/boot/limine/limine bios-install $ISO 1>/dev/null +rm -rf iso_root diff --git a/host/toolchain b/host/toolchain new file mode 100755 index 0000000..23756e6 --- /dev/null +++ b/host/toolchain @@ -0,0 +1,33 @@ +#!/bin/bash + +TARGET=x86_64-pc-osmora +MAKE=make + +# Don't build again if the lock exists +if [[ -f cc/.lock ]] +then + echo "cc/.lock exists, skipping toolchain build" + exit 1 +fi + +# Build binutils and patch gcc +cd var/cc/toolchain/ +bash build.sh + +# Prep the build directory +cd ../ +mkdir -p gcc +cd gcc/ + +# Configure gcc +../toolchain/gcc-patched/configure --target=$TARGET \ + --prefix=$(pwd) --with-sysroot=$(pwd)/../../root/ \ + --disable-nls --enable-languages=c --disable-multilib + +# Build gcc +$MAKE all-gcc +$MAKE install-gcc + +# Lock the directory +cd ../ +touch .lock -- cgit v1.2.3