build
there are two possiblity :
- you are building Stanix on itself (self building)
- you are building Stanix form another OS (eg linux/gnu or any other unix like OS) (cross building)
[!NOTE] if building from window use WSL
cross building
if you are building from another OS you will first have to make a cross toolchain
required sofware
gitgccor any c compilercoreutilsMPC(libmpc-dev)GMP(libgmp-dev)MPFR(libmpfr-dev)bisonflextexinfoautomakeautoconf(2.72 or change version in the script)- a shell (sh,bash,dash,ksh,…)
make
on ubuntu you can get everything by running
sudo apt install build-essential bison flex texinfo libmpc-dev libgmp-dev libmpfr-dev automake autoconf
cloning
first clone the repo
git clone https://github.com/tayoky/stanix --recurse
cd stanix
building cross toolchain
then you can run the script to build the toolchain
./build-toochain.sh --target=x86_64-stanix
[!NOTE]
do./build-toolchain.sh --help
for a full list of the options
[!NOTE]
supported values for--targetarex86_64-stanix,i386-stanixandaarch64-stanix
[!NOTE] compiling the toolchain (that contain gcc) might takes some time
now source the script to setup the PATH, CC, … variables
. ./add-to-path.sh
[!NOTE]
you will have to do this step every time you quit your sessions and come back (or open/close a new terminal window)
once you have done this step the default C compiler for this session is a stanix cross compiler useunset CCto revert to your system compiler
then you can follow the guide same as self building
self building
if you are compiling from stanix (or using the cross toolchain) follow these steps
required software
gitgccldarandas(tccmight also work but is untested)makenasmcoreutilgdisk(for hdd images)mtools(for hdd imaages)xorriso(for iso images)pkg-config
configure
first configure, this will detect the compiler and linker
./configure --host=x86_64-stanix
[!NOTE]
supported values for--hostarex86_64-stanix,i386-stanixandaarch64-stanix
see configuration options for all supported options
compiling
first run make and then just run make all for all images or
make hddfor hdd imagemake isofor iso imagemake testcreate an hdd image and automaticly launch it with qemu
configuration options
all options supported by the ./configure script
--host=XXXprecise the host for finding the compiler this should always bex86_64-stanixor not present--sysroot=XXXcustom sysroot path--cc=XXXuse a custom c compiler--ld=XXXuse a custom linker--nasm=XXXuse a custom assembler (must use the intel syntax and produce 64-bit objects files)
installing programs
for the moment, any program you want to install must be put into ./initrd/bin/ in the repo
then redo make all
you can install port by going into the ports folder then running ./build.sh XXX and ./install.sh XXX
exemple with doom :
cd ports
./build.sh doomgeneric
./install.sh doomgeneric
a list of ports is available here