From 5dfdd8e2378cae164fd178c075c5080371508295 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 23 Oct 2019 18:08:50 +0200 Subject: [PATCH] kaem.run: New file. * kaem.run: New file. --- kaem.run | 130 +++++++++++++++++++++++++++++++++++++++++++++++ lib/m2/abtol.c | 2 +- lib/m2/ntoab.c | 2 +- lib/m2/strncmp.c | 2 +- 4 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 kaem.run diff --git a/kaem.run b/kaem.run new file mode 100644 index 00000000..917f06cd --- /dev/null +++ b/kaem.run @@ -0,0 +1,130 @@ +#!/bin/bash +# Copyright (C) 2019 Jeremiah Orians +# This file is part of Gnu Mes +# +# Gnu Mes 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. +# +# Gnu Mes 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 Gnu Mes. If not, see . + +# Usage: +# kaem --verbose --strict +# bin/mes-m2 --boot scaffold/boot/14-exit.scm +# bin/mes-m2 --boot scaffold/boot/15-display.scm + +M2-Planet \ + --debug \ + --architecture x86 \ + -f lib/linux/x86-mes-m2/crt1.c \ + -f lib/linux/x86-mes-m2/mini.c \ + -f lib/m2/exit.c \ + -f lib/m2/write.c \ + -f lib/linux/x86-mes-m2/syscall.c \ + -f include/linux/x86/syscall.h \ + -f lib/m2/brk.c \ + -f lib/m2/malloc.c \ + -f lib/m2/memset.c \ + -f lib/m2/read.c \ + -f lib/m2/fdgetc.c \ + -f lib/stdio/getchar.c \ + -f lib/m2/putchar.c \ + -f lib/m2/open.c \ + -f lib/m2/mes_open.c \ + -f lib/m2/strlen.c \ + -f lib/m2/eputs.c \ + -f lib/m2/fdputc.c \ + -f lib/mes/eputc.c \ + \ + -f include/mes/mes.h.m2 \ + -f include/mes/m2.h.m2 \ + -f include/mes/builtins.h.m2 \ + -f include/mes/constants.h.m2 \ + -f include/mes/symbols.h.m2 \ + \ + -f lib/mes/__assert_fail.c \ + -f lib/mes/assert_msg.c \ + \ + -f lib/m2/fdputc.c \ + -f lib/m2/strncmp.c \ + -f lib/m2/getenv.c \ + -f lib/mes/fdputs.c.m2 \ + -f lib/m2/ntoab.c \ + -f lib/ctype/isdigit.c.m2 \ + -f lib/ctype/isxdigit.c.m2 \ + -f lib/ctype/isspace.c.m2 \ + -f lib/ctype/isnumber.c.m2 \ + -f lib/m2/abtol.c \ + -f lib/m2/atoi.c \ + -f lib/m2/memcpy.c \ + -f lib/stdlib/free.c \ + -f lib/stdlib/realloc.c.m2 \ + -f lib/m2/strcpy.c \ + -f lib/mes/itoa.c.m2 \ + -f lib/mes/fdungetc.c.m2 \ + -f lib/m2/setenv.c \ + -f lib/m2/access.c \ + -f lib/m2/chmod.c \ + -f lib/m2/isatty.c \ + -f lib/m2/fork.c \ + -f lib/m2/execve.c \ + -f lib/m2/execv.c \ + -f lib/m2/waitpid.c \ + -f lib/m2/clock_gettime.c \ + -f lib/m2/time.c \ + -f lib/m2/_getcwd.c \ + -f lib/m2/getcwd.c \ + -f lib/m2/dup.c \ + -f lib/m2/dup2.c \ + -f lib/m2/unlink.c \ + -f lib/m2/strcmp.c \ + -f lib/m2/memcmp.c \ + -f src/builtins.c.m2 \ + -f src/display.c.m2 \ + -f src/eval-apply.c.m2 \ + -f src/gc.c.m2 \ + -f src/hash.c.m2 \ + -f src/lib.c.m2 \ + -f src/math.c.m2 \ + -f src/mes.c.m2 \ + -f src/module.c.m2 \ + -f src/posix.c.m2 \ + -f src/reader.c.m2 \ + -f src/string.c.m2 \ + -f src/struct.c.m2 \ + -f src/symbols.c.m2 \ + -f src/vector.c.m2 \ + -o bin/mes.M1 + +blood-elf -f bin/mes.M1 -o bin/mes.blood-elf-M1 + +M1 \ + --LittleEndian \ + --architecture x86 \ + -f lib/m2/x86/x86_defs.M1 \ + -f lib/x86-mes/x86.M1 \ + -f lib/linux/x86-mes-m2/crt1.M1 \ + -f bin/mes.M1 \ + -f bin/mes.blood-elf-M1 \ + -o bin/mes.hex2 + +hex2 \ + --LittleEndian \ + --architecture x86 \ + --BaseAddress 0x1000000 \ + --exec_enable \ + -f lib/x86-mes/elf32-header.hex2 \ + -f bin/mes.hex2 \ + -f lib/m2/missing.hex2 \ + -o bin/mes-m2 + +echo Running mes-m2 +./bin/mes-m2 --boot scaffold/boot/14-exit.scm +#./bin/mes-m2 --boot scaffold/boot/15-display.scm diff --git a/lib/m2/abtol.c b/lib/m2/abtol.c index 22378a65..48be4fc9 100644 --- a/lib/m2/abtol.c +++ b/lib/m2/abtol.c @@ -21,7 +21,7 @@ #include #include -int +long abtol (char **p, int base) { char *s = p[0]; diff --git a/lib/m2/ntoab.c b/lib/m2/ntoab.c index b3115678..f2d2e3ad 100644 --- a/lib/m2/ntoab.c +++ b/lib/m2/ntoab.c @@ -25,7 +25,7 @@ char *__itoa_buf; char * -ntoab (int x, int base, int signed_p) +ntoab (long x, int base, int signed_p) { if (__itoa_buf == 0) __itoa_buf = malloc (20); diff --git a/lib/m2/strncmp.c b/lib/m2/strncmp.c index 44fe15bf..b4270074 100644 --- a/lib/m2/strncmp.c +++ b/lib/m2/strncmp.c @@ -19,7 +19,7 @@ */ int -strncmp (char *a, char *b, int size) +strncmp (char const *a, char const *b, size_t size) { if (size == 0) return 0;