Commit Graph

2306 Commits

Author SHA1 Message Date
Andrius Štikonas b397e25c41 DRAFT Fix a typo in the comment.
* src/gc.c
2023-05-01 10:41:54 +02:00
Andrius Štikonas a20b790b49 DRAFT Fix x86_64 M2 elf header to work with debug info.
* lib/m2/x86_64/ELF-x86_64.hex2
2023-05-01 10:41:52 +02:00
Andrius Štikonas 44e265650e DRAFT Pass --64 to blood_elf on 64-bit arches.
* kaem.run
2023-05-01 10:41:50 +02:00
Janneke Nieuwenhuizen 2b6c88dc50 Revert "squash! EOF"
This reverts commit afd74c3fae.
2023-05-01 10:35:51 +02:00
Janneke Nieuwenhuizen afd74c3fae squash! EOF 2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 5663a79ec5 Revert "REMOVEME Revert kaem build for x86_64 -- segfaults"
This reverts commit 6a2d5bf80314fb17d5a6c06f14f46f74cc339a6f.
2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 6b145b99c2 REMOVEME x86_64 M2-Planet bug: scaffold/bug.c scaffold/bug.kaem
M2-Planet-0.10.0

This works fine, prints three times 33

    mes_cpu=x86 stage0_cpu=x86 kaem -f scaffold/bug.kaem

Only ntoab_local works, prints 33 only once,
segfaults in ntoab_global and ntoab

    mes_cpu=x86_64 stage0_cpu=amd64 kaem -f scaffold/bug.kaem

* scaffold/bug.c,
scaffold/bug.kaem: New files.
2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen b00778b708 DRAFT m2: Add new style x86_64 defines to support M2-Planet 1.11.0.
* lib/m2/x86_64/x86_64_defs.M1: Add new M1 defines.
2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 12b3854d87 REMOVEME Revert kaem build for x86_64 -- segfaults 2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 13fe0b762a squash! x64 2023-05-01 10:35:08 +02:00
Jan (janneke) Nieuwenhuizen ef2a43d96e squash! DRAFT x86_64: build: Cater for M2-Planet. 2023-05-01 10:35:08 +02:00
Jan (janneke) Nieuwenhuizen 87471ffeef XXX DRAFT x86_64: build: Cater for M2-Planet.
What about
-    -f include/m2/lib.h                         \

XXX scaffold tests run,
  * MES_DEBUG=3 bin/mes-m2 segfaults in gc_init.

* kaem.run: Define __<cpu>__.
* kaem.x86_64,
lib/linux/x86_64-mes-m2/_exit.c,
lib/linux/x86_64-mes-m2/_write.c,
lib/linux/x86_64-mes-m2/crt1.M1,
lib/linux/x86_64-mes-m2/crt1.c,
lib/linux/x86_64-mes-m2/syscall.c,
lib/m2/x86_64/ELF-x86_64.hex2,
lib/m2/x86_64/x86_64_defs.M1: New files.
* build-aux/build.sh.in: Also allow kaem build for X86_64.
* include/mes/lib-mini.h[__M2__ && __x86_64__](M2_PTR_SIZE): Define as
8.
* include/mes/mes.h[__M2__ && __x86_64__](M2_CELL_SIZE): Define as 24.
* lib/x86_64-mes/x86_64.M1 (add____$i8,%rbp, mov____%rdi,%rbp): New
defines.
2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 311fe800f7 squash! fixup read.kaem EOF? 2023-05-01 10:35:08 +02:00
Janneke Nieuwenhuizen 47a261dcf8 squash! kaem.run: Remove --bootstrap-mode. 2023-05-01 10:34:26 +02:00
Janneke Nieuwenhuizen 6ddf5b17de squash! kaem.run: Remove --bootstrap-mode.
* include/mes/cc.h (__raise): ...here.

* include/sys/types.h (EOF): Move to...
* include/mes/cc.h (EOF): ...here, and...
* include/m2/types.h (EOF): ...here, to avoid M2-Planet crash.
2023-04-30 12:27:49 +02:00
Andrius Štikonas aaf9d178d4 m2: Add new style x86 defines to support M2-Planet 1.11.0.
* lib/m2/x86/x86_defs.M1: Add new M1 defines.
2023-04-30 10:45:16 +02:00
Jan (janneke) Nieuwenhuizen 3f62afe465 DRAFT lib: __assert_fail: Remove M2-Planet workarounds.
* lib/mes/__assert_fail.c (__assert_fail): Use *file, *function.
2023-04-30 10:45:16 +02:00
Jan (janneke) Nieuwenhuizen 975c87941b DRAFT lib: linux: Add wait4.
* lib/linux/waitpid.c (waitpid): Factor-out wait4 call to...
* lib/linux/wait4.c: ...new file here.
* include/sys/wait.h (wait4): Add prototype.  Include sys/resource.h.
* include/sys/resource.h (struct rusage): Remove gratuitous "int" for
M2-Planet.
* build-aux/configure-lib.sh (libc_SOURCES): Add it.
* kaem.run,
simple.make (M2_SOURCES),
simple.sh: Likewise.  Also add resource.h.
2023-04-30 10:41:08 +02:00
Jan (janneke) Nieuwenhuizen e6f875a2c6 core: Move M2_PTR_SIZE, M2_CELL_SIZE to include file.
* lib/posix/getenv.c (M2_PTR_SIZE),
lib/posix/setenv.c (M2_PTR_SIZE): Move definition...
* include/mes/lib-mini.h (M2_PTR_SIZE): ...here.
* src/gc.c (M2_CELL_SIZE),
src/symbol.c (M2_CELL_SIZE),
src/test/gc.c (M2_CELL_SIZE),
src/vector.c (M2_CELL_SIZE): Move definition...
* include/mes/mes.h (M2_CELL_SIZE): ...here.
2023-04-30 10:41:08 +02:00
Jan (janneke) Nieuwenhuizen e1fa9f4959 kaem: Add kaem.arm and kaem.x86.
* kaem.arm,
kaem.x86: New files.
2023-04-30 10:41:08 +02:00
Jan (janneke) Nieuwenhuizen f5b96067be kaem.run: Remove --bootstrap-mode.
* include/linux/arm/syscall.h,
include/linux/x86/syscall.h,
include/mes/constants.h: Remove CONSTANTs.
* include/sys/types.h (EOF): Change to 0xffffffff,
resp. 0xffffffffffffffff to avoid M2-Planet crash.
* lib/m2/open.c: Move to...
* lib/linux/open.c: ...here.  Update to make gcc-compatible.
* scaffold/argv.kaem: Update accordingly.
* lib/linux/lseek.c (_leek, lseek): Suport M2-Planet.
* lib/linux/_open3.c (_open3): Fix cast.
* lib/linux/waitpid.c (waitpid): Suport M2-Planet.
* lib/m2/getcwd.c (PATH_MAX): Remove CONSTANT.
* lib/m2/isatty.c (TCGETS): Remove CONSTANT.
* lib/mes/ntoab.c: Support M2-Planet.
* lib/posix/getcwd.c (__getcwd_buf): Remove.
* lib/posix/getenv.c (M2_PTR_SIZE)[__M2__]: Update to #define.
* lib/posix/setenv.c: Likewise.
* lib/stub/__raise.c (SIGABRT): Remove CONSTANT.
* src/core.c (error): Use __M2__ instead of __M2_PLANET__.
* src/gc.c (M2_CELL_SIZE)[__M2__]: Update to #define.  Support
non-bootstrap-mode.
* src/symbol.c: Likewise.
* src/vector.c: Likewise.
* src/posix.c: Likewise.
(__raise): Move to...
* include/mes/lib-system.h: ...this new file to avoid M2-Planet crash.
* kaem.run: Remove --botstrap-mode.  Update source list accordingly.
* simple.make (M2_PLANET_FLAGS): Remove --bootstrap-mode.
* simple.make (M2_SOURCES, M2_PLANET_INCLUDES): Update source list
accordingly.
2023-04-30 10:39:03 +02:00
Jan (janneke) Nieuwenhuizen c37faea559 lib: posix/open: Support M2-Planet.
* lib/posix/open.c (open)[__M2__]: New function.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen a3cf7781e2 lib: linux/_open3: Support M2-Planet.
* lib/linux/_open3.c (_open3): Use function casting.  Also call
__ungetc_init.
* lib/stub/__buffered_read.c: New file.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen 94ceb07b70 kaem: read: Remove --bootstrap-mode.
* include/mes/lib.h[__M2__](__call_at_exit,abtod,dtoab,ultoa,
* include/sys/types.h[__M2__]: Fall back to unsigned instead of using
unsigned long.
* include/stdio.h[__M2__](fprintf, fscanf, printf, snprintf, sprintf,
sscanf): Hide prototypes.
* lib/stdlib/exit.c (exit)[__M2__]: Hide call to __call_at_exit.
* lib/linux/read.c (read)[__M2__]: Hide debugging.
* lib/linux/malloc.c (malloc)[__M2__]: Hide alignment.
__mesabi_umod, __mesabi_udiv, __mesabi_uldiv): Hide prototypes.
* scaffold/argv.kaem: Use them together with lib/mes/lib-mini.h instead of
lib/mes/* specializations.  Remove --bootstrap-mode from M2-Planet call.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen 350feb72bb kaem: argv: Remove --bootstrap-mode.
* scaffold/argv.kaem: Use lib/mes/lib-mini.h instead of lib/m2/lib.h.
Remove --bootstrap-mode from M2-Planet call.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen ba01443492 kaem: hello: Remove --bootstrap-mode.
* include/mes/lib-mini.h: Remove M2 bootstrap constants.
[__M2__](size_t): Fall-back to unsigned instead of unsigned long.
* scaffold/hello.kaem: Use it instead of lib/m2/lib.h.  Remove
--bootstrap-mode from M2-Planet call.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen ee664ba643 kaem: main: Remove --bootstrap-mode.
* scaffold/main.kaem: Remove --bootstrap-mode from M2-Planet call.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen 5abda859d9 guix: m2-planet: Update to 1.10.0.
* guix/git/mes.scm (m2-planet): Update to 1.10.0.
2023-02-13 13:27:51 +01:00
Jan (janneke) Nieuwenhuizen 813e36a6f5 lib: mes/write: Rename from mes/mini-write.c
* lib/mes/mini-write.c: Move to...
* lib/mes/write.c: ...here.
* build-aux/configure-lib.sh,
kaem.run,
scaffold/argv.kaem,
scaffold/global-array.kaem,
scaffold/hello.kaem,
scaffold/local-array.kaem,
scaffold/local-static-array.kaem,
scaffold/read.kaem,
simple.make,
simple.sh: Update accordingly.
2023-02-13 13:27:47 +01:00
Jan (janneke) Nieuwenhuizen d68fd5574a build: Cater for colliding basename in C sources.
This is a follow-up to commit
    f785f8d560
    build: Fix --with-bootstrap build.

* build-aux/cc.sh: Retain directory name in object file name.
* build-aux/bootstrap.sh.in: Likewise.  Compile crt1.c from local
directory.
* build-aux/build-lib.sh: Likewise.
* build-aux/build.sh.in: Remove globals.o hack.
2023-02-13 13:26:15 +01:00
Jan (janneke) Nieuwenhuizen 8bae5fe860
DRAFT lib/m2: Update syscall includes.
This is a follow-up to commit
    bc1fa57851
    lib: stat: Use SYS_stat64 for 32bit platforms.

* lib/m2/chmod.c: Update to <arch/syscall.sh>.
* lib/m2/clock_gettime.c: Likewise.
* lib/m2/read.c: Likewise.
2023-02-13 13:08:39 +01:00
Jan (janneke) Nieuwenhuizen c656bab1fd
doc: Post-release update.
* build-aux/GNUmakefile.in (--previous-version): Update to 0.24.2.
* doc/announce/ANNOUNCE-0.24.2: Run `make sum-announce'.
2023-02-13 12:11:01 +01:00
Jan (janneke) Nieuwenhuizen 1608f9f38a
guix: mes: Update to 0.24.2.
* guix/git/mes.scm (mes)[source]: Update to 0.24.2.
2023-02-13 12:09:36 +01:00
Jan (janneke) Nieuwenhuizen 7562330ec7
build: Release 0.24.2.
* configure (VERSION): Bump to 0.24.2.
* configure.sh (VERSION): Likewise.
* src/symbol.c (MES_VERSION): Likewise.
* mes/module/mes/repl.mes (welcome): Update copyright years.
2023-02-13 09:22:39 +01:00
Jan (janneke) Nieuwenhuizen f0182ecf97
build: Update release procedure.
* build-aux/GNUmakefile.in: Add `./configure' stage before creating
tarball.
2023-02-13 09:27:52 +01:00
Jan (janneke) Nieuwenhuizen 56fed8d65e
doc: Update `ROADMAP'.
* ROADMAP (release 0.x, unsorted): Add Guile module support, Gash on
Mes, Guile as a Guix FSB dependency.
2023-02-13 09:18:57 +01:00
Jan (janneke) Nieuwenhuizen c824c62f85
doc: Add `ANNOUNCE-0.24.2'.
* doc/announce/ANNOUNCE-0.24.2: New file.
2023-02-13 09:15:37 +01:00
Jan (janneke) Nieuwenhuizen 029a891d4e
doc: Update `NEWS'.
* NEWS (Changes in 0.24.2 since 0.24.1): New section.
2023-02-13 07:19:16 +01:00
Jan (janneke) Nieuwenhuizen 43fe67e2f9
lib: Fix compile warnings.
* lib/linux/read.c (read): Add casts.
* lib/linux/signal.c (signal): Likewise.
* lib/stdio/vfscanf.c: Include stdlib.h.
(vfscanf): Add cast.
* lib/stdlib/mbstowcs.c (mbstowcs): Add cast.
2023-02-12 23:02:24 +01:00
R. Masters b28f42de07
lib: Support uppercase hex conversions.
Uppercase hex number conversions fail for abtol, strtol, strtoul,
strtoull, atoi, and abtod.

The following patch fixes it.  This allows tcc to handle assembly
language, which is necessary to build the Fiwix kernel as part of the
kernel bootstrapping in progress for the live-bootstrap project.

* lib/ctype/isxdigit.c (isxdigit): Also allow A-F.
* lib/mes/abtol.c (abtol): Also cater for A-F.
2023-01-31 08:22:49 -08:00
Jan (janneke) Nieuwenhuizen 1e14c26305
lib/m2: time: Fix segfault by allocating timeval struct.
Suggested by Meghan Denny <hello@nektro.net>.

* lib/m2/time.c (__tv): New global variable.
(time): Use it to allocate timeval struct.
2023-01-24 07:59:49 +01:00
Jan (janneke) Nieuwenhuizen c1f93c1d71
doc: Use HTTPS.
* COPYING: Replace by new version (which uses HTTPS).
* HACKING,
README,
doc/fdl-1.3.texi,
doc/mes.texi: Use HTTPS.
2022-10-30 09:40:40 +01:00
Jan (janneke) Nieuwenhuizen dbb446d906
doc: Update `HACKING'.
* HACKING (SETUP): Update arm triplet.
2022-10-16 23:19:36 +02:00
Jan (janneke) Nieuwenhuizen cfb620567a
mescc: Fix Guile warnings.
* module/mescc/mescc.scm (GUILE-with-output-to-file): Remove.n
(with-output-to-file): Rename to...
(with-output-to-file*): ...this.
(mescc:preprocess, mescc:compile, infos->hex2): Update callers.
2022-10-19 10:01:48 +02:00
Jan (janneke) Nieuwenhuizen bc1fa57851
lib: stat: Use SYS_stat64 for 32bit platforms.
This fixes <https://debbugs.gnu.org/41264>.

* include/linux/arm/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/linux/x86/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/sys/stat.h (struct stat): Move definition to...
* include/linux/arm/kernel-stat.h,
include/linux/m2/kernel-stat.h,
include/linux/x86/kernel-stat.h,
include/linux/x86_64/kernel-stat.h: These new files.
* include/gnu/x86/kernel-stat.h: New file.
* configure (main): Copy <srcdest>include/<kernel>/<arch>/*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them.  Add copyright header.
* build-aux/GNUmakefile.in (X86_ARCH_HEADERS, ARCH_HEADERS): New
variables.
(build): Use them.
(include/arch/%.h, arch-dir): New targets.
* build-aux/bootstrap.sh.in (AM_CPPFLAGS): Replace
<srcdest>include/<kernel>/<cpu> with built ../include.
* build-aux/build.sh.in (AM_CPPFLAGS): Likewise.
* build-aux/install.sh.in: Also install built include.
* include/m2/types.h: New file.
* kaem.run: Use it.
* simple.sh: Copy kernel-stat.h, syscall.h for kernel/cpu to
include/arch.
2022-10-29 13:17:58 +02:00
Jan (janneke) Nieuwenhuizen 25e0c4d119
lib: __assert_fail: Update to standard.
* lib/mes/__assert_fail.c (__assert_fail): Add file, line, function
parameters.
* include/assert.h (assert): Update caller.
(__assert_fail): Update prototype.
* include/mes/lib.h (__assert_fail): Likewise.
* lib/mes/assert_msg.c (assert_msg): Likewise.  Include assert.h.
2022-10-26 21:14:05 +02:00
Jan (janneke) Nieuwenhuizen 84fd995f43
time.c: include sys/time for gettimeofday.
* lib/linux/time.c: Include <sys/time.h>.
2022-05-05 23:26:46 +02:00
Jan (janneke) Nieuwenhuizen 77602c2cde
lib: linux/time: Remove SYS_time specialization.
* lib/linux/time.c (time)[SYS_time]: Remove specialization.
[!SYS_time && !SYS_gettimeofday]: Remove fallback.
2022-05-04 14:14:51 +02:00
Jan (janneke) Nieuwenhuizen fc6e88ab89
simple.sh: Resurrect.
* simple.sh: Add src/globals.c, lib/stub/__raise.c.  Use
lib/linux/malloc.c instead of lib/stdlib/malloc.c.
2022-05-03 23:06:41 +02:00
Jan (janneke) Nieuwenhuizen 5f73e64480
simple.make: Resurrect.
* simple.make (M2_PLANET_FLAGS): Add --bootstrap-mode.
(M2_SOURCES): Add lib/mes/globals.c.  Use lib/mes/mini-write.c instead
of lib/mes/write.c.  Use lib/m2/malloc.c instead of lib/stdlib/malloc.c.
(GCC_SOURCES): Add lib/mes/globals.c
(check-mescc): Set LIBRARY_PATH.
(m2): New target.
(m2/mes-m2.M1): Use it.
(m2/mes-m2.blood-elf.M1): Likewise.
2022-05-03 22:51:21 +02:00