Release 1.4.0
This commit is contained in:
parent
465b4c9c31
commit
7cab825b50
|
@ -21,6 +21,7 @@
|
|||
Tweaked cc_types.c to better match amd64 assembly
|
||||
Replaced out with output_list in cc_core.c
|
||||
For 32bit behavior on 64bit platforms
|
||||
Replaced generated seed with hand written seed in M1
|
||||
|
||||
** Fixed
|
||||
|
||||
|
|
|
@ -5,3 +5,12 @@ with introspective steps inbetween.
|
|||
|
||||
A lovely set of examples of M2-Planet programs are in tests but the most
|
||||
surprising part of all M2-Planet can self-host M2-Planet.
|
||||
|
||||
Further more M2-Planet is cross-platform and self-hosting across platforms
|
||||
with fully deterministic builds enabling prefect reproducibility.
|
||||
|
||||
To bootstrap from assembly simple run ./bootstrap-x86.sh after cd into the
|
||||
bootstrap directory (the only requirement is mescc-tools to be installed)
|
||||
|
||||
Or if you have no binaries to bootstrap from please use mescc-tools-seed;
|
||||
which will not only bootstrap mescc-tools but also M2-Planet
|
107
bootstrap.sh
107
bootstrap.sh
|
@ -1,107 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
## Copyright (C) 2017 Jeremiah Orians
|
||||
## This file is part of M2-Planet.
|
||||
##
|
||||
## M2-Planet 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.
|
||||
##
|
||||
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -eux
|
||||
stage0_PREFIX=${stage0_PREFIX-../stage0}
|
||||
|
||||
[ -e bin/M2-Planet ] && rm bin/M2-Planet
|
||||
|
||||
# Refresh stage0's M2-Planet_x86.c
|
||||
# To execute this block ./bootstrap.sh refresh
|
||||
if [ "refresh" = "${1-NOPE}" ]
|
||||
then
|
||||
# Create header to prevent confusion
|
||||
{
|
||||
cat <<-EOF
|
||||
## This file was generated by running:
|
||||
## cat functions/file.c functions/malloc.c functions/calloc.c functions/exit.c functions/match.c -f functions/in_set.c functions/numerate_number.c functions/file_print.c functions/string.c cc.h cc_reader.c cc_strings.c cc_types.c cc_core.c cc.c >| ../stage0/stage3/M2-Planet_x86.c
|
||||
## inside M2-Planet's repo
|
||||
|
||||
EOF
|
||||
} >| header
|
||||
|
||||
# Update the C code in stage0's x86 bootstrap
|
||||
cat header \
|
||||
functions/file.c \
|
||||
functions/malloc.c \
|
||||
functions/calloc.c \
|
||||
functions/exit.c \
|
||||
functions/match.c \
|
||||
functions/in_set.c \
|
||||
functions/numerate_number.c \
|
||||
functions/file_print.c \
|
||||
functions/string.c \
|
||||
cc.h \
|
||||
cc_reader.c \
|
||||
cc_strings.c \
|
||||
cc_types.c \
|
||||
cc_core.c \
|
||||
cc.c >| $stage0_PREFIX/stage3/M2-Planet_x86.c
|
||||
|
||||
# Clean up temp header
|
||||
rm header
|
||||
|
||||
{
|
||||
# Create header to prevent confusion
|
||||
cat <<-EOF
|
||||
# This file was generated by running:
|
||||
# ./bin/vm --rom roms/cc_x86 --memory 4M --tape_01 stage3/M2-Planet_x86.c --tape_02 ../M2-Planet/seed.M1
|
||||
# In stage0
|
||||
EOF
|
||||
} >| preseed1
|
||||
|
||||
# Create the seed
|
||||
$stage0_PREFIX/bin/vm --rom $stage0_PREFIX/roms/cc_x86 \
|
||||
--memory 4M \
|
||||
--tape_01 $stage0_PREFIX/stage3/M2-Planet_x86.c \
|
||||
--tape_02 preseed2
|
||||
|
||||
# Combine to final seed
|
||||
cat preseed1 preseed2 >| seed.M1
|
||||
|
||||
# Cleanup preseed values
|
||||
rm preseed1 preseed2
|
||||
fi
|
||||
|
||||
|
||||
# Make the required bin directry
|
||||
[ -d bin ] || mkdir bin
|
||||
|
||||
# Build debug footer
|
||||
blood-elf -f seed.M1 \
|
||||
-o bin/seed-footer.M1 || exit 1
|
||||
|
||||
# Macro assemble with libc written in M1-Macro
|
||||
M1 -f test/common_x86/x86_defs.M1 \
|
||||
-f test/common_x86/libc-core.M1 \
|
||||
-f seed.M1 \
|
||||
-f bin/seed-footer.M1 \
|
||||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
-o bin/seed.hex2 || exit 2
|
||||
|
||||
# Resolve all linkages
|
||||
hex2 -f test/common_x86/ELF-i386-debug.hex2 \
|
||||
-f bin/seed.hex2 \
|
||||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o bin/M2-Planet-seed \
|
||||
--exec_enable || exit 2
|
||||
|
||||
# self-host
|
||||
./test/test100/hello.sh
|
|
@ -0,0 +1,6 @@
|
|||
M2.M1
|
||||
M2.hex2
|
||||
cc_x86
|
||||
hold
|
||||
seed.hex2
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
#! /usr/bin/env bash
|
||||
## Copyright (C) 2017 Jeremiah Orians
|
||||
## This file is part of M2-Planet.
|
||||
##
|
||||
## M2-Planet 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.
|
||||
##
|
||||
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -eux
|
||||
[ -e ../bin/M2-Planet ] && rm ../bin/M2-Planet
|
||||
|
||||
# Make the required bin directry
|
||||
[ -d ../bin ] || mkdir ../bin
|
||||
|
||||
# Macro assemble with libc written in M1-Macro
|
||||
M1 -f x86/cc_x86.M1 \
|
||||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
-o seed.hex2 || exit 1
|
||||
|
||||
# Resolve all linkages
|
||||
hex2 -f ../test/common_x86/ELF-i386.hex2 \
|
||||
-f seed.hex2 \
|
||||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o cc_x86 \
|
||||
--exec_enable || exit 2
|
||||
|
||||
# Build M2-Planet from cc_x86
|
||||
catm hold ../test/common_x86/functions/file.c \
|
||||
../test/common_x86/functions/malloc.c \
|
||||
../functions/calloc.c \
|
||||
../test/common_x86/functions/exit.c \
|
||||
../functions/match.c \
|
||||
../functions/in_set.c \
|
||||
../functions/numerate_number.c \
|
||||
../functions/file_print.c \
|
||||
../functions/number_pack.c \
|
||||
../functions/fixup.c \
|
||||
../functions/string.c \
|
||||
../cc.h \
|
||||
../cc_reader.c \
|
||||
../cc_strings.c \
|
||||
../cc_types.c \
|
||||
../cc_core.c \
|
||||
../cc.c
|
||||
./cc_x86 hold M2.M1
|
||||
M1 --architecture x86 \
|
||||
--LittleEndian \
|
||||
-f ../test/common_x86/x86_defs.M1 \
|
||||
-f ../test/common_x86/libc-core.M1 \
|
||||
-f M2.M1 \
|
||||
-o M2.hex2
|
||||
|
||||
hex2 -f ../test/common_x86/ELF-i386.hex2 \
|
||||
-f M2.hex2 \
|
||||
--LittleEndian \
|
||||
--architecture x86 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o ../bin/M2-Planet-seed \
|
||||
--exec_enable
|
File diff suppressed because it is too large
Load Diff
40
kaem.run
40
kaem.run
|
@ -1,40 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
## Copyright (C) 2017 Jeremiah Orians
|
||||
## This file is part of M2-Planet.
|
||||
##
|
||||
## M2-Planet 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.
|
||||
##
|
||||
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Make the required bin directry
|
||||
mkdir -p bin
|
||||
|
||||
# Build debug footer
|
||||
blood-elf -f seed.M1 -o bin/seed-footer.M1
|
||||
|
||||
# Macro assemble with libc written in M1-Macro
|
||||
M1 -f test/common_x86/x86_defs.M1 \
|
||||
-f functions/libc-core.M1 \
|
||||
-f seed.M1 \
|
||||
-f bin/seed-footer.M1 \
|
||||
--LittleEndian \
|
||||
--Architecture 1 \
|
||||
-o bin/seed.hex2
|
||||
|
||||
# Resolve all linkages
|
||||
hex2 -f test/common_x86/ELF-i386-debug.hex2 \
|
||||
-f bin/seed.hex2 \
|
||||
--LittleEndian \
|
||||
--Architecture 1 \
|
||||
--BaseAddress 0x8048000 \
|
||||
-o bin/M2-Planet \
|
||||
--exec_enable
|
Loading…
Reference in New Issue