logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: c97ad0212f83677b90dea22e6efdef0dc90f70be
parent 19b41d22f4a0be824aef34658ede8b40657aa2f8
Author: fosslinux <fosslinux@aussies.space>
Date:   Wed, 23 Dec 2020 17:02:57 +1100

Make structure of sysa/ a bit cleaner

Diffstat:

Mrootfs.sh24++++++++++++++++++++----
Asysa/after.kaem34++++++++++++++++++++++++++++++++++
Asysa/after.kaem.run25+++++++++++++++++++++++++
Asysa/base.kaem.run25+++++++++++++++++++++++++
Dsysa/blynn-compiler-extras/go.kaem102-------------------------------------------------------------------------------
Dsysa/blynn-compiler-extras/kaem.patch12------------
Asysa/blynn-compiler.kaem118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asysa/busybox.static0
8 files changed, 222 insertions(+), 118 deletions(-)

diff --git a/rootfs.sh b/rootfs.sh @@ -10,18 +10,34 @@ mkdir -p tmp/ sudo mount -t tmpfs -o size=8G tmpfs tmp # base: mescc-tools-seed + +#debugging +cp busybox.static tmp/ + +# copy in all the mescc-tools-seed stuff cp -r mescc-tools-seed/x86/* tmp cp -r mescc-tools-seed/{M2-Planet,mes-m2,mescc-tools} tmp/ +# and the kaem seed cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init cp ../bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/ cp -r ../bootstrap-seeds tmp/ +# replace the init kaem with our own custom one +mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run +cp base.kaem.run tmp/kaem.run +# create directories needed mkdir tmp/bin +# after mescc-tools-seed we get into our own little directory because +# the mescc-tools-seed one is hella messy +mkdir tmp/after/bin -p +# put all the kaems for after in +cp after.kaem tmp/ +cp after.kaem.run tmp/after/kaem.run + # blynn-compiler -pushd tmp -git clone ../blynn-compiler-oriansj blynn-compiler -cp ../blynn-compiler-extras/go.kaem blynn-compiler/ -patch -Np0 -i ../blynn-compiler-extras/kaem.patch +pushd tmp/after +git clone ../../blynn-compiler-oriansj blynn-compiler +cp ../../blynn-compiler.kaem blynn-compiler/go.kaem mkdir blynn-compiler/{bin,generated} popd diff --git a/sysa/after.kaem b/sysa/after.kaem @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright © 2020 fosslinux +# +# This file is part of live-bootstrap. +# +# live-bootstrap is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# live-bootstrap is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with live-bootstrap. If not, see <http://www.gnu.org/licenses/>. + +cd after + +# Prepare the directory +../catm bin/hex2 ../bin/hex2 +../catm bin/M1 ../bin/M1 +../catm bin/M2-Planet ../bin/M2-Planet +../catm bin/blood-elf ../bin/blood-elf +../catm bin/get_machine ../bin/get_machine +../catm bin/mes-m2 ../bin/mes-m2 +../catm bin/kaem ../bin/kaem +../catm bin/catm ../catm + +/busybox.static sh + +# Finally, reinvoke kaem in this directory +bin/kaem kaem.run diff --git a/sysa/after.kaem.run b/sysa/after.kaem.run @@ -0,0 +1,25 @@ +#!/bin/sh +# Copyright © 2020 fosslinux +# +# This file is part of live-bootstrap. +# +# live-bootstrap is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# live-bootstrap is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with live-bootstrap. If not, see <http://www.gnu.org/licenses/>. + +PATH=/after/bin + +# Part 2: blynn-compiler + +cd blynn-compiler +kaem go.kaem +cd .. diff --git a/sysa/base.kaem.run b/sysa/base.kaem.run @@ -0,0 +1,25 @@ +#!/bin/sh +# Copyright © 2020 fosslinux +# +# This file is part of live-bootstrap. +# +# live-bootstrap is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# live-bootstrap is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with live-bootstrap. If not, see <http://www.gnu.org/licenses/>. + +# Part 1: mescc-tools-seed + +./bootstrap-seeds/POSIX/x86/kaem-optional-seed mescc-tools-seed.kaem.run + +# Part 2-infinity: get the hell out of this mess of a directory + +bin/kaem --verbose --strict --file after.kaem diff --git a/sysa/blynn-compiler-extras/go.kaem b/sysa/blynn-compiler-extras/go.kaem @@ -1,102 +0,0 @@ -set -ex - -PATH=/bin - -cd blynn-compiler - -# compile pack_blobs.c -M2-Planet --architecture x86 \ - -f functions/file.c \ - -f functions/exit.c \ - -f functions/malloc.c \ - -f functions/calloc.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/require.c \ - -f pack_blobs.c \ - --debug \ - -o bin/pack_blobs.M1 - -# Create dwarf stubs for pack_blobs -blood-elf -f bin/pack_blobs.M1 --entry _start -o bin/pack_blobs-footer.M1 - -# Convert to hex2 linker format -M1 -f test/common_x86/x86_defs.M1 \ - -f test/common_x86/libc-core.M1 \ - -f bin/pack_blobs.M1 \ - -f bin/pack_blobs-footer.M1 \ - --LittleEndian \ - --architecture x86 \ - -o bin/pack_blobs.hex2 - -# Link into final static binary -hex2 -f test/common_x86/ELF-i386-debug.hex2 \ - -f bin/pack_blobs.hex2 \ - --LittleEndian \ - --architecture x86 \ - --BaseAddress 0x8048000 \ - -o bin/pack_blobs --exec_enable - -# Build blobs -./bin/pack_blobs -f blob/parenthetically.source -o generated/parenthetically -./bin/pack_blobs -f blob/exponentially.source -o generated/exponentially -./bin/pack_blobs -f blob/practically.source -o generated/practically -./bin/pack_blobs -f blob/singularity.source -o generated/singularity_blob - -# Compile to assembly vm.c -M2-Planet --architecture x86 \ - -f functions/file.c \ - -f functions/exit.c \ - -f functions/malloc.c \ - -f functions/calloc.c \ - -f functions/file_print.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/match.c \ - -f functions/require.c \ - -f vm.c \ - --debug \ - -o bin/vm.M1 - -# Create dwarf stubs for vm -blood-elf -f bin/vm.M1 --entry _start -o bin/vm-footer.M1 - -# Convert to hex2 linker format -M1 -f test/common_x86/x86_defs.M1 \ - -f test/common_x86/libc-core.M1 \ - -f bin/vm.M1 \ - -f bin/vm-footer.M1 \ - --LittleEndian \ - --architecture x86 \ - -o bin/vm.hex2 - -# Link into final static binary -hex2 -f test/common_x86/ELF-i386-debug.hex2 \ - -f bin/vm.hex2 \ - --LittleEndian \ - --architecture x86 \ - --BaseAddress 0x8048000 \ - -o bin/vm --exec_enable - -# Generate raw file needed -./bin/vm --bootstrap \ - -lf generated/parenthetically \ - -lf generated/exponentially \ - -lf generated/practically \ - -lf generated/singularity_blob \ - -lf singularity \ - -lf semantically \ - -lf stringy \ - -lf binary \ - -lf algebraically \ - -lf parity.hs \ - -lf fixity.hs \ - -lf typically.hs \ - -lf classy.hs \ - -lf barely.hs \ - -lf barely.hs \ - -lfr barely.hs \ - -o bin/raw - -# Make lonely -./bin/vm -f lonely.hs -l bin/raw run effectively.hs -o generated/lonely.c diff --git a/sysa/blynn-compiler-extras/kaem.patch b/sysa/blynn-compiler-extras/kaem.patch @@ -1,12 +0,0 @@ ---- kaem.run 2020-12-14 17:54:49.590792093 +1100 -+++ kaem.run 2020-12-14 17:55:34.293053332 +1100 -@@ -36,3 +36,9 @@ - ############################################ - - ../bin/kaem --verbose --strict --file mes-m2.kaem -+ -+############################################ -+# Phase-14 Build blynn-compiler # -+############################################ -+ -+../bin/kaem --verbose --strict --file blynn-compiler/go.kaem diff --git a/sysa/blynn-compiler.kaem b/sysa/blynn-compiler.kaem @@ -0,0 +1,118 @@ +#!/bin/sh +# Copyright © 2020 fosslinux +# +# This file is part of live-bootstrap. +# +# live-bootstrap is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# live-bootstrap is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with live-bootstrap. If not, see <http://www.gnu.org/licenses/>. + +set -ex + +PATH=/after/bin + +# compile pack_blobs.c +M2-Planet --architecture x86 \ + -f functions/file.c \ + -f functions/exit.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/file_print.c \ + -f functions/match.c \ + -f functions/require.c \ + -f pack_blobs.c \ + --debug \ + -o bin/pack_blobs.M1 + +# Create dwarf stubs for pack_blobs +blood-elf -f bin/pack_blobs.M1 --entry _start -o bin/pack_blobs-footer.M1 + +# Convert to hex2 linker format +M1 -f test/common_x86/x86_defs.M1 \ + -f test/common_x86/libc-core.M1 \ + -f bin/pack_blobs.M1 \ + -f bin/pack_blobs-footer.M1 \ + --LittleEndian \ + --architecture x86 \ + -o bin/pack_blobs.hex2 + +# Link into final static binary +hex2 -f test/common_x86/ELF-i386-debug.hex2 \ + -f bin/pack_blobs.hex2 \ + --LittleEndian \ + --architecture x86 \ + --BaseAddress 0x8048000 \ + -o bin/pack_blobs --exec_enable + +# Build blobs +./bin/pack_blobs -f blob/parenthetically.source -o generated/parenthetically +./bin/pack_blobs -f blob/exponentially.source -o generated/exponentially +./bin/pack_blobs -f blob/practically.source -o generated/practically +./bin/pack_blobs -f blob/singularity.source -o generated/singularity_blob + +# Compile to assembly vm.c +M2-Planet --architecture x86 \ + -f functions/file.c \ + -f functions/exit.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/file_print.c \ + -f functions/in_set.c \ + -f functions/numerate_number.c \ + -f functions/match.c \ + -f functions/require.c \ + -f vm.c \ + --debug \ + -o bin/vm.M1 + +# Create dwarf stubs for vm +blood-elf -f bin/vm.M1 --entry _start -o bin/vm-footer.M1 + +# Convert to hex2 linker format +M1 -f test/common_x86/x86_defs.M1 \ + -f test/common_x86/libc-core.M1 \ + -f bin/vm.M1 \ + -f bin/vm-footer.M1 \ + --LittleEndian \ + --architecture x86 \ + -o bin/vm.hex2 + +# Link into final static binary +hex2 -f test/common_x86/ELF-i386-debug.hex2 \ + -f bin/vm.hex2 \ + --LittleEndian \ + --architecture x86 \ + --BaseAddress 0x8048000 \ + -o bin/vm --exec_enable + +# Generate raw file needed +./bin/vm --bootstrap \ + -lf generated/parenthetically \ + -lf generated/exponentially \ + -lf generated/practically \ + -lf generated/singularity_blob \ + -lf singularity \ + -lf semantically \ + -lf stringy \ + -lf binary \ + -lf algebraically \ + -lf parity.hs \ + -lf fixity.hs \ + -lf typically.hs \ + -lf classy.hs \ + -lf barely.hs \ + -lf barely.hs \ + -lfr barely.hs \ + -o bin/raw + +# Make lonely +./bin/vm -f lonely.hs -l bin/raw run effectively.hs -o generated/lonely.c diff --git a/sysa/busybox.static b/sysa/busybox.static Binary files differ.