_______ .______ ___ ____ ____ ____ ___ __
/ _____|| _ \ / \ \ \ / / |___ \ / _ \ / /
| | __ | |_) | / ^ \ \ \/ / __) | | (_) | / /_
| | |_ | | / / /_\ \ \_ _/ |__ < > _ < | '_ \
| |__| | | |\ \----./ _____ \ | | ___) | | (_) | | (_) |
\______| | _| `._____/__/ \__\ |__| |____/ \___/ \___/
Linux for i386 machines
Are you interested in Linux on i486 machine? Take a look at gray486linux. Currently, it's not possible to run gray386linux on i486 machines (but it's possible to run gray386linux on Cyrix 486DLC and similar CPUs). However i486 machine is still able to run actual Linux kernel (2022).
It's easy. Just take a look at bin
directory. There is 2 folders named:
fpu
- version for machines with FPU coprocessor installed.
no_fpu
- build with software FPU enabled.
NOTE: only AMD cpus are enabled by default now.
NOTE2: gray386 linux is source based distribution so binaries can be older than current configuration.
Tested build environment: Fedora 35 with Nix installed.
10. Install Nix
If you want just default build, and you have installed make
and bash
then
you can just type make
in src
directory. You are done and GOTO 100
.
But if you don't like make
, you can just type ./graybuild.sh
in src
directory.
In both cases, results will be placed in results
directory.
In case you want to make some changes then follow next steps.
Nix-shell scripts take handle of it.
If you don't want to use nix-shell
, just type:
export GR_CPUS=$(nproc --all)
cd src/build-kernel-env-with-nix/
nix-shell --pure
make headers_install ARCH=i386 INSTALL_HDR_PATH=../gray386/
exit
cd src/build-env-with-nix/
nix-shell --pure
CFLAGS="$CFLAGS -I$(realpath "${PWD}/../gray386/include")" ./configure --target=i386 --prefix=$(realpath "${PWD}/../gray386/")
make -j"$GR_CPUS"
make install
(optional) make menuconfig
make -j"$GR_CPUS"
make install
autoconf; autoheader
CC="$(realpath $PWD/../gray386/bin/musl-gcc)" ./configure --enable-static --enable-bundled-libtom --disable-syslog --disable-harden --disable-zlib --disable-shadow --disable-utmp --disable-utmpx --disable-wtmpx --disable-loginfunc --prefix="$(realpath $PWD/../gray386/_install/)"
make -j"$GR_CPUS"
strip dbclient
cp dbclient ../gray386/_install/bin
exit
cd src/build-kernel-env-with-nix/
nix-shell --pure
There is mapping hidden in .config
and you need to change it
to UID of user under you compile a kernel.
CONFIG_INITRAMFS_ROOT_UID=1001
CONFIG_INITRAMFS_ROOT_GID=1001
Then you can do some other changes with:
make -j"$GR_CPUS" ARCH=i386 nconfig
(optional) make -j"$GR_CPUS" ARCH=i386 nconfig
make -j"$GR_CPUS" ARCH=i386 bzImage
Results are in:
arch/x86/boot/bzImage
usr/initramfs_data.cpio.gz
exit
You need to have qemu installed.
In kernel directory just run
./test-build.sh
git clean -f -d -X