Compare commits
242 Commits
Author | SHA1 | Date |
---|---|---|
|
cd47e75b40 | |
|
6d01e42d90 | |
|
5a2ec3a25d | |
|
ef72357720 | |
|
2eccd4c5c6 | |
|
a4fa47a108 | |
|
96cab3f473 | |
|
9f6289886e | |
|
ced43f82e2 | |
|
d23385f1e7 | |
|
76c1ecf561 | |
|
acd780cdb7 | |
|
5fdbbbb437 | |
|
94426fc9de | |
|
2e097282bb | |
|
bcf42b77d8 | |
|
932bbcd29e | |
|
d86ee0d865 | |
|
918843d293 | |
|
f4f59cf6ea | |
|
309350caaf | |
|
2b9bc8811b | |
|
530a500b99 | |
|
259e637648 | |
|
617505216a | |
|
63b95907be | |
|
f9ea638526 | |
|
df10261717 | |
|
cda11b45e8 | |
|
31e0399cf8 | |
|
7ffec691ee | |
|
dad2cfb78f | |
|
f3c1d28c97 | |
|
109ddb0050 | |
|
1eb54e07dc | |
|
1e66fd9c10 | |
|
063f1f624a | |
|
6aee0c4be9 | |
|
7314b22949 | |
|
fa8d126f82 | |
|
c6efcb0131 | |
|
633bf2065e | |
|
d795950830 | |
|
f51da8ebe3 | |
|
2b74160cf8 | |
|
f22f105dc5 | |
|
3c14911cd3 | |
|
7bb717edf4 | |
|
fc3cc134e9 | |
|
dac874f33d | |
|
cf9753a69a | |
|
7139e47b8e | |
|
f368451fe0 | |
|
25419a3db3 | |
|
e48b878931 | |
|
286a01a8f9 | |
|
19979f1833 | |
|
6651c02179 | |
|
e394e8709d | |
|
42bfa654eb | |
|
68075eb630 | |
|
5200ebe9ce | |
|
7ae490b22d | |
|
6a82c55d37 | |
|
7943e06b82 | |
|
5b7164b57f | |
|
4373de382a | |
|
4188c67d65 | |
|
38ce6e7570 | |
|
1cfbac8bd6 | |
|
6e2a17f676 | |
|
0b62cdf804 | |
|
a84edd1f17 | |
|
3ed01337e6 | |
|
e33bd137a1 | |
|
36c76bcc82 | |
|
7193dd1883 | |
|
a646915a67 | |
|
8fd472eef5 | |
|
d263c783a9 | |
|
f02e5b451c | |
|
9bee85fac2 | |
|
19003a3194 | |
|
786db24271 | |
|
4276b86737 | |
|
3114f3fa82 | |
|
0f5061cc04 | |
|
805cf421b6 | |
|
d7f66880d1 | |
|
69f948c565 | |
|
6d98cca297 | |
|
a5b28f1592 | |
|
13db32816d | |
|
5ba81f305f | |
|
560f98dfea | |
|
91acfe23b2 | |
|
cc3230cb4e | |
|
5b54da17f5 | |
|
14c1414559 | |
|
98f8c05522 | |
|
f49a3e91cf | |
|
daf0f69d44 | |
|
af70427461 | |
|
420c09a441 | |
|
063eaf3463 | |
|
d5bbf6cc26 | |
|
cfabfd3e68 | |
|
196e652381 | |
|
4aa7956eed | |
|
9d4aaf17bf | |
|
45b1c6962f | |
|
2426e9e46e | |
|
b69f63145e | |
|
bacd395f11 | |
|
890bf81909 | |
|
72f3a45832 | |
|
10675e138b | |
|
d9b414c167 | |
|
089d573db5 | |
|
e3829c60a3 | |
|
fabd2c9919 | |
|
2e220b0e91 | |
|
ee96c59bd5 | |
|
de692871a0 | |
|
0648637189 | |
|
640fae0a87 | |
|
19af685a5f | |
|
14507cc6cf | |
|
5e58fd90ee | |
|
f37bff1ba8 | |
|
e3e6226bde | |
|
eb71e29af3 | |
|
21cc15a186 | |
|
f30b251499 | |
|
303a06fd14 | |
|
849dc12ebb | |
|
738f4d1434 | |
|
e25f4df691 | |
|
48bbfbddd9 | |
|
d8e8f975ee | |
|
0a82dc1874 | |
|
47c142d701 | |
|
2e7beb34b1 | |
|
32ef607437 | |
|
1c5bd3e00e | |
|
6b3b07e637 | |
|
ad3b38ab48 | |
|
eedf43564c | |
|
ab8a65c919 | |
|
d899994b71 | |
|
c4ed8c232f | |
|
7f73c2bf1b | |
|
8ac6291dfb | |
|
fa9c0f37a5 | |
|
78312550b5 | |
|
2709fb2a8d | |
|
4a1396e000 | |
|
9bbcb02f94 | |
|
7b351fedc3 | |
|
df6905dfdb | |
|
d410f4cda4 | |
|
97dd467506 | |
|
e0b9160d34 | |
|
c80a752c87 | |
|
97a97d965b | |
|
6cd1427695 | |
|
77723fab38 | |
|
4b3f96bfaa | |
|
562aabd12e | |
|
6bfc27f08b | |
|
60f479cdb8 | |
|
5fe2b9dee6 | |
|
d73bd73f08 | |
|
5b336ddc96 | |
|
7c91df5b2e | |
|
997319d797 | |
|
565748b7b6 | |
|
b28dc21496 | |
|
a0ae0ade7f | |
|
09a1f46ab4 | |
|
740745fa62 | |
|
4694ddec16 | |
|
4943dffdf8 | |
|
356ffd50dc | |
|
feb415fc4a | |
|
c9d0ec5a47 | |
|
2d2f6745db | |
|
fcaf91c6bd | |
|
22fa7a19cf | |
|
6ceefd072d | |
|
2ea32bec1a | |
|
e1a589ae0c | |
|
47a6a1aa7b | |
|
ce0e5cf588 | |
|
8c67bc685f | |
|
dc88362b60 | |
|
69b5b60123 | |
|
54d1cea0cf | |
|
ddced02531 | |
|
4ffd9af6d6 | |
|
86a9546106 | |
|
430ffc228c | |
|
7af45e997a | |
|
4454a6920e | |
|
31707402a1 | |
|
3b504d923d | |
|
1024a4cb86 | |
|
efd6b78302 | |
|
3fb416a47c | |
|
f0530b91c5 | |
|
b5f6e2406c | |
|
a70918380f | |
|
4cf5a960d8 | |
|
f882050c0c | |
|
8fa2e0811c | |
|
92a78c8e88 | |
|
488123e6a2 | |
|
3501a8df81 | |
|
9a38e97c24 | |
|
fb5163b9ba | |
|
6aafc1ebe8 | |
|
3514f5d374 | |
|
12101462af | |
|
52a9bdead4 | |
|
72e796dc5c | |
|
7a40b50eec | |
|
e9169a2573 | |
|
3eced54810 | |
|
3e71bf17ff | |
|
d099d9ecb5 | |
|
b5fd3a6dd7 | |
|
932cf8af75 | |
|
8ca88d53f6 | |
|
57c6b629ae | |
|
35d74d17c1 | |
|
19aeaafd24 | |
|
821a8f3173 | |
|
9e96a7de8f | |
|
3bf243cac9 | |
|
b9f1fe8086 | |
|
4ac8d0cbdd | |
|
c9c8c40998 |
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Mes.
|
||||
;;;
|
||||
|
@ -35,6 +35,14 @@
|
|||
.
|
||||
((geiser-active-implementations . (guile))
|
||||
|
||||
;; Guile syntax
|
||||
(eval . (put 'pass-if 'scheme-indent-function 1))
|
||||
(eval . (put 'pass-if-not 'scheme-indent-function 1))
|
||||
(eval . (put 'pass-if-eq 'scheme-indent-function 2))
|
||||
(eval . (put 'pass-if-equal 'scheme-indent-function 2))
|
||||
(eval . (put 'expect-fail 'scheme-indent-function 2))
|
||||
(eval . (put 'pass-if-timeout 'scheme-indent-function 2))
|
||||
|
||||
;; Guix package
|
||||
(eval . (put 'package 'scheme-indent-function 0))
|
||||
(eval . (put 'origin 'scheme-indent-function 0))
|
||||
|
@ -50,6 +58,7 @@
|
|||
|
||||
(eval
|
||||
.
|
||||
|
||||
(progn
|
||||
(defun prefix-dir-locals-dir (elt)
|
||||
(concat (locate-dominating-file buffer-file-name ".dir-locals.el") elt))
|
||||
|
|
|
@ -33,30 +33,45 @@
|
|||
*.mini-hex2
|
||||
*.a
|
||||
*.o
|
||||
*.h.m2
|
||||
*.c.m2
|
||||
*.seed-out
|
||||
*.stderr
|
||||
*.stdout
|
||||
|
||||
*.x86-out
|
||||
|
||||
/TAGS
|
||||
|
||||
/lib/x86-mes/0exit-42
|
||||
/lib/x86-mes/exit-42
|
||||
|
||||
/lib/tests/*/[0-9a][0-9a-z]-*
|
||||
!/lib/tests/*/*.c
|
||||
!/lib/tests/*/*.exit
|
||||
!/lib/tests/*/*.stdout
|
||||
|
||||
/scaffold/*.M1
|
||||
/scaffold/*.m2
|
||||
/scaffold/*.hex2
|
||||
/scaffold/argv
|
||||
/scaffold/hello
|
||||
/scaffold/main
|
||||
/scaffold/micro-mes
|
||||
/scaffold/read
|
||||
/scaffold/tiny-mes
|
||||
|
||||
/scaffold/tests/[0-9a][0-9a-z]-*
|
||||
/scaffold/tests/t.*
|
||||
!/scaffold/tests/*.c
|
||||
!/scaffold/tests/*.exit
|
||||
!/scaffold/tests/*.stdout
|
||||
/scaffold/argv-m2
|
||||
/scaffold/hello-m2
|
||||
/scaffold/main-m2
|
||||
/scaffold/micro-mes-m2
|
||||
/scaffold/read-m2
|
||||
/scaffold/tiny-mes-m2
|
||||
|
||||
/.config.make
|
||||
/.store
|
||||
/.tarball-version
|
||||
|
||||
/out
|
||||
?
|
||||
?.mes
|
||||
\#*#
|
||||
|
|
14
AUTHORS
14
AUTHORS
|
@ -13,6 +13,8 @@ Additions and fixes throughout
|
|||
Jeremiah Orians <jeremiah@pdp10.guru>
|
||||
lib/stdio/fopen.c (first simple version of fopen)
|
||||
scaffold/tests/98-fopen.c
|
||||
Initial work on elf headers:
|
||||
lib/linux/x86-mes/elf32-header.hex2 and similar
|
||||
|
||||
Han-Wen Nienhuys <hanwen@xs4all.nl>
|
||||
lib/string/memmem.c (_memmem, memmem)
|
||||
|
@ -32,6 +34,9 @@ Nathalie Kopaczewski <natkopa@gmail.com>
|
|||
Fast long devision
|
||||
lib/div.c (__mesabi_log2i)
|
||||
|
||||
W. J. van der Laan <laanwj@protonmail.com>
|
||||
Bugfixes for logand, 64bit build, and va_arg
|
||||
|
||||
List of imported files
|
||||
|
||||
D A Gwyn
|
||||
|
@ -56,11 +61,8 @@ module/mes/getopt-long.scm
|
|||
Optargs from Guile
|
||||
mes/module/mes/optargs.scm
|
||||
|
||||
PEG from Guile
|
||||
mes/module/mes/peg/
|
||||
|
||||
Pmatch from Guile
|
||||
mes/module/mes/pmatch.scm
|
||||
mes/module/system/base/pmatch.scm
|
||||
|
||||
Pretty-print from Guile
|
||||
mes/module/mes/pretty-print.scm
|
||||
|
@ -84,6 +86,10 @@ lib/mach/msg.c
|
|||
lib/mach/mach-init.c
|
||||
lib/mach/*.S
|
||||
|
||||
M2-Planet dependencies
|
||||
lib/m2/x86/x86_defs.M1
|
||||
lib/m2/x86/ELF-x86.hex2
|
||||
|
||||
* legalese
|
||||
Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
|
||||
|
|
21
HACKING
21
HACKING
|
@ -2,7 +2,7 @@
|
|||
#+TITLE: Hacking GNU Mes
|
||||
|
||||
* SETUP
|
||||
guix environment -l guix.scm #64 bit + 32bit
|
||||
guix shell #64 bit + 32bit
|
||||
|
||||
CC=i686-unknown-linux-gnu-gcc ./configure
|
||||
CC=arm-unknown-linux-gnu-gcc ./configure
|
||||
|
@ -49,6 +49,23 @@ Configure to compile with Tiny CC
|
|||
- bytes read
|
||||
6) globals
|
||||
|
||||
* TESTING
|
||||
** make check recheck=true TESTS="tests/base lib/tests/scaffold/t.c"
|
||||
** mescc
|
||||
|
||||
*** To skip MES tests, in "./check.sh", comment-out check-boot.sh, check-mes.sh.
|
||||
|
||||
*** Running individual tests
|
||||
#+BEGIN_SRC bash
|
||||
cd gcc-lib
|
||||
V=2 CC=i686-unknown-linux-gnu-gcc ../pre-inst-env test-c.sh ../lib/tests/scaffold/t.c
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC bash
|
||||
cd mescc-lib
|
||||
V=2 CC=mescc ../pre-inst-env test-c.sh ../lib/tests/scaffold/t.c
|
||||
#+END_SRC
|
||||
|
||||
* Bugs
|
||||
** mes: performance, Mes is now 2-10x slower than Guile.
|
||||
** mes/mescc lack support for fork/exec on the Hurd.
|
||||
|
@ -184,7 +201,7 @@ https://notabug.org/rain1/hex86/src/master/tests/hex0b3.hex86
|
|||
** linux syscalls: https://fedora.juszkiewicz.com.pl/syscalls.html
|
||||
* legalese
|
||||
|
||||
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
|
17
INSTALL
17
INSTALL
|
@ -1,7 +1,7 @@
|
|||
-*- org -*-
|
||||
#+TITLE: Building and Installing GNU Mes
|
||||
|
||||
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
@ -20,20 +20,20 @@ similar way.
|
|||
** Prerequisites
|
||||
*** Guix
|
||||
#+BEGIN_SRC bash
|
||||
guix environment -l guix.scm #64 bit + 32bit
|
||||
guix environment --system=i686-linux -l guix.scm #32 bit only
|
||||
guix environment --system=armhf-linux -l guix.scm #32 bit only
|
||||
guix shell #64 bit + 32bit
|
||||
guix shell --system=i686-linux #32 bit only
|
||||
guix shell --system=armhf-linux #32 bit only
|
||||
#+END_SRC
|
||||
|
||||
*** Other GNU/Linux
|
||||
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 0.7.0 is known to work.
|
||||
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.0.1 is known to work.
|
||||
- [[https://github.com/oriansj/m2-planet][M2-Planet]] (optional), 1.8.0 is known to work.
|
||||
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
|
||||
- GNU Gcc, 7.5.0 is known to work.
|
||||
- GNU Guile, version 3.0.4 is know to work.
|
||||
- SH, /bin/sh, GNU Bash 5.0.16 is known to work.
|
||||
- GNU coreutils
|
||||
- sed, GNU sed 4.8 is known to work.
|
||||
- Perl, 5.30 is known to work.
|
||||
|
||||
** Build it
|
||||
|
||||
|
@ -79,8 +79,9 @@ The bootstrap build is part of Guix, see
|
|||
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm
|
||||
|
||||
** Prerequisites
|
||||
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 0.6.1 is known to work.
|
||||
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.93.0 is known to work.
|
||||
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.0.1 is known to work.
|
||||
- [[https://github.com/oriansj/m2-planet][M2-Planet]], 1.8.0 is known to work.
|
||||
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
|
||||
|
||||
** Build it
|
||||
|
||||
|
|
16
NEWS
16
NEWS
|
@ -2,7 +2,7 @@
|
|||
#+TITLE: GNU Mes NEWS – history of user-visible changes
|
||||
#+STARTUP: content hidestars
|
||||
|
||||
Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
@ -10,6 +10,20 @@ Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.o
|
|||
|
||||
Please send Mes bug reports to bug-mes@gnu.org.
|
||||
|
||||
* Changes in 0.24 since 0.23
|
||||
** Core
|
||||
*** Mes and Mes C Library can now be built with M2-Planet.
|
||||
*** Mes now supports the --bootstrap build on ARM.
|
||||
** MesCC
|
||||
*** MesCC now supports the integer suffixes:
|
||||
Next to `U', also support `ULL', `UL', `L', and `LL'.
|
||||
** Noteworthy bug fixes
|
||||
*** MesCC now uses the unsigned type for sizeof.
|
||||
*** MesCC now only uses signed division if numerator is signed.
|
||||
*** The Mes C library now supports an argv bigger than 255.
|
||||
*** Development build support with Guile-2 was resurrected.
|
||||
*** The logand procedure now works correctly.
|
||||
*** The 64bit build was resurrected.
|
||||
* Changes in 0.23 since 0.22
|
||||
** Core
|
||||
*** Mes and Mes C Library can now be built with GCC 10.x.
|
||||
|
|
4
PORTING
4
PORTING
|
@ -22,7 +22,7 @@ to your config.scm and run guix system reconfigure.
|
|||
|
||||
For example (note: ARM is no longer a 'port', see HACKING)
|
||||
#+BEGIN_SRC bash
|
||||
guix environment --system=armhf-linux --pure --ad-hoc bash coreutils diffutils findutils gawk gcc-toolchain@7 grep git guile@2.2 gzip help2man make mescc-tools nyacc openssh-sans-x pkg-config sed tar texinfo
|
||||
guix shell --system=armhf-linux --pure bash coreutils diffutils findutils gawk gcc-toolchain@7 grep git guile@2.2 gzip help2man make mescc-tools nyacc openssh-sans-x pkg-config sed tar texinfo
|
||||
#+END_SRC
|
||||
|
||||
** Try it
|
||||
|
@ -75,7 +75,7 @@ a Reduced Binary seed, thus significantly reducing the Trusted Computing
|
|||
Base (TCB), strategic decisions about the build process can start.
|
||||
|
||||
* Legalese
|
||||
Copyright © 2019 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
|
||||
Copyright © 2019,2022 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
|
28
README
28
README
|
@ -11,8 +11,8 @@ create a full source bootstrap as part of the [[http://bootstrappable.org][boots
|
|||
effort for UNIX-like operating systems.
|
||||
|
||||
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
|
||||
compiler written in Scheme and these are mutual self-hosting. This
|
||||
mes.c is now being simplified to be transpiled by [[https://github.com/oriansj/m2-planet][M2-Planet]].
|
||||
compiler written in Scheme and these are mutual self-hosting. Mes can
|
||||
now be bootstrapped by [[https://github.com/oriansj/m2-planet][M2-Planet]] and [[https://savannah.nongnu.org/projects/mescc-tools][Mescc-Tools]].
|
||||
|
||||
Mes has a Garbage Collector, a library of loadable Scheme modules--
|
||||
notably Dominique Boucher's [[https://github.com/schemeway/lalr-scm][LALR]], Pre-R6RS [[https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html][portable syntax-case]] with
|
||||
|
@ -29,8 +29,8 @@ Mes is inspired by The Maxwell Equations of Software: [[http://www.softwareprese
|
|||
McCarthy page 13, GNU Guix's source/binary packaging transparency and
|
||||
Jeremiah Orians's [[https://github.com/oriansj/stage0][stage0]] ~500 byte self-hosting hex assembler.
|
||||
|
||||
We are very grateful to NLNet for sponsoring the
|
||||
[[https://nlnet.nl/project/GNUMes][Reduced Binary Seed bootstrap]] and the [[https://nlnet.nl/project/GNUMes-arm][ARM port]].
|
||||
We are very grateful to NLNet for sponsoring the [[https://nlnet.nl/project/GNUMes][Reduced Binary Seed
|
||||
bootstrap]], the [[https://nlnet.nl/project/GNUMes-arm][ARM port]], and the [[https://nlnet.nl/project/GNUMes-ARM_RISC-V][Full Source Bootstrap.]]
|
||||
|
||||
GNU Mes is free software, it is distributed under the terms of the GNU
|
||||
General Public Licence version 3 or later. See the file [[file:COPYING][COPYING]].
|
||||
|
@ -71,17 +71,19 @@ General Public Licence version 3 or later. See the file [[file:COPYING][COPYING
|
|||
[2] https://www.gnu.org/software/guix
|
||||
[3] https://bootstrappable.org
|
||||
[4] https://github.com/oriansj/m2-planet
|
||||
[5] https://github.com/schemeway/lalr-scm
|
||||
[6] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
|
||||
[7] https://www.nongnu.org/nyacc
|
||||
[8] https://gitlab.com/janneke/tinycc
|
||||
[9] [[http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf]]
|
||||
[10] https://github.com/oriansj/stage0
|
||||
[11] https://nlnet.nl/project/GNUMes
|
||||
[12] https://nlnet.nl/project/GNUMes-arm
|
||||
[5] https://savannah.nongnu.org/projects/mescc-tools
|
||||
[6] https://github.com/schemeway/lalr-scm
|
||||
[7] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
|
||||
[8] https://www.nongnu.org/nyacc
|
||||
[9] https://gitlab.com/janneke/tinycc
|
||||
[10] [[http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf]]
|
||||
[11] https://savannah.nongnu.org/projects/stage0
|
||||
[12] https://nlnet.nl/project/GNUMes
|
||||
[13] https://nlnet.nl/project/GNUMes-arm
|
||||
[14] https://nlnet.nl/project/GNUMes-ARM_RISC-V
|
||||
|
||||
* Legalese
|
||||
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
|
||||
Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
|
|
@ -135,7 +135,7 @@ maintainer-clean: distclean
|
|||
rm -f doc/version.texi
|
||||
|
||||
TAGS:
|
||||
etags ${srcdest}lib/*.c ${srcdest}lib/*/*.c ${srcdest}src/*.c ${srcdest}include/*.h ${srcdest}include/sys/*.h
|
||||
etags ${srcdest}lib/*.c ${srcdest}lib/*/*.c ${srcdest}src/*.c ${srcdest}include/*.h ${srcdest}include/*/*.h ${srcdest}include/sys/*.h
|
||||
|
||||
all-go:
|
||||
${srcdest}build-aux/build-guile.sh
|
||||
|
@ -367,14 +367,14 @@ GPG_KEY_ID:=1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
|
|||
GEN_ANNOUNCE=$(GNULIB)/build-aux/announce-gen
|
||||
GNULIB=../../gnulib
|
||||
gen-announce:
|
||||
$(GEN_ANNOUNCE)\
|
||||
--release-type=beta\
|
||||
--package-name=mes\
|
||||
--previous-version='0.22 '\
|
||||
--current-version=$(VERSION)\
|
||||
--gpg-key-id=$(GPG_KEY_ID)\
|
||||
--url-directory=https://ftp.gnu.org/gnu/mes\
|
||||
--news=NEWS\
|
||||
$(GEN_ANNOUNCE) \
|
||||
--release-type=beta \
|
||||
--package-name=mes \
|
||||
--previous-version='0.23 ' \
|
||||
--current-version=$(VERSION) \
|
||||
--gpg-key-id=$(GPG_KEY_ID) \
|
||||
--url-directory=https://ftp.gnu.org/gnu/mes \
|
||||
--news=NEWS \
|
||||
> doc/announce/ANNOUNCE-$(VERSION)
|
||||
|
||||
installdirs: mkinstalldirs
|
||||
|
|
|
@ -35,6 +35,11 @@ MES_PREFIX=${MES_PREFIX-$PWD}
|
|||
. ${srcdest}build-aux/configure-lib.sh
|
||||
. ${srcdest}build-aux/cflags.sh
|
||||
|
||||
if test -n "@M2_PLANET@"; then
|
||||
echo " KAEM kaem.run"
|
||||
kaem --strict --verbose
|
||||
fi
|
||||
|
||||
CPPFLAGS="-D HAVE_CONFIG_H=1 -I include"
|
||||
libdir=$PWD/lib
|
||||
export libdir
|
||||
|
|
|
@ -30,24 +30,11 @@ fi
|
|||
. ./config.sh
|
||||
. ${srcdest}build-aux/trace.sh
|
||||
. ${srcdest}build-aux/cc.sh
|
||||
. ${srcdest}build-aux/configure-lib.sh
|
||||
|
||||
trap 'test -f .log && cat .log' EXIT
|
||||
|
||||
mes_sources="
|
||||
src/gc.c
|
||||
src/hash.c
|
||||
src/lib.c
|
||||
src/math.c
|
||||
src/mes.c
|
||||
src/module.c
|
||||
src/posix.c
|
||||
src/reader.c
|
||||
src/string.c
|
||||
src/struct.c
|
||||
src/vector.c
|
||||
"
|
||||
|
||||
for c in $mes_sources; do
|
||||
for c in $mes_SOURCES; do
|
||||
compile $c
|
||||
done
|
||||
if test $mes_libc = system; then
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -30,18 +30,6 @@ fi
|
|||
. ./config.sh
|
||||
. ${srcdest}build-aux/trace.sh
|
||||
|
||||
if $courageous; then
|
||||
set +e
|
||||
set_min_e () {
|
||||
echo "Applying courage"
|
||||
}
|
||||
set_min_e
|
||||
else
|
||||
set_min_e () {
|
||||
set -e
|
||||
}
|
||||
fi
|
||||
|
||||
case "$mes_cpu" in
|
||||
arm)
|
||||
stage0_arch=40
|
||||
|
@ -61,6 +49,18 @@ case "$mes_cpu" in
|
|||
;;
|
||||
esac
|
||||
|
||||
if $courageous; then
|
||||
set +e
|
||||
set_min_e () {
|
||||
echo "Applying courage"
|
||||
}
|
||||
set_min_e
|
||||
else
|
||||
set_min_e () {
|
||||
set -e
|
||||
}
|
||||
fi
|
||||
|
||||
trace "CCLD ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/exit-42.S" $CC\
|
||||
-nostdlib\
|
||||
-g\
|
||||
|
@ -79,9 +79,9 @@ else
|
|||
fi
|
||||
|
||||
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2" $HEX2\
|
||||
--LittleEndian\
|
||||
--little-endian\
|
||||
$stage0_cpu_flag\
|
||||
--BaseAddress 0x1000000\
|
||||
--base-address 0x1000000\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2\
|
||||
--exec_enable\
|
||||
|
@ -93,9 +93,9 @@ trace "TEST 0exit-42"
|
|||
[ $r = 42 ]
|
||||
|
||||
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2" $HEX2\
|
||||
--LittleEndian\
|
||||
--little-endian\
|
||||
$stage0_cpu_flag\
|
||||
--BaseAddress 0x1000000\
|
||||
--base-address 0x1000000\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-footer-single-main.hex2\
|
||||
|
@ -120,9 +120,9 @@ trace "TEST hello-mes"
|
|||
[ $r = 0 ]
|
||||
|
||||
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2" $HEX2\
|
||||
--LittleEndian\
|
||||
--little-endian\
|
||||
$stage0_cpu_flag\
|
||||
--BaseAddress 0x1000000\
|
||||
--base-address 0x1000000\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2\
|
||||
--exec_enable\
|
||||
|
@ -134,9 +134,9 @@ trace "TEST 0hello-mes"
|
|||
[ $r = 0 ]
|
||||
|
||||
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2" $HEX2\
|
||||
--LittleEndian\
|
||||
--little-endian\
|
||||
$stage0_cpu_flag\
|
||||
--BaseAddress 0x1000000\
|
||||
--base-address 0x1000000\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2\
|
||||
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-footer-single-main.hex2\
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -38,6 +38,25 @@ set -u
|
|||
. ./config.sh
|
||||
. ${srcdest}build-aux/cflags.sh
|
||||
|
||||
case "$mes_cpu" in
|
||||
arm)
|
||||
stage0_arch=40
|
||||
stage0_cpu=armv7l
|
||||
;;
|
||||
x86_64)
|
||||
stage0_arch=2
|
||||
stage0_cpu=amd64
|
||||
;;
|
||||
x86)
|
||||
stage0_arch=1
|
||||
stage0_cpu=x86
|
||||
;;
|
||||
*)
|
||||
stage0_arch=1
|
||||
stage0_cpu=$mes_cpu
|
||||
;;
|
||||
esac
|
||||
|
||||
if $courageous; then
|
||||
echo "Applying courage"
|
||||
set +e
|
||||
|
@ -97,11 +116,27 @@ fi
|
|||
-I ${srcdest}include
|
||||
-I ${srcdest}include/$mes_kernel/$mes_cpu
|
||||
"
|
||||
if test $compiler = gcc; then
|
||||
if test "$compiler" != bootstrap; then
|
||||
${SHELL} ${srcdest}build-aux/build-mes.sh
|
||||
fi
|
||||
)
|
||||
|
||||
if test -n "$M2_PLANET"; then
|
||||
(
|
||||
. ${srcdest}build-aux/trace.sh
|
||||
if [ -z "$V" -o "$V" = 0 ]; then
|
||||
__verbose=
|
||||
else
|
||||
__verbose=--verbose
|
||||
fi
|
||||
trace "KAEM scaffold/main.kaem" kaem --strict $__verbose -f scaffold/main.kaem
|
||||
trace "KAEM scaffold/hello.kaem" kaem --strict $__verbose -f scaffold/hello.kaem
|
||||
trace "KAEM scaffold/argv.kaem" kaem --strict $__verbose -f scaffold/argv.kaem
|
||||
trace "KAEM scaffold/read.kaem" kaem --strict $__verbose -f scaffold/read.kaem
|
||||
trace "KAEM kaem.run" kaem --strict $__verbose
|
||||
)
|
||||
fi
|
||||
|
||||
(
|
||||
mkdir -p mescc-lib
|
||||
cp config.sh mescc-lib
|
||||
|
|
|
@ -110,6 +110,7 @@ scaffold/boot/50-primitive-load.scm
|
|||
scaffold/boot/53-closure-display.scm
|
||||
scaffold/boot/60-let-syntax.scm
|
||||
scaffold/boot/call-cc.scm
|
||||
scaffold/boot/gc.scm
|
||||
scaffold/boot/memory.scm
|
||||
scaffold/boot/numbers.scm
|
||||
"
|
||||
|
|
|
@ -27,6 +27,7 @@ tests/boot.test
|
|||
tests/read.test
|
||||
tests/srfi-0.test
|
||||
tests/macro.test
|
||||
tests/gc.test
|
||||
tests/perform.test
|
||||
tests/base.test
|
||||
tests/quasiquote.test
|
||||
|
|
|
@ -105,6 +105,7 @@ lib/tests/assert/50-assert.c
|
|||
lib/tests/mes/50-itoa.c
|
||||
lib/tests/posix/50-getenv.c
|
||||
lib/tests/stdlib/50-malloc.c
|
||||
lib/tests/string/50-memcmp.c
|
||||
lib/tests/string/50-strcmp.c
|
||||
lib/tests/string/50-strcmp-itoa.c
|
||||
lib/tests/string/50-strcpy.c
|
||||
|
|
|
@ -35,8 +35,10 @@ GUIX="@GUIX@"
|
|||
HELP2MAN="@HELP2MAN@"
|
||||
HEX2="@HEX2@"
|
||||
LDFLAGS=${LDFLAGS-"@LDFLAGS@"}
|
||||
KAEM="@KAEM@"
|
||||
MAKEINFO="@MAKEINFO@"
|
||||
M1="@M1@"
|
||||
M2_PLANET="@M2_PLANET@"
|
||||
MES_FOR_BUILD="@MES_FOR_BUILD@"
|
||||
NYACC="@NYACC@"
|
||||
PACKAGE="@PACKAGE@"
|
||||
|
@ -99,8 +101,10 @@ export V
|
|||
export colors
|
||||
export compiler
|
||||
export courageous
|
||||
export mes_cpu
|
||||
export srcdest
|
||||
export srcdir
|
||||
export stage0_cpu
|
||||
export GUILE_AUTO_COMPILE
|
||||
export MES_PREFIX
|
||||
export TESTS
|
||||
|
|
|
@ -93,6 +93,7 @@ libmes_SOURCES="
|
|||
$libc_mini_shared_SOURCES
|
||||
lib/ctype/isnumber.c
|
||||
lib/mes/abtol.c
|
||||
lib/mes/cast.c
|
||||
lib/mes/eputc.c
|
||||
lib/mes/fdgetc.c
|
||||
lib/mes/fdputc.c
|
||||
|
@ -106,6 +107,7 @@ lib/mes/ntoab.c
|
|||
lib/mes/oputc.c
|
||||
lib/mes/ultoa.c
|
||||
lib/mes/utoa.c
|
||||
lib/stub/__raise.c
|
||||
"
|
||||
|
||||
if test $mes_libc = mes; then
|
||||
|
@ -113,6 +115,7 @@ if test $mes_libc = mes; then
|
|||
lib/ctype/isdigit.c
|
||||
lib/ctype/isspace.c
|
||||
lib/ctype/isxdigit.c
|
||||
lib/mes/assert_msg.c
|
||||
lib/posix/write.c
|
||||
lib/stdlib/atoi.c
|
||||
"
|
||||
|
@ -186,7 +189,7 @@ lib/stub/execve.c
|
|||
lib/stub/fork.c
|
||||
lib/stub/_getcwd.c
|
||||
lib/stub/gettimeofday.c
|
||||
lib/stub/ioctl.c
|
||||
lib/stub/ioctl3.c
|
||||
lib/stub/time.c
|
||||
lib/stub/unlink.c
|
||||
lib/stub/waitpid.c
|
||||
|
@ -206,7 +209,7 @@ lib/linux/fork.c
|
|||
lib/linux/fsync.c
|
||||
lib/linux/_getcwd.c
|
||||
lib/linux/gettimeofday.c
|
||||
lib/linux/ioctl.c
|
||||
lib/linux/ioctl3.c
|
||||
lib/linux/_open3.c
|
||||
lib/linux/malloc.c
|
||||
lib/linux/_read.c
|
||||
|
@ -411,6 +414,7 @@ lib/linux/getgid.c
|
|||
lib/linux/getppid.c
|
||||
lib/linux/getrusage.c
|
||||
lib/linux/getuid.c
|
||||
lib/linux/ioctl.c
|
||||
lib/linux/link.c
|
||||
lib/linux/lstat.c
|
||||
lib/linux/mkdir.c
|
||||
|
@ -429,7 +433,13 @@ lib/linux/symlink.c
|
|||
fi
|
||||
|
||||
mes_SOURCES="
|
||||
src/builtins.c
|
||||
src/cc.c
|
||||
src/core.c
|
||||
src/display.c
|
||||
src/eval-apply.c
|
||||
src/gc.c
|
||||
src/globals.c
|
||||
src/hash.c
|
||||
src/lib.c
|
||||
src/math.c
|
||||
|
@ -437,7 +447,9 @@ src/mes.c
|
|||
src/module.c
|
||||
src/posix.c
|
||||
src/reader.c
|
||||
src/stack.c
|
||||
src/string.c
|
||||
src/struct.c
|
||||
src/symbol.c
|
||||
src/vector.c
|
||||
"
|
||||
|
|
|
@ -50,6 +50,7 @@ export mes_cpu
|
|||
export mes_bits
|
||||
export mes_libc
|
||||
export mes_kernel
|
||||
export stage0_cpu
|
||||
|
||||
ifdef V
|
||||
export V
|
||||
|
|
|
@ -47,6 +47,9 @@ cp $_v bin/mes ${DESTDIR}${bindir}/mes
|
|||
if test -f bin/mes-gcc; then
|
||||
cp $_v bin/mes-gcc ${DESTDIR}${bindir}/mes-gcc
|
||||
fi
|
||||
if test -f bin/mes-m2; then
|
||||
cp $_v bin/mes-m2 ${DESTDIR}${bindir}/mes-m2
|
||||
fi
|
||||
if test -f bin/mes-mescc; then
|
||||
cp $_v bin/mes-mescc ${DESTDIR}${bindir}/mes-mescc
|
||||
fi
|
||||
|
|
|
@ -4,7 +4,7 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
!#
|
||||
|
||||
;;; GNU Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; mes-snarf.scm: This file is part of GNU Mes.
|
||||
;;;
|
||||
|
@ -85,8 +85,7 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
(cut string-replace-string <> "_to_" "->")
|
||||
(cut string-replace-suffix <> "_x" "!")
|
||||
(cut string-replace-suffix <> "_x_" "!-")
|
||||
(cut string-replace-suffix <> "_p" "?")
|
||||
)
|
||||
(cut string-replace-suffix <> "_p" "?"))
|
||||
(function.name f))))
|
||||
(if (not (string-suffix? "-" name)) name
|
||||
(string-append "core:" (string-drop-right name 1))))))
|
||||
|
@ -105,19 +104,26 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
(format #f "// CONSTANT ~a ~a\n" s i)
|
||||
(format #f "#define ~a ~a\n" s i)))
|
||||
|
||||
(define (symbol->header s i)
|
||||
(let ((c (string-upcase s)))
|
||||
(string-append
|
||||
(format #f "\n// CONSTANT ~a ~a\n" c i)
|
||||
(format #f "#define ~a ~a\n" c i)
|
||||
(format #f "struct scm *~a; /* ~a */\n" s i))))
|
||||
|
||||
(define (function->header f i)
|
||||
(let* ((arity (or (assoc-ref (function.annotation f) 'arity)
|
||||
(if (string-null? (function.formals f)) 0
|
||||
(length (string-split (function.formals f) #\,)))))
|
||||
(n (if (eq? arity 'n) -1 arity)))
|
||||
(format #f "SCM ~a (~a);\n" (function.name f) (function.formals f))))
|
||||
(format #f "struct scm *~a (~a);\n" (function.name f) (function.formals f))))
|
||||
|
||||
(define (function->source f i)
|
||||
(let* ((arity (or (assoc-ref (function.annotation f) 'arity)
|
||||
(if (string-null? (function.formals f)) 0
|
||||
(length (string-split (function.formals f) #\,)))))
|
||||
(n (if (eq? arity 'n) -1 arity)))
|
||||
(format #f " a = init_builtin (builtin_type, ~s, ~a, &~a, a);\n" (function.name f) n (function.name f))))
|
||||
(format #f " a = init_builtin (builtin_type, ~s, ~a, &~a, a);\n" (function-scm-name f) n (function.name f))))
|
||||
|
||||
(define (disjoin . predicates)
|
||||
(lambda (. arguments)
|
||||
|
@ -125,11 +131,11 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
|
||||
(define (snarf-symbols string)
|
||||
(let* ((lines (string-split string #\newline))
|
||||
(symbols (filter (cut string-prefix? " init_symbol (" <>) lines)))
|
||||
(symbols (filter (cut string-contains <> " = init_symbol (") lines)))
|
||||
(define (line->symbol line)
|
||||
((compose
|
||||
(lambda (s) (string-take s (string-index s #\,)))
|
||||
(cut string-drop <> (string-length " init_symbol (")))
|
||||
string-trim-both
|
||||
(lambda (s) (string-take s (string-index s #\=))))
|
||||
line))
|
||||
(map line->symbol symbols)))
|
||||
|
||||
|
@ -144,20 +150,28 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
(receive (function rest)
|
||||
(apply values (string-split-string line " "))
|
||||
(and function
|
||||
(equal? (string-trim previous) "SCM")
|
||||
(or (equal? (string-trim previous) "struct scm*")
|
||||
(equal? (string-trim previous) "struct scm *"))
|
||||
(not (string-null? function))
|
||||
(not (string-prefix? "#" function))
|
||||
(not (string-prefix? "/" function))
|
||||
rest
|
||||
(receive (parameter-list annotation)
|
||||
(apply values (string-split-string rest " ///"))
|
||||
(let* ((parameters (string-drop parameter-list 1))
|
||||
(apply values (string-split-string rest " /*:"))
|
||||
(let* ((parameters (string-trim-both parameter-list))
|
||||
(parameters (string-drop parameters 1))
|
||||
(parameters (string-drop-right parameters 1))
|
||||
(annotation (if (string? annotation) (string-trim-both annotation)
|
||||
annotation))
|
||||
(annotation (if (and (string? annotation)
|
||||
(string-suffix? "*/" annotation))
|
||||
(string-drop-right annotation 2)
|
||||
annotation))
|
||||
(formals (if (string-null? parameters) '()
|
||||
(string-split parameters #\,)))
|
||||
(formals (map string-trim formals)))
|
||||
(and parameters
|
||||
(let* ((non-SCM (filter (negate (cut string-prefix? "SCM" <>)) formals)))
|
||||
(let* ((non-SCM (filter (negate (cut string-prefix? "struct scm" <>)) formals)))
|
||||
(and (null? non-SCM)
|
||||
(let ((annotation (and annotation (with-input-from-string annotation read))))
|
||||
(make-function function parameters annotation))))))))))
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
#! /bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
ptr_once='s,([^N])(MACRO|NAME|VALUE) \(([^()]*)\),\1\3->\L\2,'
|
||||
ptr_once='s,([^N])(BYTES|CAR|CDR|CLOSURE|CONTINUATION|LENGTH|MACRO|NAME|PORT|REF|STRING|STRUCT|TYPE|VALUE|VARIABLE|VECTOR) \(([^()]*)\),\1\3->\L\2,'
|
||||
n_once='s,N(TYPE|CAR|CDR|LENGTH|VALUE|VECTOR) \(([^()]*)\),\2->\L\1,'
|
||||
ncbytes='s,NC(BYTES) \(([^()]*)\),news_\L\1 (\2),'
|
||||
cbytes='s,([^N])C(BYTES) \(([^()]*)\),\1cell_\L\2 (\3),'
|
||||
cstring='s,C(STRING) \(([^()]*)\),cell_bytes (STRING (\2)),'
|
||||
struct='s,SCM,struct scm *,g'
|
||||
struct_scm_p='s,struct scm\* ?,struct scm *,g'
|
||||
|
||||
sed -ri \
|
||||
-e 's,POINTER_CELLS=0,POINTER_CELLS=1', \
|
||||
-e 's,#define POINTER_CELLS 0,#define POINTER_CELLS 1', \
|
||||
-e "$ncbytes" \
|
||||
-e "$cbytes" \
|
||||
-e "$cstring" \
|
||||
\
|
||||
-e "$ncbytes" \
|
||||
-e "$cbytes" \
|
||||
-e "$cstring" \
|
||||
\
|
||||
-e "$ptr_once" \
|
||||
-e "$ptr_once" \
|
||||
-e "$ptr_once" \
|
||||
-e 's,->\<struct\>,->structure,g' \
|
||||
-e "$struct" \
|
||||
-e "$struct_scm_p" \
|
||||
\
|
||||
-e "$n_once" \
|
||||
-e "$n_once" \
|
||||
\
|
||||
-e 's,CAR \(([^()]*)\),\1->cdr,' \
|
||||
-e 's,CAAR \(([^()]*)\),\1->car->car,' \
|
||||
-e 's,CADR \(([^()]*)\),\1->cdr->car,' \
|
||||
-e 's,CDAR \(([^()]*)\),\1->car->cdr,' \
|
||||
-e 's,CDDR \(([^()]*)\),\1->cdr->cdr,' \
|
||||
-e 's,CADAR \(([^()]*)\),\1->car->cdr->car,' \
|
||||
-e 's,CADDR \(([^()]*)\),\1->cdr->cdr->car,' \
|
||||
-e 's,CDADR \(([^()]*)\),\1->cdr->car->cdr,' \
|
||||
-e 's,CDDDR \(([^()]*)\),\1->cdr->cdr->cdr,' \
|
||||
-e 's,CDDAR \(([^()]*)\),\1->car->cdr->cdr,' \
|
||||
-e 's,CDADAR \(([^()]*)\),\1->cdr->car->cdr->car,' \
|
||||
\
|
||||
include/mes/builtins.h \
|
||||
include/mes/mes.h \
|
||||
include/mes/symbols.h \
|
||||
include/mes/builtins.h \
|
||||
include/m2/lib.h \
|
||||
src/builtins.c \
|
||||
src/cc.c \
|
||||
src/core.c \
|
||||
src/display.c \
|
||||
src/eval-apply.c \
|
||||
src/gc.c \
|
||||
src/hash.c \
|
||||
src/lib.c \
|
||||
src/m2.c \
|
||||
src/math.c \
|
||||
src/mes.c \
|
||||
src/module.c \
|
||||
src/posix.c \
|
||||
src/reader.c \
|
||||
src/stack.c \
|
||||
src/string.c \
|
||||
src/struct.c \
|
||||
src/symbol.c \
|
||||
src/vector.c \
|
||||
src/test/gc.c \
|
||||
simple.make \
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -20,17 +20,43 @@
|
|||
|
||||
set -e
|
||||
|
||||
. ${srcdest}build-aux/config.sh
|
||||
srcdest=${srcdest-./}
|
||||
. ${srcdest}config.sh
|
||||
. ${srcdest}build-aux/trace.sh
|
||||
|
||||
trace "SNARF$snarf gc.c" ${srcdest}build-aux/mes-snarf.scm src/gc.c
|
||||
trace "SNARF$snarf hash.c" ${srcdest}build-aux/mes-snarf.scm src/hash.c
|
||||
trace "SNARF$snarf lib.c" ${srcdest}build-aux/mes-snarf.scm src/lib.c
|
||||
trace "SNARF$snarf math.c" ${srcdest}build-aux/mes-snarf.scm src/math.c
|
||||
trace "SNARF$snarf mes.c" ${srcdest}build-aux/mes-snarf.scm src/mes.c
|
||||
trace "SNARF$snarf module.c" ${srcdest}build-aux/mes-snarf.scm src/module.c
|
||||
trace "SNARF$snarf posix.c" ${srcdest}build-aux/mes-snarf.scm src/posix.c
|
||||
trace "SNARF$snarf reader.c" ${srcdest}build-aux/mes-snarf.scm src/reader.c
|
||||
trace "SNARF$snarf strings.c" ${srcdest}build-aux/mes-snarf.scm src/string.c
|
||||
trace "SNARF$snarf struct.c" ${srcdest}build-aux/mes-snarf.scm src/struct.c
|
||||
trace "SNARF$snarf vector.c" ${srcdest}build-aux/mes-snarf.scm src/vector.c
|
||||
trace "SNARF$snarf builtins.c" ${srcdest}build-aux/mes-snarf.scm src/builtins.c
|
||||
trace "SNARF$snarf core.c" ${srcdest}build-aux/mes-snarf.scm src/core.c
|
||||
trace "SNARF$snarf display.c" ${srcdest}build-aux/mes-snarf.scm src/display.c
|
||||
trace "SNARF$snarf eval-apply.c" ${srcdest}build-aux/mes-snarf.scm src/eval-apply.c
|
||||
trace "SNARF$snarf gc.c" ${srcdest}build-aux/mes-snarf.scm src/gc.c
|
||||
trace "SNARF$snarf hash.c" ${srcdest}build-aux/mes-snarf.scm src/hash.c
|
||||
trace "SNARF$snarf lib.c" ${srcdest}build-aux/mes-snarf.scm src/lib.c
|
||||
trace "SNARF$snarf math.c" ${srcdest}build-aux/mes-snarf.scm src/math.c
|
||||
trace "SNARF$snarf mes.c" ${srcdest}build-aux/mes-snarf.scm src/mes.c
|
||||
trace "SNARF$snarf module.c" ${srcdest}build-aux/mes-snarf.scm src/module.c
|
||||
trace "SNARF$snarf posix.c" ${srcdest}build-aux/mes-snarf.scm src/posix.c
|
||||
trace "SNARF$snarf reader.c" ${srcdest}build-aux/mes-snarf.scm src/reader.c
|
||||
trace "SNARF$snarf stack.c" ${srcdest}build-aux/mes-snarf.scm src/stack.c
|
||||
trace "SNARF$snarf strings.c" ${srcdest}build-aux/mes-snarf.scm src/string.c
|
||||
trace "SNARF$snarf struct.c" ${srcdest}build-aux/mes-snarf.scm src/struct.c
|
||||
trace "SNARF$snarf symbol.c" ${srcdest}build-aux/mes-snarf.scm src/symbol.c
|
||||
trace "SNARF$snarf vector.c" ${srcdest}build-aux/mes-snarf.scm src/vector.c
|
||||
|
||||
for i in src/*.symbols.h; do
|
||||
n=$(basename $i .symbols.h)
|
||||
echo "/* src/$n.c */"
|
||||
cat $i
|
||||
mv $i $(basename $i .symbols.h).s
|
||||
done > s
|
||||
|
||||
for i in src/*.h; do
|
||||
n=$(basename $i .h)
|
||||
echo "/* src/$n.c */"
|
||||
cat $i
|
||||
done > h
|
||||
|
||||
for i in src/*.i; do
|
||||
n=$(basename $i .i)
|
||||
echo " /* src/$n.c */"
|
||||
cat $i
|
||||
done > c
|
||||
|
|
|
@ -4,7 +4,7 @@ MES_ARENA=100000000 exec ${SCHEME-guile} -L . --no-auto-compile -e '(configure)'
|
|||
!#
|
||||
|
||||
;;; GNU Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2020 Vagrant Cascadian <vagrant@reproducible-builds.org>
|
||||
;;;
|
||||
;;; configure: This file is part of GNU Mes.
|
||||
|
@ -37,7 +37,7 @@ MES_ARENA=100000000 exec ${SCHEME-guile} -L . --no-auto-compile -e '(configure)'
|
|||
(define PACKAGE "mes")
|
||||
(define PACKAGE-NAME "GNU Mes")
|
||||
(define PACKAGE-BUGREPORT "bug-mes@gnu.org")
|
||||
(define VERSION "0.23")
|
||||
(define VERSION "0.24")
|
||||
|
||||
(cond-expand
|
||||
(guile)
|
||||
|
@ -454,7 +454,9 @@ Some influential environment variables:
|
|||
(deps (fold (lambda (program results)
|
||||
(cons (check-program-version program) results))
|
||||
'()
|
||||
(list (make-dep "hex2")
|
||||
(list (make-dep "kaem" #:version '(0 6) #:optional? #t)
|
||||
(make-dep "M2-Planet" #:version '(1 9 0) #:optional? #t)
|
||||
(make-dep "hex2")
|
||||
(make-dep "M1")
|
||||
(make-dep "blood-elf")
|
||||
(make-dep "diff" #:optional? #t)
|
||||
|
@ -514,7 +516,7 @@ Some influential environment variables:
|
|||
"))
|
||||
deps)
|
||||
deps))
|
||||
(mesc? (file-name "cc is MES C" deps))
|
||||
(mescc? (file-name "cc is Mes C" deps))
|
||||
(deps (if cc
|
||||
(cons (check-compile-c cc (make-dep "cc is Tiny C" #:data "#if !defined (__TINYC__)
|
||||
#error no tinycc
|
||||
|
@ -543,7 +545,7 @@ Some influential environment variables:
|
|||
(cut member <> '("pc" "portbld" "unknown")))
|
||||
(cdr host-type-list))))
|
||||
(mes-kernel (if (string-prefix? "freebsd" mes-kernel) "freebsd" mes-kernel))
|
||||
(mes-compiler (cond (gcc? "gcc") (tcc? "gcc") (else "mescc")))
|
||||
(mes-compiler (cond (gcc? "gcc") (tcc? "gcc") (mescc? "mescc") (else "bootstrap")))
|
||||
(mes-system (string-join (list mes-cpu mes-kernel "mes") "-"))
|
||||
(bash (or (and (file-exists? "/bin/bash") "/bin/bash")
|
||||
(file-name "bash" deps)
|
||||
|
@ -637,6 +639,8 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
|
|||
("@GUILE_LOAD_PATH@" . ,(string-join guile-load-path ":"))
|
||||
("@GUIX@" . ,(or (file-name "guix" deps) ""))
|
||||
("@HELP2MAN@" . ,(or (file-name "help2man" deps) ""))
|
||||
("@KAEM@" . ,(or (file-name "kaem" deps) ""))
|
||||
("@M2_PLANET@" . ,(or (file-name "M2-Planet" deps) ""))
|
||||
("@MAKEINFO@" . ,(or (file-name "makeinfo" deps) ""))
|
||||
("@MES_FOR_BUILD@" . ,(or (file-name "mes" deps)
|
||||
guile))
|
||||
|
@ -657,8 +661,8 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
|
|||
(cons (string-append "@" (variable-name o) "@") (or (format #f "~a" (dependency-file-name o)) "")))
|
||||
deps))))
|
||||
|
||||
(unless cc
|
||||
(format (current-error-port) "must supply a C compiler")
|
||||
(unless (or cc m2-planet)
|
||||
(format (current-error-port) "must supply C compiler or M2-Planet\n")
|
||||
(exit 2))
|
||||
(for-each (lambda (o)
|
||||
(let* ((src (string-append srcdest o))
|
||||
|
|
16
configure.sh
16
configure.sh
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
VERSION=0.23
|
||||
VERSION=0.24
|
||||
srcdir=${srcdir-$(dirname $0)}
|
||||
srcdest=
|
||||
if test "$srcdir" != "."; then
|
||||
|
@ -77,6 +77,8 @@ GUILE=${GUILE-$(command -v guile)} || true
|
|||
HEX2=${HEX2-$(command -v hex2)}
|
||||
LDPFLAGS=${LDFLAGS-}
|
||||
M1=${M1-$(command -v M1)}
|
||||
M2_PLANET=${M1-$(command -v M2-Planet)}
|
||||
KAEM=${KAEM-$(command -v kaem)}
|
||||
MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)}
|
||||
GIT=${GIT-$(command -v git)} || true
|
||||
PERL=${PERL-$(command -v perl)} || true
|
||||
|
@ -167,6 +169,8 @@ subst () {
|
|||
-e s,"@HEX2FLAGS@,$HEX2FLAGS,"\
|
||||
-e s,"@M1@,$M1,"\
|
||||
-e s,"@M1FLAGS@,$M1FLAGS,"\
|
||||
-e s,"@M2_PLANET@,$M2_PLANET,"\
|
||||
-e s,"@KAEM@,$KAEM,"\
|
||||
-e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\
|
||||
-e s,"@numbered_arch@,$numbered_arch,"\
|
||||
-e s,"@SHELL@,$SHELL,"\
|
||||
|
@ -217,7 +221,13 @@ elif $CC --version | grep tcc; then
|
|||
compiler=gcc
|
||||
else
|
||||
compiler=mescc
|
||||
AR=${AR-$PWD/scripts/mesar}
|
||||
if ! $CC --version; then
|
||||
CC="$PWD/pre-inst-env mescc"
|
||||
fi
|
||||
if test "$CC" = "M2-Planet"; then
|
||||
CC="$PWD/pre-inst-env mescc"
|
||||
fi
|
||||
AR=${AR-$PWD/pre-inst-env mesar}
|
||||
fi
|
||||
|
||||
AR=${AR-$(command -v ar)} || true
|
||||
|
|
|
@ -1,123 +1,107 @@
|
|||
digraph "Guix bag" {
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" [label = "gcc-mesboot@4.9.4", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
|
||||
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [label = "binutils-mesboot@2.20.1a", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
|
||||
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = magenta];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [label = "binutils-mesboot0@2.20.1a", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = red];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = red];
|
||||
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = red];
|
||||
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [label = "tcc-boot@0.9.27", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = dimgrey];
|
||||
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" [color = dimgrey];
|
||||
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [label = "mes-boot@0.19", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [label = "bootstrap-mescc-tools@0.5.2", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [label = "bootstrap-binaries@0", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [label = "bootstrap-mes@0", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" [label = "tcc-boot0@0.9.26-6.c004e9a", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = magenta];
|
||||
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [color = magenta];
|
||||
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [color = magenta];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [label = "diffutils-mesboot@2.7", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = peachpuff4];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = peachpuff4];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = peachpuff4];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = peachpuff4];
|
||||
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = peachpuff4];
|
||||
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [label = "make-mesboot0@3.80", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = dimgrey];
|
||||
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [label = "glibc-mesboot0@2.2.5", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [color = red];
|
||||
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = red];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [label = "gcc-core-mesboot@2.95.3", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = dimgrey];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = dimgrey];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = dimgrey];
|
||||
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = dimgrey];
|
||||
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [label = "mesboot-headers@0.19", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = blue];
|
||||
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = blue];
|
||||
"/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [label = "linux-libre-headers-bootstrap@0", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [label = "gcc-mesboot0@2.95.3", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = darkseagreen];
|
||||
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = darkseagreen];
|
||||
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" [label = "gcc-mesboot1-wrapper@4.7.4", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
|
||||
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [color = red];
|
||||
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = red];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [label = "glibc-mesboot@2.16.0", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
|
||||
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = magenta];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" [label = "glibc-headers-mesboot@2.16.0", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [label = "gcc-mesboot1@4.7.4", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = cyan3];
|
||||
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = cyan3];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [label = "make-mesboot@3.82", shape = box, fontname = Helvetica];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
|
||||
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = dimgrey];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = sans];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = red];
|
||||
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = red];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" [label = "binutils-mesboot0@2.14", shape = box, fontname = sans];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = cyan3];
|
||||
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = cyan3];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [label = "bash-mesboot0@2.05b", shape = box, fontname = sans];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [label = "make-mesboot0@3.80", shape = box, fontname = sans];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = magenta];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = magenta];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = magenta];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = magenta];
|
||||
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = magenta];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [label = "tcc-boot0@0.9.26-1103-g6e62e0e", shape = box, fontname = sans];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" [color = darkseagreen];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [color = darkseagreen];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkseagreen];
|
||||
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" [label = "mes-boot@0.22", shape = box, fontname = sans];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" [color = peachpuff4];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [color = peachpuff4];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = peachpuff4];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = peachpuff4];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = peachpuff4];
|
||||
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = peachpuff4];
|
||||
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" [label = "bootstrap-mes-rewired@0.19", shape = box, fontname = sans];
|
||||
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" -> "/gnu/store/r7bbw2ywmgqp6m5a1hp0fs4lhc51w3sq-bootstrap-mes-0.drv" [color = cyan3];
|
||||
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = cyan3];
|
||||
"/gnu/store/r7bbw2ywmgqp6m5a1hp0fs4lhc51w3sq-bootstrap-mes-0.drv" [label = "bootstrap-mes@0", shape = box, fontname = sans];
|
||||
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [label = "gash-boot@0.2.0", shape = box, fontname = sans];
|
||||
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkviolet];
|
||||
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkviolet];
|
||||
"/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [label = "bootar@1a", shape = box, fontname = sans];
|
||||
"/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
|
||||
"/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [label = "guile-bootstrap@2.0", shape = box, fontname = sans];
|
||||
"/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [label = "bootstrap-mescc-tools@0.5.2", shape = box, fontname = sans];
|
||||
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [label = "gash-utils-boot@0.1.0", shape = box, fontname = sans];
|
||||
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
|
||||
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
|
||||
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [label = "bzip2-mesboot@1.0.8", shape = box, fontname = sans];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
|
||||
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [label = "gzip-mesboot@1.2.4", shape = box, fontname = sans];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = red];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = red];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = red];
|
||||
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = red];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [label = "patch-mesboot@2.5.9", shape = box, fontname = sans];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkseagreen];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkseagreen];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkseagreen];
|
||||
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkseagreen];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [label = "sed-mesboot0@1.18", shape = box, fontname = sans];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkgoldenrod];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [label = "tcc-boot@0.9.27", shape = box, fontname = sans];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
|
||||
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
|
||||
|
||||
}
|
||||
|
|
188
doc/mes.texi
188
doc/mes.texi
|
@ -13,7 +13,7 @@
|
|||
@set OPENPGP-SIGNING-KEY-ID 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
|
||||
|
||||
@copying
|
||||
Copyright @copyright{} 2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen@*
|
||||
Copyright @copyright{} 2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen@*
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
@ -48,7 +48,7 @@ Edition @value{EDITION} @*
|
|||
@contents
|
||||
|
||||
@c *********************************************************************
|
||||
@node Top, Introduction, (dir), (dir)
|
||||
@node Top
|
||||
@top GNU Mes
|
||||
|
||||
This document describes GNU Mes version @value{VERSION}, a bootstrappable
|
||||
|
@ -72,12 +72,19 @@ Software Freedom
|
|||
|
||||
* Reproducible Builds:: Reproducibility and free software.
|
||||
* Bootstrappable Builds:: The freedom to build a software without binary seed.
|
||||
* Full Source Bootstrap:: Software dependencies worthy of GNU.
|
||||
* Reduced Binary Seed Bootstrap:: Guix reduces bootstrap binaries with 50%.
|
||||
* Scheme-only Bootsrap:: Guix reduced bootstrap binaries to 25%.
|
||||
* Full Source Bootstrap:: A bootstrap worthy of GNU.
|
||||
* LISP as Maxwell's Equations of Software:: Auditable elegance.
|
||||
|
||||
Full Source Bootstrap
|
||||
|
||||
* Stage0:: The Magical Self-Hosting Hex Assembler.
|
||||
* M2-Planet:: A Sub-C bootstrap compiler.
|
||||
|
||||
Installation
|
||||
|
||||
* Regular Requirements:: Software needed to build and run Mes.
|
||||
* Requirements:: Software needed to build and run Mes.
|
||||
* Bootstrap Requirements:: Software needed to bootstrap Mes.
|
||||
* Running the Test Suites:: Testing Mes.
|
||||
|
||||
|
@ -109,7 +116,7 @@ Contributing
|
|||
@end menu
|
||||
|
||||
@c *********************************************************************
|
||||
@node Introduction, Installation, Top, Top
|
||||
@node Introduction
|
||||
@chapter Introduction
|
||||
|
||||
@quotation
|
||||
|
@ -187,11 +194,13 @@ Freedom 1.
|
|||
@menu
|
||||
* Reproducible Builds:: Reproducibility and free software.
|
||||
* Bootstrappable Builds:: The freedom to build a software without binary seed.
|
||||
* Full Source Bootstrap:: Software dependencies worthy of GNU.
|
||||
* Reduced Binary Seed Bootstrap:: Guix reduces bootstrap binaries with 50%.
|
||||
* Scheme-only Bootsrap:: Guix reduced bootstrap binaries to 25%.
|
||||
* Full Source Bootstrap:: A bootstrap worthy of GNU.
|
||||
* LISP as Maxwell's Equations of Software:: Auditable elegance.
|
||||
@end menu
|
||||
|
||||
@node Reproducible Builds, Bootstrappable Builds, Introduction, Introduction
|
||||
@node Reproducible Builds
|
||||
@section Reproducible Builds
|
||||
|
||||
The current Reproducible Builds effort incubated in the Debian
|
||||
|
@ -240,7 +249,7 @@ packages could be rebuild bit-identical from source.
|
|||
@author Martin Uecker
|
||||
@end quotation
|
||||
|
||||
@node Bootstrappable Builds, Full Source Bootstrap, Reproducible Builds, Introduction
|
||||
@node Bootstrappable Builds
|
||||
@section Bootstrappable Builds
|
||||
|
||||
Software distributions that take reproducible builds seriously are
|
||||
|
@ -258,10 +267,11 @@ binary seed that all software distributions inject are the so called
|
|||
@emph{bootstrap binary seed}. Bootstrap binaries are the initial binary
|
||||
seeds that are used to start building the distribution.
|
||||
|
||||
The GNU Guix operating system, version 1.0 had a relatively small
|
||||
closure of bootstrap binary seed: GNU binutils, GNU gcc, GNU Libc, GNU
|
||||
Guile, and ``Static binaries'' (think: bash, bzip2, coreutils, gawk,
|
||||
grep, gzip, patch, sed, tar, xz).
|
||||
The GNU Guix operating system (@pxref{Top,,, guix, The GNU Guix
|
||||
Manual}), version 1.0 had a relatively small closure of bootstrap binary
|
||||
seed: GNU binutils, GNU gcc, GNU Libc, GNU Guile, and ``Static
|
||||
binaries'' (think: bash, bzip2, coreutils, gawk, grep, gzip, patch, sed,
|
||||
tar, xz).
|
||||
|
||||
@example
|
||||
$ du -schx $(readlink $(guix build bootstrap-tarballs)/*)
|
||||
|
@ -288,6 +298,9 @@ $ du -schx *
|
|||
252M total
|
||||
@end example
|
||||
|
||||
@node Reduced Binary Seed Bootstrap
|
||||
@section Reduced Binary Seed Bootstrap
|
||||
|
||||
During the Guix 1.1 development series we managed to create the first
|
||||
reduction by 50% of the Guix @emph{bootstrap binary seed}@footnote{See
|
||||
@url{https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/}}.
|
||||
|
@ -295,16 +308,37 @@ This was a very important step because the ~250MB @emph{seed} of binary
|
|||
code was practically non-auditable, which makes it hard to establish
|
||||
what source code produced them.
|
||||
|
||||
@node Full Source Bootstrap, , Bootstrappable Builds, Introduction
|
||||
@section Full Source Bootstrap
|
||||
@node Scheme-only Bootsrap
|
||||
@section Scheme-only Bootstrap
|
||||
|
||||
There is an obvious solution: we cannot allow any binary seeds in our
|
||||
software stack. Not even in the bootstrap binary seed. Maybe that is a
|
||||
bit too strong: we want to have the absolute minimum of binary seeds and
|
||||
all binary seeds need to be inspectable and must be reviewed. How big
|
||||
would the absolute minimal set be?
|
||||
The next step that Guix has taken is to replace the shell and all its
|
||||
utilities with implementations in Guile Scheme, the @emph{Scheme-only
|
||||
bootstrap}. This second halving of the boostrap binaries reduced their
|
||||
size to 25% @footnote{See
|
||||
@url{https://guix.gnu.org/en/blog/2020/guix-further-reduces-bootstrap-seed-to-25/}}.
|
||||
Gash (@pxref{Gash,,, gash, The Gash manual}) is a POSIX-compatible shell
|
||||
that replaces Bash, and it comes with Gash Utils which has minimalist
|
||||
replacements for Awk, the GNU Core Utilities, Grep, Gzip, Sed, and Tar.
|
||||
The rest of the bootstrap binary seeds that were removed are now built
|
||||
from source.
|
||||
|
||||
@subsection The Magical Self-Hosting Hex Assembler
|
||||
@node Full Source Bootstrap
|
||||
@section Full Source Bootstrap
|
||||
|
||||
Reduction of binary seeds is great, but there is an obvious target: we
|
||||
cannot allow any binary seeds in our software stack. Not even in the
|
||||
bootstrap binary seed. Maybe that is a bit too strong: we want to have
|
||||
the absolute minimum of binary seeds and all binary seeds need to be
|
||||
inspectable and must be reviewed. How big would the absolute minimal
|
||||
set be?
|
||||
|
||||
@menu
|
||||
* Stage0:: The Magical Self-Hosting Hex Assembler.
|
||||
* M2-Planet:: A Sub-C bootstrap compiler.
|
||||
@end menu
|
||||
|
||||
@node Stage0
|
||||
@subsection Stage0
|
||||
|
||||
June 2016 I learnt about
|
||||
@url{https://github.com/oriansj/stage0/,Stage0}. Jeremiah Orians
|
||||
|
@ -409,6 +443,18 @@ nothing to all of the programs that our computer runs. Something that
|
|||
seemed to be an impossible dream is suddenly starting to look like
|
||||
``just a couple years of work''.
|
||||
|
||||
@node M2-Planet
|
||||
@subsection M2-Planet
|
||||
|
||||
@url{https://github.com/oriansj/m2-planet/,M2-Planet} @footnote{The
|
||||
PLAtform NEutral Transpiler}, when combined with
|
||||
@url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools};
|
||||
allows one to compile a subset of the C language into working binaries
|
||||
with introspective steps inbetween. In 2021 M2-Planet with release
|
||||
1.8.0 reached a level of maturity that allowed to build MesCC-Tools and
|
||||
Mes. This allows for another reduction the Guix bootstrap binaries: mes
|
||||
and mescc-tools can be removed.
|
||||
|
||||
@node LISP as Maxwell's Equations of Software
|
||||
@section LISP as Maxwell's Equations of Software
|
||||
|
||||
|
@ -480,7 +526,7 @@ It is our sincerest hope to bring back this level of quality and
|
|||
elegance..
|
||||
|
||||
@c *********************************************************************
|
||||
@node Installation, Bootstrapping, Introduction, Top
|
||||
@node Installation
|
||||
@chapter Installation
|
||||
|
||||
@cindex installing Mes
|
||||
|
@ -491,13 +537,13 @@ to use it.
|
|||
|
||||
|
||||
@menu
|
||||
* Regular Requirements:: Software needed to build and run Mes.
|
||||
* Requirements:: Software needed to build and run Mes.
|
||||
* Bootstrap Requirements:: Software needed to bootstrap Mes.
|
||||
* Running the Test Suites:: Testing Mes.
|
||||
@end menu
|
||||
|
||||
@node Regular Requirements, Bootstrap Requirements, Installation, Installation
|
||||
@section Regular Requirements
|
||||
@node Requirements
|
||||
@section Requirements
|
||||
|
||||
This section lists requirements when building Mes from source. The
|
||||
build procedure for Mes is the same as for other GNU software, and is
|
||||
|
@ -512,7 +558,14 @@ later, including 2.2.x and 3.0.x,
|
|||
@item @url{http://www.gnu.org/software/make/, GNU Make}.
|
||||
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, version 1.00.2,
|
||||
@item @url{http://gcc.gnu.org, GCC's gcc}, version 2.95.3 or later, including 10.2.0,
|
||||
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 0.7.0 or later,
|
||||
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 1.0.1 or later,
|
||||
@end itemize
|
||||
|
||||
The following dependencies are optional:
|
||||
|
||||
@itemize
|
||||
Support for building the bootstrap @file{bin/mes-m2} depends on
|
||||
@item @url{https://github.com/oriansj/m2-planet/, M2-Planet}, version 1.8.0.
|
||||
@end itemize
|
||||
|
||||
@cindex Guile, compatibility
|
||||
|
@ -520,7 +573,7 @@ Mes is compatible with GNU Guile, so it is possible to share the same
|
|||
Scheme code between both. Currently Mes only supports the minimal
|
||||
subset of R5RS and Guile extensions to run MesCC.
|
||||
|
||||
@node Bootstrap Requirements, Running the Test Suites, Regular Requirements, Installation
|
||||
@node Bootstrap Requirements
|
||||
@section Bootstrap Requirements
|
||||
|
||||
This section lists requirements when building Mes as a bootstrap
|
||||
|
@ -541,11 +594,12 @@ Bootstrapping Mes depends on the following packages:
|
|||
|
||||
@itemize
|
||||
@item a POSIX-compatible shell
|
||||
@item @url{https://github.com/oriansj/mescc-tools/, mescc-tools}, version 0.6.1 or later.
|
||||
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, 0.93.0 or later, including 0.99.0.
|
||||
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 1.0.1 or later,
|
||||
@item @url{https://github.com/oriansj/m2-planet/, M2-Planet}, version 1.8.0.
|
||||
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, version 1.00.2,
|
||||
@end itemize
|
||||
|
||||
@node Running the Test Suites, , Bootstrap Requirements, Installation
|
||||
@node Running the Test Suites
|
||||
@section Running the Test Suites
|
||||
|
||||
@cindex test suites
|
||||
|
@ -588,7 +642,7 @@ CC=gcc CC32=i686-unknown-linux-gnu-gcc MES=guile \
|
|||
build-aux/test.sh scaffold/tests/00-exit-0
|
||||
@end example
|
||||
|
||||
@node Bootstrapping, Contributing, Installation, Top
|
||||
@node Bootstrapping
|
||||
@chapter Bootstrapping
|
||||
|
||||
@quotation
|
||||
|
@ -633,14 +687,14 @@ responsibility.
|
|||
* Invoking mesar::
|
||||
@end menu
|
||||
|
||||
@node The Mes Bootstrap Process, Invoking mes, Bootstrapping, Bootstrapping
|
||||
@node The Mes Bootstrap Process
|
||||
@section The Mes Bootstrap Process
|
||||
|
||||
The Reduced Binary Seed bootstrap currently adopted by Guix@footnote{See
|
||||
@file{gnu/packages/commencement.scm} in the @var{master} branch in Guix
|
||||
git
|
||||
@url{http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm}}.
|
||||
In its intiial form it is only available for x86-linux arm armhf-linux.
|
||||
In its intiial form it is only available for x86-linux and armhf-linux.
|
||||
|
||||
Currently, it goes like this:
|
||||
|
||||
|
@ -679,19 +733,23 @@ Currently, it goes like this:
|
|||
^
|
||||
|
|
||||
*
|
||||
bootstrap-mescc-tools, bootstrap-mes (~10MB)
|
||||
bootstrap-bash, bootstrap-coreutils&co, bootstrap-guile (~120MB)
|
||||
gash-boot, gash-utils-boot
|
||||
^
|
||||
|
|
||||
*
|
||||
bootstrap-mescc-tools, bootstrap-mes (~12 MiB)
|
||||
bootstrap-guile (~48 MiB)
|
||||
@end verbatim
|
||||
|
||||
@c This graph is generated from wip-bootstrap, doing:
|
||||
|
||||
@c ~/src/guix/core-updates/pre-inst-env guix graph --type=bag -e '(@@ (gnu packages commencement) gcc-mesboot)' > doc/images/gcc-mesboot-graph.dot
|
||||
@c guix graph --type=bag -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' > doc/images/gcc-mesboot-graph.dot
|
||||
@c dot -T png doc/images/gcc-mesboot-graph.dot > doc/images/gcc-mesboot-graph.png
|
||||
|
||||
Here's a generated dependency diagram to for the final bootstrap gcc
|
||||
Here's a generated dependency diagram to for the initial bootstrap gcc
|
||||
that builds the rest of Guix.
|
||||
|
||||
@image{images/gcc-mesboot-graph,2in,,Reference graph of the gcc-mesboot}
|
||||
@image{images/gcc-mesboot-graph,2in,,Reference graph of the gcc-core-mesboot0}
|
||||
|
||||
Work is ongoing to remove these binary seeds that were intentionally
|
||||
injected by our own doing as temporary shortcut
|
||||
|
@ -699,19 +757,16 @@ injected by our own doing as temporary shortcut
|
|||
bootstrap-mescc-tools (seed), bootstrap-mes (seed)
|
||||
@end example
|
||||
|
||||
For now, these additional non-bootstrapped dependencies (i.e., binary
|
||||
For now, this additional non-bootstrapped dependencies (i.e., binary
|
||||
seeds) are taken for granted
|
||||
|
||||
@example
|
||||
bootstrap-guile, bash, bzip2, coreutils, gawk, grep, gzip, patch, sed,
|
||||
tar, xz
|
||||
bootstrap-guile
|
||||
@end example
|
||||
|
||||
Although we think these are less essential and thus less interesting
|
||||
than the GNU toolchain triplet that we focussed on initially, our next
|
||||
priority is to eleminate these one by one.
|
||||
Our next priority is to eleminate these one by one.
|
||||
|
||||
@node Invoking mes, Invoking mescc, The Mes Bootstrap Process, Bootstrapping
|
||||
@node Invoking mes
|
||||
@section Invoking mes
|
||||
|
||||
@cindex repl
|
||||
|
@ -787,7 +842,7 @@ Display the current version of mes%, and then exit.
|
|||
* Environment Variables:: If the bits won't change, change their habitat.
|
||||
@end menu
|
||||
|
||||
@node Environment Variables, , Invoking mes, Invoking mes
|
||||
@node Environment Variables
|
||||
@subsection Environment Variables
|
||||
@cindex environment variables
|
||||
@cindex shell
|
||||
|
@ -865,7 +920,7 @@ Mes uses @var{@strong{GUILE}_LOAD_PATH} for compatibility with Guile.
|
|||
|
||||
@end table
|
||||
|
||||
@node Invoking mescc, Invoking mesar, Invoking mes, Bootstrapping
|
||||
@node Invoking mescc
|
||||
@section Invoking mescc
|
||||
|
||||
@example
|
||||
|
@ -947,7 +1002,7 @@ specify LANGUAGE of the following input files
|
|||
* MesCC Environment Variables:: There's no NIX like POSIX.
|
||||
@end menu
|
||||
|
||||
@node MesCC Environment Variables, , Invoking mescc, Invoking mescc
|
||||
@node MesCC Environment Variables
|
||||
@subsection MesCC Environment Variables
|
||||
|
||||
@table @env
|
||||
|
@ -976,7 +1031,7 @@ during the parsing phase.
|
|||
|
||||
@end table
|
||||
|
||||
@node Invoking mesar, , Invoking mescc, Bootstrapping
|
||||
@node Invoking mesar
|
||||
@section Invoking mesar
|
||||
|
||||
@example
|
||||
|
@ -1006,7 +1061,7 @@ display version and exit
|
|||
@end table
|
||||
|
||||
@c *********************************************************************
|
||||
@node Contributing, Acknowledgments, Bootstrapping, Top
|
||||
@node Contributing
|
||||
@chapter Contributing
|
||||
|
||||
@menu
|
||||
|
@ -1018,7 +1073,7 @@ display version and exit
|
|||
* Submitting Patches:: Share your work.
|
||||
@end menu
|
||||
|
||||
@node Building from Git, Running Mes From the Source Tree, Contributing, Contributing
|
||||
@node Building from Git
|
||||
@section Building from Git
|
||||
|
||||
If you want to hack GNU Mes itself, it is recommended to use the latest
|
||||
|
@ -1034,15 +1089,26 @@ all the dependencies and appropriate environment variables are set up to
|
|||
hack on Mes:
|
||||
|
||||
@example
|
||||
guix environment -l .guix.scm
|
||||
guix shell
|
||||
@end example
|
||||
|
||||
If you are unable to use Guix when building Mes from a Git checkout,
|
||||
the following are the required packages in addition to those mentioned
|
||||
in the installation instructions (@pxref{Requirements}).
|
||||
|
||||
@itemize
|
||||
@item @url{https://gnu.org/software/help2man/, GNU Help2man};
|
||||
@item @url{https://gnu.org/software/texinfo/, GNU Texinfo};
|
||||
@item @url{https://www.graphviz.org/, Graphviz};
|
||||
@item @url{https://www.perl.org/, Perl}.
|
||||
@end itemize
|
||||
|
||||
Finally, you have to invoke @code{make check} to run tests
|
||||
(@pxref{Running the Test Suites}). If anything fails, take a look at
|
||||
installation instructions (@pxref{Installation}) or send a message to
|
||||
the @email{bug-mes@@gnu.org} mailing list.
|
||||
|
||||
@node Running Mes From the Source Tree, Porting GNU Mes, Building from Git, Contributing
|
||||
@node Running Mes From the Source Tree
|
||||
@section Running Mes From the Source Tree
|
||||
|
||||
First, you need to have an environment with all the dependencies
|
||||
|
@ -1050,7 +1116,7 @@ available (@pxref{Building from Git}), and then simply prefix each
|
|||
command by @command{./pre-inst-env} (the @file{pre-inst-env} script
|
||||
lives in the top build tree of Mes).
|
||||
|
||||
@node Porting GNU Mes, The Perfect Setup, Running Mes From the Source Tree, Contributing
|
||||
@node Porting GNU Mes
|
||||
@section Porting GNU Mes
|
||||
|
||||
Mes is supported for x86-linux and armhf-linux. A 64 bit (x86_64-linux)
|
||||
|
@ -1083,7 +1149,7 @@ Porting MesCC:
|
|||
@file{mes/module/mescc/i386/info.mes}
|
||||
@end example
|
||||
|
||||
@node The Perfect Setup, Coding Style, Porting GNU Mes, Contributing
|
||||
@node The Perfect Setup
|
||||
@section The Perfect Setup
|
||||
|
||||
The Perfect Setup to hack on Mes is basically the perfect setup used
|
||||
|
@ -1098,7 +1164,7 @@ on-line documentation (docstrings), context-sensitive completion,
|
|||
@kbd{M-.} to jump to an object definition, a REPL to try out your code,
|
||||
and more (@pxref{Introduction,,, geiser, Geiser User Manual}).
|
||||
|
||||
@node Coding Style, Submitting Patches, The Perfect Setup, Contributing
|
||||
@node Coding Style
|
||||
@section Coding Style
|
||||
|
||||
In general our code follows the GNU Coding Standards (@pxref{Top,,,
|
||||
|
@ -1134,7 +1200,7 @@ Additionally, in Mes we prefer to format @code{if} statements like this
|
|||
else))
|
||||
@end example
|
||||
|
||||
@node Submitting Patches, , Coding Style, Contributing
|
||||
@node Submitting Patches
|
||||
@section Submitting Patches
|
||||
|
||||
Development is done using the Git distributed version control system.
|
||||
|
@ -1184,7 +1250,7 @@ Join us on @code{#bootstrappable} on the Libera Chat IRC network or on
|
|||
Please send bug reports with full details to @email{bug-mes@@gnu.org}.
|
||||
|
||||
@c *********************************************************************
|
||||
@node Acknowledgments, Resources, Contributing, Top
|
||||
@node Acknowledgments
|
||||
@chapter Acknowledgments
|
||||
|
||||
We would like to thank the following people for their help: Jeremiah
|
||||
|
@ -1196,7 +1262,7 @@ LISP-1.5 and Alan Kay for their inspiring comment on
|
|||
@url{https://queue.acm.org/detail.cfm?id=1039523, Page 13}.
|
||||
|
||||
@c *********************************************************************
|
||||
@node Resources, GNU Free Documentation License, Acknowledgments, Top
|
||||
@node Resources
|
||||
@chapter Resources
|
||||
|
||||
@itemize
|
||||
|
@ -1230,17 +1296,17 @@ at the Libera Chat IRC network.
|
|||
@end itemize
|
||||
|
||||
@c *********************************************************************
|
||||
@node GNU Free Documentation License, Concept Index, Resources, Top
|
||||
@node GNU Free Documentation License
|
||||
@appendix GNU Free Documentation License
|
||||
@cindex license, GNU Free Documentation License
|
||||
@include fdl-1.3.texi
|
||||
|
||||
@c *********************************************************************
|
||||
@node Concept Index, Programming Index, GNU Free Documentation License, Top
|
||||
@node Concept Index
|
||||
@unnumbered Concept Index
|
||||
@printindex cp
|
||||
|
||||
@node Programming Index, , Concept Index, Top
|
||||
@node Programming Index
|
||||
@unnumbered Programming Index
|
||||
@syncodeindex tp fn
|
||||
@syncodeindex vr fn
|
||||
|
|
4
guix.scm
4
guix.scm
|
@ -1,7 +1,7 @@
|
|||
;;; guix.scm -- Guix package definition
|
||||
|
||||
;;; GNU Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Mes.
|
||||
;;;
|
||||
|
@ -30,7 +30,7 @@
|
|||
;;
|
||||
;; To use as the basis for a development environment, run:
|
||||
;;
|
||||
;; guix environment -l guix.scm
|
||||
;; guix shell
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
|
|
104
guix/git/mes.scm
104
guix/git/mes.scm
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Mes.
|
||||
;;;
|
||||
|
@ -54,7 +54,7 @@
|
|||
(define-public mescc-tools
|
||||
(package
|
||||
(name "mescc-tools")
|
||||
(version "0.7.0")
|
||||
(version "1.1.0")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
|
@ -65,7 +65,7 @@
|
|||
(file-name (string-append name "-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1p1ijia4rm3002f5sypidl9v5gq0mlch9b0n61rpxkdsaaxjqax3"))))
|
||||
"12cjryqfd6m6j807pvhk7i4vr2q0jiibpfrpnq5s67iq9l4rrc6b"))))
|
||||
(build-system gnu-build-system)
|
||||
(supported-systems
|
||||
'("aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux"))
|
||||
|
@ -78,7 +78,7 @@
|
|||
(add-after 'unpack 'patch-prefix
|
||||
(lambda _
|
||||
(substitute* "sha256.sh"
|
||||
(("/usr/bin/sha256sum") (which "sha256sum")))
|
||||
(("\\$\\(which sha256sum\\)") (which "sha256sum")))
|
||||
#t)))))
|
||||
(synopsis "Tools for the full source bootstrapping process")
|
||||
(description
|
||||
|
@ -89,6 +89,37 @@ get_machine.")
|
|||
(home-page "https://savannah.nongnu.org/projects/mescc-tools")
|
||||
(license gpl3+)))
|
||||
|
||||
(define-public m2-planet
|
||||
(package
|
||||
(name "m2-planet")
|
||||
(version "1.9.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/oriansj/m2-planet")
|
||||
(commit (string-append "Release_" version))
|
||||
(recursive? #t))) ;for M2libc
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0cgvvq91cbxxm93k8ayyvhpaf3c2lv10qw4wyqwn3hc1qb1cfyvr"))))
|
||||
(native-inputs (list mescc-tools))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
|
||||
(string-append "CC=" ,(cc-for-target)))
|
||||
#:tests? #f
|
||||
#:phases (modify-phases %standard-phases
|
||||
(delete 'bootstrap)
|
||||
(delete 'configure))))
|
||||
(synopsis "The PLAtform NEutral Transpiler")
|
||||
(description
|
||||
"M2-Planet, The PLAtform NEutral Transpiler, when combined with
|
||||
mescc-tools compiles a subset of the C language into working binaries
|
||||
with introspective steps inbetween.")
|
||||
(home-page "https://github.com/oriansj/m2-planet")
|
||||
(license gpl3+)))
|
||||
|
||||
(define-public nyacc-0.99
|
||||
(package
|
||||
(name "nyacc")
|
||||
|
@ -116,10 +147,8 @@ get_machine.")
|
|||
"DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
|
||||
#t))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
(inputs
|
||||
`(("guile" ,guile-2.2)))
|
||||
(native-inputs (list pkg-config))
|
||||
(inputs (list guile-2.2))
|
||||
(synopsis "LALR(1) Parser Generator in Guile")
|
||||
(description
|
||||
"NYACC is an LALR(1) parser generator implemented in Guile.
|
||||
|
@ -154,8 +183,7 @@ extensive examples, including parsers for the Javascript and C99 languages.")
|
|||
(sha256
|
||||
(base32
|
||||
"065ksalfllbdrzl12dz9d9dcxrv97wqxblslngsc6kajvnvlyvpk"))))
|
||||
(inputs
|
||||
`(("guile" ,guile-3.0)))))
|
||||
(inputs (list guile-3.0))))
|
||||
|
||||
(define-public mes
|
||||
(package
|
||||
|
@ -169,33 +197,41 @@ extensive examples, including parsers for the Javascript and C99 languages.")
|
|||
(base32 #!mes!# "0mnryfkl0dwbr5gxp16j5s95gw7z1vm1fqa1pxabp0aiar1hw53s"))))
|
||||
(build-system gnu-build-system)
|
||||
(supported-systems '("aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux"))
|
||||
(propagated-inputs
|
||||
`(("mescc-tools" ,mescc-tools)
|
||||
("nyacc" ,nyacc)))
|
||||
(propagated-inputs (list mescc-tools nyacc))
|
||||
(native-inputs
|
||||
`(("guile" ,guile-3.0-latest)
|
||||
,@(cond ((string-prefix? "x86_64-linux" (or (%current-target-system)
|
||||
(%current-system)))
|
||||
;; Use cross-compiler rather than #:system "i686-linux" to get
|
||||
;; MesCC 64 bit .go files installed ready for use with Guile.
|
||||
(let ((triplet "i686-unknown-linux-gnu"))
|
||||
`(("i686-linux-binutils" ,(cross-binutils triplet))
|
||||
("i686-linux-gcc" ,(cross-gcc triplet)))))
|
||||
((string-prefix? "aarch64-linux" (or (%current-target-system)
|
||||
(%current-system)))
|
||||
;; Use cross-compiler rather than #:system "armhf-linux" to get
|
||||
;; MesCC 64 bit .go files installed ready for use with Guile.
|
||||
(let ((triplet "arm-linux-gnueabihf"))
|
||||
`(("arm-linux-binutils" ,(cross-binutils triplet))
|
||||
("arm-linux-gcc" ,(cross-gcc triplet)))))
|
||||
(else
|
||||
'()))
|
||||
("graphviz" ,graphviz)
|
||||
("help2man" ,help2man)
|
||||
("perl" ,perl) ; build-aux/gitlog-to-changelog
|
||||
("texinfo" ,texinfo)))
|
||||
(append
|
||||
(list guile-3.0)
|
||||
(let ((target-system (or (%current-target-system)
|
||||
(%current-system))))
|
||||
(cond
|
||||
((string-prefix? "x86_64-linux" target-system)
|
||||
;; Use cross-compiler rather than #:system "i686-linux" to get
|
||||
;; MesCC 64 bit .go files installed ready for use with Guile.
|
||||
(list (cross-binutils "i686-unknown-linux-gnu")
|
||||
(cross-gcc "i686-unknown-linux-gnu")))
|
||||
((string-prefix? "aarch64-linux" target-system)
|
||||
;; Use cross-compiler rather than #:system "armhf-linux" to get
|
||||
;; MesCC 64 bit .go files installed ready for use with Guile.
|
||||
(let ((triplet "arm-linux-gnueabihf"))
|
||||
(list (cross-binutils triplet) (cross-gcc triplet))))
|
||||
(else
|
||||
'())))
|
||||
(list graphviz help2man m2-planet
|
||||
perl ;build-aux/gitlog-to-changelog
|
||||
texinfo)))
|
||||
(arguments
|
||||
`(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
|
||||
(native-search-paths
|
||||
(list (search-path-specification
|
||||
(variable "C_INCLUDE_PATH")
|
||||
(files '("include")))
|
||||
(search-path-specification
|
||||
(variable "LIBRARY_PATH")
|
||||
(files '("lib")))
|
||||
(search-path-specification
|
||||
(variable "MES_PREFIX")
|
||||
(separator #f)
|
||||
(files '("")))))
|
||||
(synopsis "Scheme interpreter and C compiler for full source bootstrapping")
|
||||
(description
|
||||
"GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
|
@ -23,29 +23,58 @@
|
|||
|
||||
/* See https://github.com/torvalds/linux/blob/v4.19/arch/arm/tools/syscall.tbl */
|
||||
|
||||
// libc
|
||||
/* libc-mini */
|
||||
#ifndef SYS_exit
|
||||
// CONSTANT SYS_exit 0x01
|
||||
#define SYS_exit 0x01
|
||||
#endif
|
||||
#ifndef SYS_write
|
||||
// CONSTANT SYS_write 0x04
|
||||
#define SYS_write 0x04
|
||||
#endif
|
||||
|
||||
/* libc */
|
||||
// CONSTANT SYS_fork 0x02
|
||||
#define SYS_fork 0x02
|
||||
// CONSTANT SYS_read 0x03
|
||||
#define SYS_read 0x03
|
||||
// CONSTANT SYS_open 0x05
|
||||
#define SYS_open 0x05
|
||||
//#define SYS_waitpid
|
||||
// CONSTANT SYS_wait4 0x72
|
||||
#define SYS_wait4 0x72
|
||||
// CONSTANT SYS_execve 0x0b
|
||||
#define SYS_execve 0x0b
|
||||
// CONSTANT SYS_chmod 0x0f
|
||||
#define SYS_chmod 0x0f
|
||||
// CONSTANT SYS_access 0x21
|
||||
#define SYS_access 0x21
|
||||
// CONSTANT SYS_brk 0x2d
|
||||
#define SYS_brk 0x2d
|
||||
// CONSTANT SYS_ioctl 0x36
|
||||
#define SYS_ioctl 0x36
|
||||
// CONSTANT SYS_fsync 0x76
|
||||
#define SYS_fsync 0x76
|
||||
// CONSTANT SYS_getcwd 0xb7
|
||||
#define SYS_getcwd 0xb7
|
||||
// CONSTANT SYS_dup 0x29
|
||||
#define SYS_dup 0x29
|
||||
// CONSTANT SYS_dup2 0x3f
|
||||
#define SYS_dup2 0x3f
|
||||
// CONSTANT SYS_unlink 0x0a
|
||||
#define SYS_unlink 0x0a
|
||||
// CONSTANT SYS_gettimeofday 0x4e
|
||||
#define SYS_gettimeofday 0x4e
|
||||
// CONSTANT SYS_clock_gettime 0x107
|
||||
#define SYS_clock_gettime 0x107
|
||||
|
||||
// libc+tcc
|
||||
/* libc+tcc */
|
||||
#define SYS_close 0x06
|
||||
#define SYS_lseek 0x13
|
||||
#define SYS_unlink 0x0a
|
||||
#define SYS_rmdir 0x28
|
||||
#define SYS_gettimeofday 0x4e
|
||||
#define SYS_stat 0x6a
|
||||
#define SYS_getcwd 0xb7
|
||||
|
||||
// libc+gnu
|
||||
/* libc+gnu */
|
||||
#define SYS_chdir 0x0c
|
||||
#define SYS_link 0x09
|
||||
#define SYS_getpid 0x14
|
||||
|
@ -53,34 +82,31 @@
|
|||
#define SYS_kill 0x25
|
||||
#define SYS_rename 0x26
|
||||
#define SYS_mkdir 0x27
|
||||
#define SYS_dup 0x29
|
||||
#define SYS_pipe 0x2a
|
||||
#define SYS_getgid 0x2f
|
||||
#define SYS_rt_sigaction 0xae
|
||||
#define SYS_rt_sigreturn 0xad
|
||||
#define SYS_fcntl 0x37
|
||||
#define SYS_dup2 0x3f
|
||||
#define SYS_getrusage 0x4d
|
||||
#define SYS_lstat 0x6b
|
||||
#define SYS_setitimer 0x68
|
||||
#define SYS_fstat 0x6c
|
||||
#define SYS_nanosleep 0xa2
|
||||
#define SYS_getdents 0x8d
|
||||
#define SYS_clock_gettime 0x107
|
||||
|
||||
// bash
|
||||
/* bash */
|
||||
#define SYS_setuid 0x17
|
||||
#define SYS_setgid 0x2e
|
||||
#define SYS_geteuid 0x31
|
||||
#define SYS_getegid 0x32
|
||||
#define SYS_getppid 0x40
|
||||
|
||||
// make+WITH_GLIBC
|
||||
/* make+WITH_GLIBC */
|
||||
#define SYS_rt_sigprocmask 0xaf
|
||||
|
||||
// tar
|
||||
/* tar */
|
||||
#define SYS_symlink 0x53
|
||||
#define SYS_readlink 0x55
|
||||
#define SYS_mknod 0x0e
|
||||
|
||||
#endif // __MES_LINUX_ARM_SYSCALL_H
|
||||
#endif /* __MES_LINUX_ARM_SYSCALL_H */
|
||||
|
|
|
@ -20,34 +20,61 @@
|
|||
#ifndef __MES_LINUX_X86_SYSCALL_H
|
||||
#define __MES_LINUX_X86_SYSCALL_H 1
|
||||
|
||||
// libc-mini
|
||||
// #define SYS_exit 0x01
|
||||
// #define SYS_write 0x04
|
||||
/* libc-mini */
|
||||
#ifndef SYS_exit
|
||||
// CONSTANT SYS_exit 0x01
|
||||
#define SYS_exit 0x01
|
||||
#endif
|
||||
#ifndef SYS_write
|
||||
// CONSTANT SYS_write 0x04
|
||||
#define SYS_write 0x04
|
||||
#endif
|
||||
|
||||
// libc
|
||||
/* libc */
|
||||
// CONSTANT SYS_fork 0x02
|
||||
#define SYS_fork 0x02
|
||||
// CONSTANT SYS_read 0x03
|
||||
#define SYS_read 0x03
|
||||
// CONSTANT SYS_open 0x05
|
||||
#define SYS_open 0x05
|
||||
// CONSTANT SYS_waitpid 0x07
|
||||
#define SYS_waitpid 0x07
|
||||
// CONSTANT SYS_wait4 0x72
|
||||
#define SYS_wait4 0x72
|
||||
// CONSTANT SYS_execve 0x0b
|
||||
#define SYS_execve 0x0b
|
||||
// CONSTANT SYS_chmod 0x0f
|
||||
#define SYS_chmod 0x0f
|
||||
// CONSTANT SYS_access 0x21
|
||||
#define SYS_access 0x21
|
||||
// CONSTANT SYS_brk 0x2d
|
||||
#define SYS_brk 0x2d
|
||||
// CONSTANT SYS_ioctl 0x36
|
||||
#define SYS_ioctl 0x36
|
||||
// CONSTANT SYS_fsync 0x76
|
||||
#define SYS_fsync 0x76
|
||||
|
||||
// libc+tcc
|
||||
#define SYS_close 0x06
|
||||
#define SYS_time 0x0d
|
||||
#define SYS_lseek 0x13
|
||||
#define SYS_unlink 0x0a
|
||||
#define SYS_rmdir 0x28
|
||||
#define SYS_gettimeofday 0x4e
|
||||
#define SYS_stat 0x6a
|
||||
// CONSTANT SYS_getcwd 0xb7
|
||||
#define SYS_getcwd 0xb7
|
||||
// CONSTANT SYS_dup 0x29
|
||||
#define SYS_dup 0x29
|
||||
// CONSTANT SYS_dup2 0x3f
|
||||
#define SYS_dup2 0x3f
|
||||
// CONSTANT SYS_unlink 0x0a
|
||||
#define SYS_unlink 0x0a
|
||||
// CONSTANT SYS_gettimeofday 0x4e
|
||||
#define SYS_gettimeofday 0x4e
|
||||
// CONSTANT SYS_clock_gettime 0x109
|
||||
#define SYS_clock_gettime 0x109
|
||||
// CONSTANT SYS_time 0x0d
|
||||
#define SYS_time 0x0d
|
||||
|
||||
// libc+gnu
|
||||
/* libc+tcc */
|
||||
#define SYS_close 0x06
|
||||
#define SYS_lseek 0x13
|
||||
#define SYS_rmdir 0x28
|
||||
#define SYS_stat 0x6a
|
||||
|
||||
/* libc+gnu */
|
||||
|
||||
#define SYS_chdir 0x0c
|
||||
#define SYS_link 0x09
|
||||
|
@ -56,7 +83,6 @@
|
|||
#define SYS_kill 0x25
|
||||
#define SYS_rename 0x26
|
||||
#define SYS_mkdir 0x27
|
||||
#define SYS_dup 0x29
|
||||
#define SYS_pipe 0x2a
|
||||
#define SYS_getgid 0x2f
|
||||
#define SYS_signal 0x30
|
||||
|
@ -64,28 +90,26 @@
|
|||
#define SYS_rt_sigaction 0xae
|
||||
#define SYS_signal 0x30
|
||||
#define SYS_fcntl 0x37
|
||||
#define SYS_dup2 0x3f
|
||||
#define SYS_getrusage 0x4d
|
||||
#define SYS_lstat 0x6b
|
||||
#define SYS_setitimer 0x68
|
||||
#define SYS_fstat 0x6c
|
||||
#define SYS_nanosleep 0xa2
|
||||
#define SYS_getdents 0x8d
|
||||
#define SYS_clock_gettime 0x109
|
||||
|
||||
// bash
|
||||
/* bash */
|
||||
#define SYS_setuid 0x17
|
||||
#define SYS_geteuid 0x31
|
||||
#define SYS_getegid 0x32
|
||||
#define SYS_setgid 0x3e
|
||||
#define SYS_getppid 0x40
|
||||
|
||||
// make+POSIX
|
||||
/* make+POSIX */
|
||||
#define SYS_sigprocmask 0x7e
|
||||
|
||||
// tar
|
||||
/* tar */
|
||||
#define SYS_symlink 0x53
|
||||
#define SYS_readlink 0x55
|
||||
#define SYS_mknod 0x0e
|
||||
|
||||
#endif // __MES_LINUX_X86_SYSCALL_H
|
||||
#endif /* __MES_LINUX_X86_SYSCALL_H */
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __M2_LIB_H
|
||||
#define __M2_LIB_H
|
||||
|
||||
char **environ;
|
||||
int __stdin;
|
||||
int __stdout;
|
||||
int __stderr;
|
||||
int errno;
|
||||
|
||||
// CONSTANT EOF 0xffffffff
|
||||
// CONSTANT __FILEDES_MAX 512
|
||||
|
||||
char* cast_intp_to_charp (int *i);
|
||||
char* cast_long_to_charp (long i);
|
||||
long cast_charp_to_long (char const *);
|
||||
long cast_int_to_long (int i);
|
||||
long cast_voidp_to_long (void const *);
|
||||
|
||||
char *itoa (int number);
|
||||
char *ltoa (long number);
|
||||
int __ungetc_p (int filedes);
|
||||
int eputs (char *s);
|
||||
int oputs (char *s);
|
||||
int puts (char *s);
|
||||
size_t strlen (char *s);
|
||||
ssize_t _write ();
|
||||
ssize_t write (int filedes, void *buffer, size_t size);
|
||||
void __ungetc_clear (int filedes);
|
||||
void __ungetc_init ();
|
||||
void __ungetc_set (int filedes, int c);
|
||||
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
|
||||
struct timespec
|
||||
{
|
||||
long tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
struct timeval
|
||||
{
|
||||
long tv_sec;
|
||||
long tv_usec;
|
||||
};
|
||||
|
||||
#endif /* __M2_LIB_H */
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -21,396 +21,162 @@
|
|||
#ifndef __MES_BUILTINS_H
|
||||
#define __MES_BUILTINS_H
|
||||
|
||||
// src/gc.mes
|
||||
SCM gc_check ();
|
||||
SCM gc ();
|
||||
// src/hash.mes
|
||||
SCM hashq (SCM x, SCM size);
|
||||
SCM hash (SCM x, SCM size);
|
||||
SCM hashq_get_handle (SCM table, SCM key, SCM dflt);
|
||||
SCM hashq_ref (SCM table, SCM key, SCM dflt);
|
||||
SCM hash_ref (SCM table, SCM key, SCM dflt);
|
||||
SCM hashq_set_x (SCM table, SCM key, SCM value);
|
||||
SCM hash_set_x (SCM table, SCM key, SCM value);
|
||||
SCM hash_table_printer (SCM table);
|
||||
SCM make_hash_table (SCM x);
|
||||
// src/lib.mes
|
||||
SCM procedure_name_ (SCM x);
|
||||
SCM display_ (SCM x);
|
||||
SCM display_error_ (SCM x);
|
||||
SCM display_port_ (SCM x, SCM p);
|
||||
SCM write_ (SCM x);
|
||||
SCM write_error_ (SCM x);
|
||||
SCM write_port_ (SCM x, SCM p);
|
||||
SCM exit_ (SCM x);
|
||||
SCM frame_printer (SCM frame);
|
||||
SCM make_stack (SCM stack);
|
||||
SCM stack_length (SCM stack);
|
||||
SCM stack_ref (SCM stack, SCM index);
|
||||
SCM xassq (SCM x, SCM a);
|
||||
SCM memq (SCM x, SCM a);
|
||||
SCM equal2_p (SCM a, SCM b);
|
||||
SCM last_pair (SCM x);
|
||||
SCM pair_p (SCM x);
|
||||
// src/math.mes
|
||||
SCM greater_p (SCM x);
|
||||
SCM less_p (SCM x);
|
||||
SCM is_p (SCM x);
|
||||
SCM minus (SCM x);
|
||||
SCM plus (SCM x);
|
||||
SCM divide (SCM x);
|
||||
SCM modulo (SCM a, SCM b);
|
||||
SCM multiply (SCM x);
|
||||
SCM logand (SCM x);
|
||||
SCM logior (SCM x);
|
||||
SCM lognot (SCM x);
|
||||
SCM logxor (SCM x);
|
||||
SCM ash (SCM n, SCM count);
|
||||
// src/mes.mes
|
||||
SCM make_cell_ (SCM type, SCM car, SCM cdr);
|
||||
SCM type_ (SCM x);
|
||||
SCM car_ (SCM x);
|
||||
SCM cdr_ (SCM x);
|
||||
SCM arity_ (SCM x);
|
||||
SCM cons (SCM x, SCM y);
|
||||
SCM car (SCM x);
|
||||
SCM cdr (SCM x);
|
||||
SCM list (SCM x);
|
||||
SCM null_p (SCM x);
|
||||
SCM eq_p (SCM x, SCM y);
|
||||
SCM values (SCM x);
|
||||
SCM acons (SCM key, SCM value, SCM alist);
|
||||
SCM length (SCM x);
|
||||
SCM error (SCM key, SCM x);
|
||||
SCM append2 (SCM x, SCM y);
|
||||
SCM append_reverse (SCM x, SCM y);
|
||||
SCM reverse_x_ (SCM x, SCM t);
|
||||
SCM pairlis (SCM x, SCM y, SCM a);
|
||||
SCM call (SCM fn, SCM x);
|
||||
SCM assq (SCM x, SCM a);
|
||||
SCM assoc (SCM x, SCM a);
|
||||
SCM set_car_x (SCM x, SCM e);
|
||||
SCM set_cdr_x (SCM x, SCM e);
|
||||
SCM set_env_x (SCM x, SCM e, SCM a);
|
||||
SCM macro_get_handle (SCM name);
|
||||
SCM add_formals (SCM formals, SCM x);
|
||||
SCM eval_apply ();
|
||||
SCM make_builtin_type ();
|
||||
SCM make_builtin (SCM builtin_type, SCM name, SCM arity, SCM function);
|
||||
SCM builtin_arity (SCM builtin);
|
||||
SCM builtin_p (SCM x);
|
||||
SCM builtin_printer (SCM builtin);
|
||||
// CONSTANT cell_nil 1
|
||||
#define cell_nil 1
|
||||
// CONSTANT cell_f 2
|
||||
#define cell_f 2
|
||||
// CONSTANT cell_t 3
|
||||
#define cell_t 3
|
||||
// CONSTANT cell_dot 4
|
||||
#define cell_dot 4
|
||||
// CONSTANT cell_arrow 5
|
||||
#define cell_arrow 5
|
||||
// CONSTANT cell_undefined 6
|
||||
#define cell_undefined 6
|
||||
// CONSTANT cell_unspecified 7
|
||||
#define cell_unspecified 7
|
||||
// CONSTANT cell_closure 8
|
||||
#define cell_closure 8
|
||||
// CONSTANT cell_circular 9
|
||||
#define cell_circular 9
|
||||
// CONSTANT cell_begin 10
|
||||
#define cell_begin 10
|
||||
// CONSTANT cell_call_with_current_continuation 11
|
||||
#define cell_call_with_current_continuation 11
|
||||
// CONSTANT cell_vm_apply 12
|
||||
#define cell_vm_apply 12
|
||||
// CONSTANT cell_vm_apply2 13
|
||||
#define cell_vm_apply2 13
|
||||
// CONSTANT cell_vm_begin 14
|
||||
#define cell_vm_begin 14
|
||||
// CONSTANT cell_vm_begin_eval 15
|
||||
#define cell_vm_begin_eval 15
|
||||
// CONSTANT cell_vm_begin_expand 16
|
||||
#define cell_vm_begin_expand 16
|
||||
// CONSTANT cell_vm_begin_expand_eval 17
|
||||
#define cell_vm_begin_expand_eval 17
|
||||
// CONSTANT cell_vm_begin_expand_macro 18
|
||||
#define cell_vm_begin_expand_macro 18
|
||||
// CONSTANT cell_vm_begin_expand_primitive_load 19
|
||||
#define cell_vm_begin_expand_primitive_load 19
|
||||
// CONSTANT cell_vm_begin_primitive_load 20
|
||||
#define cell_vm_begin_primitive_load 20
|
||||
// CONSTANT cell_vm_begin_read_input_file 21
|
||||
#define cell_vm_begin_read_input_file 21
|
||||
// CONSTANT cell_vm_call_with_current_continuation2 22
|
||||
#define cell_vm_call_with_current_continuation2 22
|
||||
// CONSTANT cell_vm_call_with_values2 23
|
||||
#define cell_vm_call_with_values2 23
|
||||
// CONSTANT cell_vm_eval 24
|
||||
#define cell_vm_eval 24
|
||||
// CONSTANT cell_vm_eval2 25
|
||||
#define cell_vm_eval2 25
|
||||
// CONSTANT cell_vm_eval_check_func 26
|
||||
#define cell_vm_eval_check_func 26
|
||||
// CONSTANT cell_vm_eval_define 27
|
||||
#define cell_vm_eval_define 27
|
||||
// CONSTANT cell_vm_eval_macro_expand_eval 28
|
||||
#define cell_vm_eval_macro_expand_eval 28
|
||||
// CONSTANT cell_vm_eval_macro_expand_expand 29
|
||||
#define cell_vm_eval_macro_expand_expand 29
|
||||
// CONSTANT cell_vm_eval_pmatch_car 30
|
||||
#define cell_vm_eval_pmatch_car 30
|
||||
// CONSTANT cell_vm_eval_pmatch_cdr 31
|
||||
#define cell_vm_eval_pmatch_cdr 31
|
||||
// CONSTANT cell_vm_eval_set_x 32
|
||||
#define cell_vm_eval_set_x 32
|
||||
// CONSTANT cell_vm_evlis 33
|
||||
#define cell_vm_evlis 33
|
||||
// CONSTANT cell_vm_evlis2 34
|
||||
#define cell_vm_evlis2 34
|
||||
// CONSTANT cell_vm_evlis3 35
|
||||
#define cell_vm_evlis3 35
|
||||
// CONSTANT cell_vm_if 36
|
||||
#define cell_vm_if 36
|
||||
// CONSTANT cell_vm_if_expr 37
|
||||
#define cell_vm_if_expr 37
|
||||
// CONSTANT cell_vm_macro_expand 38
|
||||
#define cell_vm_macro_expand 38
|
||||
// CONSTANT cell_vm_macro_expand_car 39
|
||||
#define cell_vm_macro_expand_car 39
|
||||
// CONSTANT cell_vm_macro_expand_cdr 40
|
||||
#define cell_vm_macro_expand_cdr 40
|
||||
// CONSTANT cell_vm_macro_expand_define 41
|
||||
#define cell_vm_macro_expand_define 41
|
||||
// CONSTANT cell_vm_macro_expand_define_macro 42
|
||||
#define cell_vm_macro_expand_define_macro 42
|
||||
// CONSTANT cell_vm_macro_expand_lambda 43
|
||||
#define cell_vm_macro_expand_lambda 43
|
||||
// CONSTANT cell_vm_macro_expand_set_x 44
|
||||
#define cell_vm_macro_expand_set_x 44
|
||||
// CONSTANT cell_vm_return 45
|
||||
#define cell_vm_return 45
|
||||
// CONSTANT cell_symbol_dot 46
|
||||
#define cell_symbol_dot 46
|
||||
// CONSTANT cell_symbol_lambda 47
|
||||
#define cell_symbol_lambda 47
|
||||
// CONSTANT cell_symbol_begin 48
|
||||
#define cell_symbol_begin 48
|
||||
// CONSTANT cell_symbol_if 49
|
||||
#define cell_symbol_if 49
|
||||
// CONSTANT cell_symbol_quote 50
|
||||
#define cell_symbol_quote 50
|
||||
// CONSTANT cell_symbol_define 51
|
||||
#define cell_symbol_define 51
|
||||
// CONSTANT cell_symbol_define_macro 52
|
||||
#define cell_symbol_define_macro 52
|
||||
// CONSTANT cell_symbol_quasiquote 53
|
||||
#define cell_symbol_quasiquote 53
|
||||
// CONSTANT cell_symbol_unquote 54
|
||||
#define cell_symbol_unquote 54
|
||||
// CONSTANT cell_symbol_unquote_splicing 55
|
||||
#define cell_symbol_unquote_splicing 55
|
||||
// CONSTANT cell_symbol_syntax 56
|
||||
#define cell_symbol_syntax 56
|
||||
// CONSTANT cell_symbol_quasisyntax 57
|
||||
#define cell_symbol_quasisyntax 57
|
||||
// CONSTANT cell_symbol_unsyntax 58
|
||||
#define cell_symbol_unsyntax 58
|
||||
// CONSTANT cell_symbol_unsyntax_splicing 59
|
||||
#define cell_symbol_unsyntax_splicing 59
|
||||
// CONSTANT cell_symbol_set_x 60
|
||||
#define cell_symbol_set_x 60
|
||||
// CONSTANT cell_symbol_sc_expand 61
|
||||
#define cell_symbol_sc_expand 61
|
||||
// CONSTANT cell_symbol_macro_expand 62
|
||||
#define cell_symbol_macro_expand 62
|
||||
// CONSTANT cell_symbol_portable_macro_expand 63
|
||||
#define cell_symbol_portable_macro_expand 63
|
||||
// CONSTANT cell_symbol_sc_expander_alist 64
|
||||
#define cell_symbol_sc_expander_alist 64
|
||||
// CONSTANT cell_symbol_call_with_values 65
|
||||
#define cell_symbol_call_with_values 65
|
||||
// CONSTANT cell_symbol_call_with_current_continuation 66
|
||||
#define cell_symbol_call_with_current_continuation 66
|
||||
// CONSTANT cell_symbol_boot_module 67
|
||||
#define cell_symbol_boot_module 67
|
||||
// CONSTANT cell_symbol_current_module 68
|
||||
#define cell_symbol_current_module 68
|
||||
// CONSTANT cell_symbol_primitive_load 69
|
||||
#define cell_symbol_primitive_load 69
|
||||
// CONSTANT cell_symbol_read_input_file 70
|
||||
#define cell_symbol_read_input_file 70
|
||||
// CONSTANT cell_symbol_write 71
|
||||
#define cell_symbol_write 71
|
||||
// CONSTANT cell_symbol_display 72
|
||||
#define cell_symbol_display 72
|
||||
// CONSTANT cell_symbol_car 73
|
||||
#define cell_symbol_car 73
|
||||
// CONSTANT cell_symbol_cdr 74
|
||||
#define cell_symbol_cdr 74
|
||||
// CONSTANT cell_symbol_not_a_number 75
|
||||
#define cell_symbol_not_a_number 75
|
||||
// CONSTANT cell_symbol_not_a_pair 76
|
||||
#define cell_symbol_not_a_pair 76
|
||||
// CONSTANT cell_symbol_system_error 77
|
||||
#define cell_symbol_system_error 77
|
||||
// CONSTANT cell_symbol_throw 78
|
||||
#define cell_symbol_throw 78
|
||||
// CONSTANT cell_symbol_unbound_variable 79
|
||||
#define cell_symbol_unbound_variable 79
|
||||
// CONSTANT cell_symbol_wrong_number_of_args 80
|
||||
#define cell_symbol_wrong_number_of_args 80
|
||||
// CONSTANT cell_symbol_wrong_type_arg 81
|
||||
#define cell_symbol_wrong_type_arg 81
|
||||
// CONSTANT cell_symbol_buckets 82
|
||||
#define cell_symbol_buckets 82
|
||||
// CONSTANT cell_symbol_builtin 83
|
||||
#define cell_symbol_builtin 83
|
||||
// CONSTANT cell_symbol_frame 84
|
||||
#define cell_symbol_frame 84
|
||||
// CONSTANT cell_symbol_hashq_table 85
|
||||
#define cell_symbol_hashq_table 85
|
||||
// CONSTANT cell_symbol_module 86
|
||||
#define cell_symbol_module 86
|
||||
// CONSTANT cell_symbol_procedure 87
|
||||
#define cell_symbol_procedure 87
|
||||
// CONSTANT cell_symbol_record_type 88
|
||||
#define cell_symbol_record_type 88
|
||||
// CONSTANT cell_symbol_size 89
|
||||
#define cell_symbol_size 89
|
||||
// CONSTANT cell_symbol_stack 90
|
||||
#define cell_symbol_stack 90
|
||||
// CONSTANT cell_symbol_argv 91
|
||||
#define cell_symbol_argv 91
|
||||
// CONSTANT cell_symbol_mes_prefix 92
|
||||
#define cell_symbol_mes_prefix 92
|
||||
// CONSTANT cell_symbol_mes_version 93
|
||||
#define cell_symbol_mes_version 93
|
||||
// CONSTANT cell_symbol_internal_time_units_per_second 94
|
||||
#define cell_symbol_internal_time_units_per_second 94
|
||||
// CONSTANT cell_symbol_compiler 95
|
||||
#define cell_symbol_compiler 95
|
||||
// CONSTANT cell_symbol_arch 96
|
||||
#define cell_symbol_arch 96
|
||||
// CONSTANT cell_symbol_pmatch_car 97
|
||||
#define cell_symbol_pmatch_car 97
|
||||
// CONSTANT cell_symbol_pmatch_cdr 98
|
||||
#define cell_symbol_pmatch_cdr 98
|
||||
// CONSTANT cell_type_bytes 99
|
||||
#define cell_type_bytes 99
|
||||
// CONSTANT cell_type_char 100
|
||||
#define cell_type_char 100
|
||||
// CONSTANT cell_type_closure 101
|
||||
#define cell_type_closure 101
|
||||
// CONSTANT cell_type_continuation 102
|
||||
#define cell_type_continuation 102
|
||||
// CONSTANT cell_type_function 103
|
||||
#define cell_type_function 103
|
||||
// CONSTANT cell_type_keyword 104
|
||||
#define cell_type_keyword 104
|
||||
// CONSTANT cell_type_macro 105
|
||||
#define cell_type_macro 105
|
||||
// CONSTANT cell_type_number 106
|
||||
#define cell_type_number 106
|
||||
// CONSTANT cell_type_pair 107
|
||||
#define cell_type_pair 107
|
||||
// CONSTANT cell_type_port 108
|
||||
#define cell_type_port 108
|
||||
// CONSTANT cell_type_ref 109
|
||||
#define cell_type_ref 109
|
||||
// CONSTANT cell_type_special 110
|
||||
#define cell_type_special 110
|
||||
// CONSTANT cell_type_string 111
|
||||
#define cell_type_string 111
|
||||
// CONSTANT cell_type_struct 112
|
||||
#define cell_type_struct 112
|
||||
// CONSTANT cell_type_symbol 113
|
||||
#define cell_type_symbol 113
|
||||
// CONSTANT cell_type_values 114
|
||||
#define cell_type_values 114
|
||||
// CONSTANT cell_type_variable 115
|
||||
#define cell_type_variable 115
|
||||
// CONSTANT cell_type_vector 116
|
||||
#define cell_type_vector 116
|
||||
// CONSTANT cell_type_broken_heart 117
|
||||
#define cell_type_broken_heart 117
|
||||
// CONSTANT cell_symbol_test 118
|
||||
#define cell_symbol_test 118
|
||||
// src/module.mes
|
||||
SCM make_module_type ();
|
||||
SCM module_printer (SCM module);
|
||||
SCM module_variable (SCM module, SCM name);
|
||||
SCM module_ref (SCM module, SCM name);
|
||||
SCM module_define_x (SCM module, SCM name, SCM value);
|
||||
// src/posix.mes
|
||||
SCM peek_byte ();
|
||||
SCM read_byte ();
|
||||
SCM unread_byte (SCM i);
|
||||
SCM peek_char ();
|
||||
SCM read_char (SCM port);
|
||||
SCM unread_char (SCM i);
|
||||
SCM write_char (SCM i);
|
||||
SCM write_byte (SCM x);
|
||||
SCM getenv_ (SCM s);
|
||||
SCM setenv_ (SCM s, SCM v);
|
||||
SCM access_p (SCM file_name, SCM mode);
|
||||
SCM current_input_port ();
|
||||
SCM open_input_file (SCM file_name);
|
||||
SCM open_input_string (SCM string);
|
||||
SCM set_current_input_port (SCM port);
|
||||
SCM current_output_port ();
|
||||
SCM current_error_port ();
|
||||
SCM open_output_file (SCM x);
|
||||
SCM set_current_output_port (SCM port);
|
||||
SCM set_current_error_port (SCM port);
|
||||
SCM force_output (SCM p);
|
||||
SCM chmod_ (SCM file_name, SCM mode);
|
||||
SCM isatty_p (SCM port);
|
||||
SCM primitive_fork ();
|
||||
SCM execl_ (SCM file_name, SCM args);
|
||||
SCM waitpid_ (SCM pid, SCM options);
|
||||
SCM current_time ();
|
||||
SCM gettimeofday_ ();
|
||||
SCM get_internal_run_time ();
|
||||
SCM getcwd_ ();
|
||||
SCM dup_ (SCM port);
|
||||
SCM dup2_ (SCM old, SCM new);
|
||||
SCM delete_file (SCM file_name);
|
||||
// src/reader.mes
|
||||
SCM read_input_file_env_ (SCM e, SCM a);
|
||||
SCM read_input_file_env (SCM a);
|
||||
SCM read_env (SCM a);
|
||||
SCM reader_read_sexp (SCM c, SCM s, SCM a);
|
||||
SCM reader_read_character ();
|
||||
SCM reader_read_binary ();
|
||||
SCM reader_read_octal ();
|
||||
SCM reader_read_hex ();
|
||||
SCM reader_read_string ();
|
||||
// src/strings.mes
|
||||
SCM string_equal_p (SCM a, SCM b);
|
||||
SCM symbol_to_string (SCM symbol);
|
||||
SCM symbol_to_keyword (SCM symbol);
|
||||
SCM keyword_to_string (SCM keyword);
|
||||
SCM string_to_symbol (SCM string);
|
||||
SCM make_symbol (SCM string);
|
||||
SCM string_to_list (SCM string);
|
||||
SCM list_to_string (SCM list);
|
||||
SCM read_string (SCM port);
|
||||
SCM string_append (SCM x);
|
||||
SCM string_length (SCM string);
|
||||
SCM string_ref (SCM str, SCM k);
|
||||
// src/struct.mes
|
||||
SCM make_struct (SCM type, SCM fields, SCM printer);
|
||||
SCM struct_length (SCM x);
|
||||
SCM struct_ref (SCM x, SCM i);
|
||||
SCM struct_set_x (SCM x, SCM i, SCM e);
|
||||
// src/vector.mes
|
||||
SCM make_vector_ (SCM n);
|
||||
SCM vector_length (SCM x);
|
||||
SCM vector_ref (SCM x, SCM i);
|
||||
SCM vector_entry (SCM x);
|
||||
SCM vector_set_x (SCM x, SCM i, SCM e);
|
||||
SCM list_to_vector (SCM x);
|
||||
SCM vector_to_list (SCM v);
|
||||
/* src/builtins.c */
|
||||
struct scm *make_builtin (struct scm *builtin_type, struct scm *name, struct scm *arity, struct scm *function);
|
||||
struct scm *builtin_name (struct scm *builtin);
|
||||
struct scm *builtin_arity (struct scm *builtin);
|
||||
struct scm *builtin_p (struct scm *x);
|
||||
struct scm *builtin_printer (struct scm *builtin);
|
||||
/* src/core.c */
|
||||
struct scm *car (struct scm *x);
|
||||
struct scm *cdr (struct scm *x);
|
||||
struct scm *list (struct scm *x);
|
||||
struct scm *null_p (struct scm *x);
|
||||
struct scm *eq_p (struct scm *x, struct scm *y);
|
||||
struct scm *values (struct scm *x);
|
||||
struct scm *acons (struct scm *key, struct scm *value, struct scm *alist);
|
||||
struct scm *length (struct scm *x);
|
||||
struct scm *error (struct scm *key, struct scm *x);
|
||||
struct scm *append2 (struct scm *x, struct scm *y);
|
||||
struct scm *append_reverse (struct scm *x, struct scm *y);
|
||||
struct scm *reverse_x_ (struct scm *x, struct scm *t);
|
||||
struct scm *assq (struct scm *x, struct scm *a);
|
||||
struct scm *assoc (struct scm *x, struct scm *a);
|
||||
/* src/display.c */
|
||||
struct scm *display_ (struct scm *x);
|
||||
struct scm *display_error_ (struct scm *x);
|
||||
struct scm *display_port_ (struct scm *x, struct scm *p);
|
||||
struct scm *write_ (struct scm *x);
|
||||
struct scm *write_error_ (struct scm *x);
|
||||
struct scm *write_port_ (struct scm *x, struct scm *p);
|
||||
/* src/eval-apply.c */
|
||||
struct scm *pairlis (struct scm *x, struct scm *y, struct scm *a);
|
||||
struct scm *set_car_x (struct scm *x, struct scm *e);
|
||||
struct scm *set_cdr_x (struct scm *x, struct scm *e);
|
||||
struct scm *set_env_x (struct scm *x, struct scm *e, struct scm *a);
|
||||
struct scm *add_formals (struct scm *formals, struct scm *x);
|
||||
struct scm *eval_apply ();
|
||||
/* src/gc.c */
|
||||
struct scm *gc_stats ();
|
||||
struct scm *cons (struct scm *x, struct scm *y);
|
||||
struct scm *gc_check ();
|
||||
struct scm *gc ();
|
||||
/* src/hash.c */
|
||||
struct scm *hashq (struct scm *x, struct scm *size);
|
||||
struct scm *hash (struct scm *x, struct scm *size);
|
||||
struct scm *hashq_get_handle (struct scm *table, struct scm *key, struct scm *dflt);
|
||||
struct scm *hashq_ref (struct scm *table, struct scm *key, struct scm *dflt);
|
||||
struct scm *hash_ref (struct scm *table, struct scm *key, struct scm *dflt);
|
||||
struct scm *hashq_set_x (struct scm *table, struct scm *key, struct scm *value);
|
||||
struct scm *hash_set_x (struct scm *table, struct scm *key, struct scm *value);
|
||||
struct scm *hash_table_printer (struct scm *table);
|
||||
struct scm *make_hash_table (struct scm *x);
|
||||
/* src/lib.c */
|
||||
struct scm *type_ (struct scm *x);
|
||||
struct scm *car_ (struct scm *x);
|
||||
struct scm *cdr_ (struct scm *x);
|
||||
struct scm *xassq (struct scm *x, struct scm *a);
|
||||
struct scm *memq (struct scm *x, struct scm *a);
|
||||
struct scm *equal2_p (struct scm *a, struct scm *b);
|
||||
struct scm *last_pair (struct scm *x);
|
||||
struct scm *pair_p (struct scm *x);
|
||||
struct scm *char_to_integer (struct scm *x);
|
||||
struct scm *integer_to_char (struct scm *x);
|
||||
/* src/math.c */
|
||||
struct scm *greater_p (struct scm *x);
|
||||
struct scm *less_p (struct scm *x);
|
||||
struct scm *is_p (struct scm *x);
|
||||
struct scm *minus (struct scm *x);
|
||||
struct scm *plus (struct scm *x);
|
||||
struct scm *divide (struct scm *x);
|
||||
struct scm *modulo (struct scm *a, struct scm *b);
|
||||
struct scm *multiply (struct scm *x);
|
||||
struct scm *logand (struct scm *x);
|
||||
struct scm *logior (struct scm *x);
|
||||
struct scm *lognot (struct scm *x);
|
||||
struct scm *logxor (struct scm *x);
|
||||
struct scm *ash (struct scm *n, struct scm *count);
|
||||
/* src/module.c */
|
||||
struct scm *make_module_type ();
|
||||
struct scm *module_printer (struct scm *module);
|
||||
struct scm *module_variable (struct scm *module, struct scm *name);
|
||||
struct scm *module_ref (struct scm *module, struct scm *name);
|
||||
struct scm *module_define_x (struct scm *module, struct scm *name, struct scm *value);
|
||||
/* src/posix.c */
|
||||
struct scm *abort_ ();
|
||||
struct scm *exit_ (struct scm *x);
|
||||
struct scm *peek_byte ();
|
||||
struct scm *read_byte ();
|
||||
struct scm *unread_byte (struct scm *i);
|
||||
struct scm *peek_char ();
|
||||
struct scm *read_char (struct scm *port);
|
||||
struct scm *unread_char (struct scm *i);
|
||||
struct scm *write_char (struct scm *i);
|
||||
struct scm *write_byte (struct scm *x);
|
||||
struct scm *getenv_ (struct scm *s);
|
||||
struct scm *setenv_ (struct scm *s, struct scm *v);
|
||||
struct scm *access_p (struct scm *file_name, struct scm *mode);
|
||||
struct scm *current_input_port ();
|
||||
struct scm *open_input_file (struct scm *file_name);
|
||||
struct scm *open_input_string (struct scm *string);
|
||||
struct scm *set_current_input_port (struct scm *port);
|
||||
struct scm *current_output_port ();
|
||||
struct scm *current_error_port ();
|
||||
struct scm *open_output_file (struct scm *x);
|
||||
struct scm *set_current_output_port (struct scm *port);
|
||||
struct scm *set_current_error_port (struct scm *port);
|
||||
struct scm *chmod_ (struct scm *file_name, struct scm *mode);
|
||||
struct scm *isatty_p (struct scm *port);
|
||||
struct scm *primitive_fork ();
|
||||
struct scm *execl_ (struct scm *file_name, struct scm *args);
|
||||
struct scm *waitpid_ (struct scm *pid, struct scm *options);
|
||||
struct scm *current_time ();
|
||||
struct scm *gettimeofday_ ();
|
||||
struct scm *get_internal_run_time ();
|
||||
struct scm *getcwd_ ();
|
||||
struct scm *dup_ (struct scm *port);
|
||||
struct scm *dup2_ (struct scm *old, struct scm *new);
|
||||
struct scm *delete_file (struct scm *file_name);
|
||||
/* src/reader.c */
|
||||
struct scm *read_input_file_env_ (struct scm *e, struct scm *a);
|
||||
struct scm *read_input_file_env (struct scm *a);
|
||||
struct scm *read_env (struct scm *a);
|
||||
struct scm *reader_read_sexp (struct scm *c, struct scm *s, struct scm *a);
|
||||
struct scm *reader_read_character ();
|
||||
struct scm *reader_read_binary ();
|
||||
struct scm *reader_read_octal ();
|
||||
struct scm *reader_read_hex ();
|
||||
struct scm *reader_read_string ();
|
||||
/* src/stack.c */
|
||||
struct scm *frame_printer (struct scm *frame);
|
||||
struct scm *make_stack (struct scm *stack);
|
||||
struct scm *stack_length (struct scm *stack);
|
||||
struct scm *stack_ref (struct scm *stack, struct scm *index);
|
||||
/* src/string.c */
|
||||
struct scm *string_equal_p (struct scm *a, struct scm *b);
|
||||
struct scm *symbol_to_string (struct scm *symbol);
|
||||
struct scm *symbol_to_keyword (struct scm *symbol);
|
||||
struct scm *keyword_to_string (struct scm *keyword);
|
||||
struct scm *string_to_symbol (struct scm *string);
|
||||
struct scm *make_symbol (struct scm *string);
|
||||
struct scm *string_to_list (struct scm *string);
|
||||
struct scm *list_to_string (struct scm *list);
|
||||
struct scm *read_string (struct scm *port);
|
||||
struct scm *string_append (struct scm *x);
|
||||
struct scm *string_length (struct scm *string);
|
||||
struct scm *string_ref (struct scm *str, struct scm *k);
|
||||
/* src/struct.c */
|
||||
struct scm *make_struct (struct scm *type, struct scm *fields, struct scm *printer);
|
||||
struct scm *struct_length (struct scm *x);
|
||||
struct scm *struct_ref (struct scm *x, struct scm *i);
|
||||
struct scm *struct_set_x (struct scm *x, struct scm *i, struct scm *e);
|
||||
/* src/vector.c */
|
||||
struct scm *make_vector (struct scm *x);
|
||||
struct scm *vector_length (struct scm *x);
|
||||
struct scm *vector_ref (struct scm *x, struct scm *i);
|
||||
struct scm *vector_entry (struct scm *x);
|
||||
struct scm *vector_set_x (struct scm *x, struct scm *i, struct scm *e);
|
||||
struct scm *list_to_vector (struct scm *x);
|
||||
struct scm *vector_to_list (struct scm *v);
|
||||
|
||||
#endif //__MES_BUILTINS_H
|
||||
#endif /* __MES_BUILTINS_H */
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MES_CC_H
|
||||
#define __MES_CC_H
|
||||
|
||||
typedef struct scm* SCM;
|
||||
|
||||
#if __MESC__
|
||||
typedef long FUNCTION;
|
||||
typedef long function0_t;
|
||||
typedef long function1_t;
|
||||
typedef long function2_t;
|
||||
typedef long function3_t;
|
||||
typedef long functionn_t;
|
||||
#else // !__MESC__
|
||||
typedef SCM (*FUNCTION) (void);
|
||||
typedef SCM (*function0_t) (void);
|
||||
typedef SCM (*function1_t) (SCM);
|
||||
typedef SCM (*function2_t) (SCM, SCM);
|
||||
typedef SCM (*function3_t) (SCM, SCM, SCM);
|
||||
typedef SCM (*functionn_t) (SCM);
|
||||
#endif // !__MESC__
|
||||
|
||||
#endif //__MES_CC_H
|
|
@ -21,263 +21,13 @@
|
|||
#ifndef __MES_CONSTANTS_H
|
||||
#define __MES_CONSTANTS_H
|
||||
|
||||
/* Symbols */
|
||||
|
||||
// CONSTANT cell_nil 1
|
||||
#define cell_nil 1
|
||||
// CONSTANT cell_f 2
|
||||
#define cell_f 2
|
||||
// CONSTANT cell_t 3
|
||||
#define cell_t 3
|
||||
// CONSTANT cell_dot 4
|
||||
#define cell_dot 4
|
||||
// CONSTANT cell_arrow 5
|
||||
#define cell_arrow 5
|
||||
// CONSTANT cell_undefined 6
|
||||
#define cell_undefined 6
|
||||
// CONSTANT cell_unspecified 7
|
||||
#define cell_unspecified 7
|
||||
// CONSTANT cell_closure 8
|
||||
#define cell_closure 8
|
||||
// CONSTANT cell_circular 9
|
||||
#define cell_circular 9
|
||||
// CONSTANT cell_begin 10
|
||||
#define cell_begin 10
|
||||
// CONSTANT cell_call_with_current_continuation 11
|
||||
#define cell_call_with_current_continuation 11
|
||||
|
||||
// CONSTANT cell_vm_apply 12
|
||||
#define cell_vm_apply 12
|
||||
// CONSTANT cell_vm_apply2 13
|
||||
#define cell_vm_apply2 13
|
||||
// CONSTANT cell_vm_begin 14
|
||||
#define cell_vm_begin 14
|
||||
// CONSTANT cell_vm_begin_eval 15
|
||||
#define cell_vm_begin_eval 15
|
||||
// CONSTANT cell_vm_begin_expand 16
|
||||
#define cell_vm_begin_expand 16
|
||||
// CONSTANT cell_vm_begin_expand_eval 17
|
||||
#define cell_vm_begin_expand_eval 17
|
||||
// CONSTANT cell_vm_begin_expand_macro 18
|
||||
#define cell_vm_begin_expand_macro 18
|
||||
// CONSTANT cell_vm_begin_expand_primitive_load 19
|
||||
#define cell_vm_begin_expand_primitive_load 19
|
||||
// CONSTANT cell_vm_begin_primitive_load 20
|
||||
#define cell_vm_begin_primitive_load 20
|
||||
// CONSTANT cell_vm_begin_read_input_file 21
|
||||
#define cell_vm_begin_read_input_file 21
|
||||
// CONSTANT cell_vm_call_with_current_continuation2 22
|
||||
#define cell_vm_call_with_current_continuation2 22
|
||||
// CONSTANT cell_vm_call_with_values2 23
|
||||
#define cell_vm_call_with_values2 23
|
||||
// CONSTANT cell_vm_eval 24
|
||||
#define cell_vm_eval 24
|
||||
// CONSTANT cell_vm_eval2 25
|
||||
#define cell_vm_eval2 25
|
||||
// CONSTANT cell_vm_eval_check_func 26
|
||||
#define cell_vm_eval_check_func 26
|
||||
// CONSTANT cell_vm_eval_define 27
|
||||
#define cell_vm_eval_define 27
|
||||
// CONSTANT cell_vm_eval_macro_expand_eval 28
|
||||
#define cell_vm_eval_macro_expand_eval 28
|
||||
// CONSTANT cell_vm_eval_macro_expand_expand 29
|
||||
#define cell_vm_eval_macro_expand_expand 29
|
||||
// CONSTANT cell_vm_eval_pmatch_car 30
|
||||
#define cell_vm_eval_pmatch_car 30
|
||||
// CONSTANT cell_vm_eval_pmatch_cdr 31
|
||||
#define cell_vm_eval_pmatch_cdr 31
|
||||
// CONSTANT cell_vm_eval_set_x 32
|
||||
#define cell_vm_eval_set_x 32
|
||||
// CONSTANT cell_vm_evlis 33
|
||||
#define cell_vm_evlis 33
|
||||
// CONSTANT cell_vm_evlis2 34
|
||||
#define cell_vm_evlis2 34
|
||||
// CONSTANT cell_vm_evlis3 35
|
||||
#define cell_vm_evlis3 35
|
||||
// CONSTANT cell_vm_if 36
|
||||
#define cell_vm_if 36
|
||||
// CONSTANT cell_vm_if_expr 37
|
||||
#define cell_vm_if_expr 37
|
||||
// CONSTANT cell_vm_macro_expand 38
|
||||
#define cell_vm_macro_expand 38
|
||||
// CONSTANT cell_vm_macro_expand_car 39
|
||||
#define cell_vm_macro_expand_car 39
|
||||
// CONSTANT cell_vm_macro_expand_cdr 40
|
||||
#define cell_vm_macro_expand_cdr 40
|
||||
// CONSTANT cell_vm_macro_expand_define 41
|
||||
#define cell_vm_macro_expand_define 41
|
||||
// CONSTANT cell_vm_macro_expand_define_macro 42
|
||||
#define cell_vm_macro_expand_define_macro 42
|
||||
// CONSTANT cell_vm_macro_expand_lambda 43
|
||||
#define cell_vm_macro_expand_lambda 43
|
||||
// CONSTANT cell_vm_macro_expand_set_x 44
|
||||
#define cell_vm_macro_expand_set_x 44
|
||||
// CONSTANT cell_vm_return 45
|
||||
#define cell_vm_return 45
|
||||
|
||||
// CONSTANT cell_symbol_dot 46
|
||||
#define cell_symbol_dot 46
|
||||
// CONSTANT cell_symbol_lambda 47
|
||||
#define cell_symbol_lambda 47
|
||||
// CONSTANT cell_symbol_begin 48
|
||||
#define cell_symbol_begin 48
|
||||
// CONSTANT cell_symbol_if 49
|
||||
#define cell_symbol_if 49
|
||||
// CONSTANT cell_symbol_quote 50
|
||||
#define cell_symbol_quote 50
|
||||
// CONSTANT cell_symbol_define 51
|
||||
#define cell_symbol_define 51
|
||||
// CONSTANT cell_symbol_define_macro 52
|
||||
#define cell_symbol_define_macro 52
|
||||
|
||||
// CONSTANT cell_symbol_quasiquote 53
|
||||
#define cell_symbol_quasiquote 53
|
||||
// CONSTANT cell_symbol_unquote 54
|
||||
#define cell_symbol_unquote 54
|
||||
// CONSTANT cell_symbol_unquote_splicing 55
|
||||
#define cell_symbol_unquote_splicing 55
|
||||
// CONSTANT cell_symbol_syntax 56
|
||||
#define cell_symbol_syntax 56
|
||||
// CONSTANT cell_symbol_quasisyntax 57
|
||||
#define cell_symbol_quasisyntax 57
|
||||
// CONSTANT cell_symbol_unsyntax 58
|
||||
#define cell_symbol_unsyntax 58
|
||||
// CONSTANT cell_symbol_unsyntax_splicing 59
|
||||
#define cell_symbol_unsyntax_splicing 59
|
||||
|
||||
// CONSTANT cell_symbol_set_x 60
|
||||
#define cell_symbol_set_x 60
|
||||
|
||||
// CONSTANT cell_symbol_sc_expand 61
|
||||
#define cell_symbol_sc_expand 61
|
||||
// CONSTANT cell_symbol_macro_expand 62
|
||||
#define cell_symbol_macro_expand 62
|
||||
// CONSTANT cell_symbol_portable_macro_expand 63
|
||||
#define cell_symbol_portable_macro_expand 63
|
||||
// CONSTANT cell_symbol_sc_expander_alist 64
|
||||
#define cell_symbol_sc_expander_alist 64
|
||||
|
||||
// CONSTANT cell_symbol_call_with_values 65
|
||||
#define cell_symbol_call_with_values 65
|
||||
// CONSTANT cell_symbol_call_with_current_continuation 66
|
||||
#define cell_symbol_call_with_current_continuation 66
|
||||
// CONSTANT cell_symbol_boot_module 67
|
||||
#define cell_symbol_boot_module 67
|
||||
// CONSTANT cell_symbol_current_module 68
|
||||
#define cell_symbol_current_module 68
|
||||
// CONSTANT cell_symbol_primitive_load 69
|
||||
#define cell_symbol_primitive_load 69
|
||||
// CONSTANT cell_symbol_read_input_file 70
|
||||
#define cell_symbol_read_input_file 70
|
||||
// CONSTANT cell_symbol_write 71
|
||||
#define cell_symbol_write 71
|
||||
// CONSTANT cell_symbol_display 72
|
||||
#define cell_symbol_display 72
|
||||
|
||||
// CONSTANT cell_symbol_car 73
|
||||
#define cell_symbol_car 73
|
||||
// CONSTANT cell_symbol_cdr 74
|
||||
#define cell_symbol_cdr 74
|
||||
// CONSTANT cell_symbol_not_a_number 75
|
||||
#define cell_symbol_not_a_number 75
|
||||
// CONSTANT cell_symbol_not_a_pair 76
|
||||
#define cell_symbol_not_a_pair 76
|
||||
// CONSTANT cell_symbol_system_error 77
|
||||
#define cell_symbol_system_error 77
|
||||
// CONSTANT cell_symbol_throw 78
|
||||
#define cell_symbol_throw 78
|
||||
// CONSTANT cell_symbol_unbound_variable 79
|
||||
#define cell_symbol_unbound_variable 79
|
||||
// CONSTANT cell_symbol_wrong_number_of_args 80
|
||||
#define cell_symbol_wrong_number_of_args 80
|
||||
// CONSTANT cell_symbol_wrong_type_arg 81
|
||||
#define cell_symbol_wrong_type_arg 81
|
||||
|
||||
// CONSTANT cell_symbol_buckets 82
|
||||
#define cell_symbol_buckets 82
|
||||
// CONSTANT cell_symbol_builtin 83
|
||||
#define cell_symbol_builtin 83
|
||||
// CONSTANT cell_symbol_frame 84
|
||||
#define cell_symbol_frame 84
|
||||
// CONSTANT cell_symbol_hashq_table 85
|
||||
#define cell_symbol_hashq_table 85
|
||||
// CONSTANT cell_symbol_module 86
|
||||
#define cell_symbol_module 86
|
||||
// CONSTANT cell_symbol_procedure 87
|
||||
#define cell_symbol_procedure 87
|
||||
// CONSTANT cell_symbol_record_type 88
|
||||
#define cell_symbol_record_type 88
|
||||
// CONSTANT cell_symbol_size 89
|
||||
#define cell_symbol_size 89
|
||||
// CONSTANT cell_symbol_stack 90
|
||||
#define cell_symbol_stack 90
|
||||
|
||||
// CONSTANT cell_symbol_argv 91
|
||||
#define cell_symbol_argv 91
|
||||
// CONSTANT cell_symbol_mes_datadir 92
|
||||
#define cell_symbol_mes_datadir 92
|
||||
// CONSTANT cell_symbol_mes_version 93
|
||||
#define cell_symbol_mes_version 93
|
||||
|
||||
// CONSTANT cell_symbol_internal_time_units_per_second 94
|
||||
#define cell_symbol_internal_time_units_per_second 94
|
||||
// CONSTANT cell_symbol_compiler 95
|
||||
#define cell_symbol_compiler 95
|
||||
// CONSTANT cell_symbol_arch 96
|
||||
#define cell_symbol_arch 96
|
||||
// CONSTANT cell_symbol_pmatch_car 97
|
||||
#define cell_symbol_pmatch_car 97
|
||||
// CONSTANT cell_symbol_pmatch_cdr 98
|
||||
#define cell_symbol_pmatch_cdr 98
|
||||
|
||||
// CONSTANT cell_type_bytes 99
|
||||
#define cell_type_bytes 99
|
||||
// CONSTANT cell_type_char 100
|
||||
#define cell_type_char 100
|
||||
// CONSTANT cell_type_closure 101
|
||||
#define cell_type_closure 101
|
||||
// CONSTANT cell_type_continuation 102
|
||||
#define cell_type_continuation 102
|
||||
// CONSTANT cell_type_function 103
|
||||
#define cell_type_function 103
|
||||
// CONSTANT cell_type_keyword 104
|
||||
#define cell_type_keyword 104
|
||||
// CONSTANT cell_type_macro 105
|
||||
#define cell_type_macro 105
|
||||
// CONSTANT cell_type_number 106
|
||||
#define cell_type_number 106
|
||||
// CONSTANT cell_type_pair 107
|
||||
#define cell_type_pair 107
|
||||
// CONSTANT cell_type_port 108
|
||||
#define cell_type_port 108
|
||||
// CONSTANT cell_type_ref 109
|
||||
#define cell_type_ref 109
|
||||
// CONSTANT cell_type_special 110
|
||||
#define cell_type_special 110
|
||||
// CONSTANT cell_type_string 111
|
||||
#define cell_type_string 111
|
||||
// CONSTANT cell_type_struct 112
|
||||
#define cell_type_struct 112
|
||||
// CONSTANT cell_type_symbol 113
|
||||
#define cell_type_symbol 113
|
||||
// CONSTANT cell_type_values 114
|
||||
#define cell_type_values 114
|
||||
// CONSTANT cell_type_variable 115
|
||||
#define cell_type_variable 115
|
||||
// CONSTANT cell_type_vector 116
|
||||
#define cell_type_vector 116
|
||||
// CONSTANT cell_type_broken_heart 117
|
||||
#define cell_type_broken_heart 117
|
||||
|
||||
// CONSTANT cell_test 118
|
||||
#define cell_test 118
|
||||
|
||||
/* Cell types */
|
||||
|
||||
// CONSTANT TBYTES 0
|
||||
#define TBYTES 0
|
||||
// CONSTANT TCHAR 1
|
||||
#define TCHAR 1
|
||||
// CONSTANT TCHAR 0
|
||||
#define TCHAR 0
|
||||
|
||||
// CONSTANT TBYTES 1
|
||||
#define TBYTES 1
|
||||
// CONSTANT TCLOSURE 2
|
||||
#define TCLOSURE 2
|
||||
// CONSTANT TCONTINUATION 3
|
||||
|
@ -318,7 +68,31 @@
|
|||
// CONSTANT STRUCT_PRINTER 1
|
||||
#define STRUCT_PRINTER 1
|
||||
|
||||
#define FRAME_SIZE 5
|
||||
#define FRAME_PROCEDURE 4
|
||||
// CONSTANT GC_FRAME_SIZE 5
|
||||
#define GC_FRAME_SIZE 5
|
||||
// CONSTANT GC_FRAME_PROCEDURE 4
|
||||
#define GC_FRAME_PROCEDURE 4
|
||||
|
||||
#endif //__MES_CONSTANTS_H
|
||||
// CONSTANT STDIN 0
|
||||
// CONSTANT STDOUT 1
|
||||
// CONSTANT STDERR 2
|
||||
|
||||
/* Unknown type 1
|
||||
// CONSTANT EOF -1
|
||||
*/
|
||||
|
||||
// CONSTANT O_RDONLY 0
|
||||
// CONSTANT O_WRONLY 1
|
||||
// CONSTANT O_CREAT 0x40
|
||||
// CONSTANT O_TRUNC 0x200
|
||||
|
||||
// CONSTANT PATH_MAX 1024
|
||||
// CONSTANT __FILEDES_MAX 512
|
||||
|
||||
// CONSTANT S_IRUSR 00400
|
||||
// CONSTANT S_IWUSR 00200
|
||||
|
||||
// CONSTANT CLOCK_PROCESS_CPUTIME_ID 2
|
||||
|
||||
|
||||
#endif /* __MES_CONSTANTS_H */
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
|
||||
#include <mes/lib-mini.h>
|
||||
|
||||
char *cast_intp_to_charp (int const *i);
|
||||
char *cast_long_to_charp (long i);
|
||||
long cast_charp_to_long (char const *);
|
||||
long cast_int_to_long (int i);
|
||||
long cast_voidp_to_long (void const *);
|
||||
|
||||
int __mes_debug ();
|
||||
void __ungetc_init ();
|
||||
void __ungetc_clear (int filedes);
|
||||
|
@ -43,7 +49,8 @@ char * fdgets (char *s, int count, int fd);
|
|||
int fdputc (int c, int fd);
|
||||
int fdputs (char const *s, int fd);
|
||||
int fdungetc (int c, int fd);
|
||||
char * _getcwd (char *buffer, size_t size);
|
||||
char *_getcwd (char *buffer, size_t size);
|
||||
int ioctl3 (int filedes, size_t command, long data);
|
||||
int isnumber (int c, int base);
|
||||
int mes_open (char const *file_name, int flags, int mask);
|
||||
int _open2 (char const *file_name, int flags);
|
||||
|
@ -52,6 +59,7 @@ int oputc (int c);
|
|||
int oputs (char const *s);
|
||||
char *search_path (char const *file_name);
|
||||
ssize_t _read (int fd, void *buffer, size_t size);
|
||||
void assert_msg (int check, char *msg);
|
||||
|
||||
extern char *__brk;
|
||||
extern void (*__call_at_exit) (void);
|
||||
|
@ -76,5 +84,6 @@ unsigned long __mesabi_uldiv (unsigned long a, unsigned long b,
|
|||
void *__memcpy (void *dest, void const *src, size_t n);
|
||||
void *__memmove (void *dest, void const *src, size_t n);
|
||||
void *__memset (void *s, int c, size_t n);
|
||||
int __raise (int signal);
|
||||
|
||||
#endif //__MES_LIB_H
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MES_MACROS_H
|
||||
#define __MES_MACROS_H
|
||||
|
||||
#define TYPE(x) g_cells[x].type
|
||||
#define CAR(x) g_cells[x].car
|
||||
#define CDR(x) g_cells[x].cdr
|
||||
|
||||
#define NTYPE(x) g_news[x].type
|
||||
#define NCAR(x) g_news[x].car
|
||||
#define NCDR(x) g_news[x].cdr
|
||||
|
||||
#define BYTES(x) g_cells[x].car
|
||||
#define LENGTH(x) g_cells[x].car
|
||||
#define REF(x) g_cells[x].car
|
||||
#define START(x) (g_cells[x].car >> 16)
|
||||
#define LEN(x) (g_cells[x].car & 0xffff)
|
||||
#define VARIABLE(x) g_cells[x].car
|
||||
|
||||
#define CLOSURE(x) g_cells[x].cdr
|
||||
#define CONTINUATION(x) g_cells[x].cdr
|
||||
|
||||
#define CBYTES(x) (char*)&g_cells[x].cdr
|
||||
#define CSTRING_STRUCT(x) (char*)&g_cells[x.cdr].cdr
|
||||
|
||||
#define MACRO(x) g_cells[x].car
|
||||
#define NAME(x) g_cells[x].cdr
|
||||
#define PORT(x) g_cells[x].car
|
||||
#define STRING(x) g_cells[x].cdr
|
||||
#define STRUCT(x) g_cells[x].cdr
|
||||
#define VALUE(x) g_cells[x].cdr
|
||||
#define VECTOR(x) g_cells[x].cdr
|
||||
|
||||
#define NLENGTH(x) g_news[x].car
|
||||
#define NCBYTES(x) (char*)&g_news[x].cdr
|
||||
#define NVALUE(x) g_news[x].cdr
|
||||
#define NSTRING(x) g_news[x].cdr
|
||||
#define NVECTOR(x) g_news[x].cdr
|
||||
|
||||
#define CSTRING(x) CBYTES (STRING (x))
|
||||
|
||||
#define MAKE_BYTES0(x) make_bytes (x, strlen (x))
|
||||
#define NAME_SYMBOL(symbol,name) {size_t s = strlen (name); CAR (symbol) = s; CDR (symbol) = make_bytes (name, s);}
|
||||
|
||||
#define MAKE_CHAR(n) make_cell__ (TCHAR, 0, n)
|
||||
#define MAKE_CONTINUATION(n) make_cell__ (TCONTINUATION, n, g_stack)
|
||||
#define MAKE_NUMBER(n) make_cell__ (TNUMBER, 0, (long)n)
|
||||
#define MAKE_REF(n) make_cell__ (TREF, n, 0)
|
||||
#define MAKE_STRING0(x) make_string (x, strlen (x))
|
||||
#define MAKE_STRING_PORT(x) make_cell__ (TPORT, -length__ (g_ports) - 2, x)
|
||||
#define MAKE_MACRO(name, x) make_cell__ (TMACRO, x, STRING (name))
|
||||
|
||||
#define CAAR(x) CAR (CAR (x))
|
||||
#define CADR(x) CAR (CDR (x))
|
||||
#define CDAR(x) CDR (CAR (x))
|
||||
#define CDDR(x) CDR (CDR (x))
|
||||
#define CADAR(x) CAR (CDR (CAR (x)))
|
||||
#define CADDR(x) CAR (CDR (CDR (x)))
|
||||
#define CDADAR(x) CAR (CDR (CAR (CDR (x))))
|
||||
|
||||
#endif //__MES_MACROS_H
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -22,85 +22,160 @@
|
|||
#define __MES_MES_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef long SCM;
|
||||
#include "mes/cc.h"
|
||||
|
||||
struct scm
|
||||
{
|
||||
long type;
|
||||
SCM car;
|
||||
SCM cdr;
|
||||
union
|
||||
{
|
||||
struct scm *car;
|
||||
long car_value;
|
||||
char *bytes;
|
||||
long length;
|
||||
struct scm *ref;
|
||||
struct scm *variable;
|
||||
struct scm *macro;
|
||||
long port;
|
||||
};
|
||||
union
|
||||
{
|
||||
struct scm *cdr;
|
||||
long cdr_value;
|
||||
struct scm *closure;
|
||||
struct scm *continuation;
|
||||
char *name;
|
||||
struct scm *string;
|
||||
struct scm *structure;
|
||||
long value;
|
||||
FUNCTION function;
|
||||
struct scm *vector;
|
||||
};
|
||||
};
|
||||
|
||||
// mes
|
||||
/* mes */
|
||||
extern char *g_datadir;
|
||||
extern int g_debug;
|
||||
extern char *g_buf;
|
||||
extern SCM g_continuations;
|
||||
extern SCM g_symbols;
|
||||
extern SCM g_symbol_max;
|
||||
extern int g_continuations;
|
||||
extern struct scm *g_symbols;
|
||||
extern struct scm *g_symbol_max;
|
||||
extern int g_mini;
|
||||
|
||||
// a/env
|
||||
extern SCM r0;
|
||||
// param 1
|
||||
extern SCM r1;
|
||||
// save 2
|
||||
extern SCM r2;
|
||||
// continuation
|
||||
extern SCM r3;
|
||||
// current-module
|
||||
extern SCM m0;
|
||||
// macro
|
||||
extern SCM g_macros;
|
||||
extern SCM g_ports;
|
||||
/* a/env */
|
||||
extern struct scm *R0;
|
||||
/* param 1 */
|
||||
extern struct scm *R1;
|
||||
/* save 2 */
|
||||
extern struct scm *R2;
|
||||
/* continuation */
|
||||
extern struct scm *R3;
|
||||
/* current-module */
|
||||
extern struct scm *M0;
|
||||
/* macro */
|
||||
extern struct scm *g_macros;
|
||||
extern struct scm *g_ports;
|
||||
|
||||
// gc
|
||||
extern long ARENA_SIZE;
|
||||
extern long MAX_ARENA_SIZE;
|
||||
extern long STACK_SIZE;
|
||||
extern long JAM_SIZE;
|
||||
extern long GC_SAFETY;
|
||||
extern long MAX_STRING;
|
||||
/* gc */
|
||||
extern size_t ARENA_SIZE;
|
||||
extern size_t MAX_ARENA_SIZE;
|
||||
extern size_t STACK_SIZE;
|
||||
extern size_t JAM_SIZE;
|
||||
extern size_t GC_SAFETY;
|
||||
extern size_t MAX_STRING;
|
||||
extern char *g_arena;
|
||||
extern long g_free;
|
||||
extern SCM g_stack;
|
||||
extern SCM *g_stack_array;
|
||||
extern struct scm *cell_arena;
|
||||
extern struct scm *cell_zero;
|
||||
|
||||
extern struct scm *g_free;
|
||||
extern struct scm *g_symbol;
|
||||
|
||||
extern struct scm **g_stack_array;
|
||||
extern struct scm *g_cells;
|
||||
extern struct scm *g_news;
|
||||
extern long g_stack;
|
||||
extern size_t gc_count;
|
||||
extern struct timespec *gc_start_time;
|
||||
extern struct timespec *gc_end_time;
|
||||
extern size_t gc_time;
|
||||
|
||||
SCM alloc (long n);
|
||||
SCM apply (SCM f, SCM x, SCM a);
|
||||
SCM apply_builtin (SCM fn, SCM x);
|
||||
SCM cstring_to_list (char const *s);
|
||||
SCM cstring_to_symbol (char const *s);
|
||||
SCM display_ (SCM x);
|
||||
SCM fdisplay_ (SCM, int, int);
|
||||
SCM gc_init ();
|
||||
SCM gc_peek_frame ();
|
||||
SCM gc_pop_frame ();
|
||||
SCM gc_push_frame ();
|
||||
SCM init_time (SCM a);
|
||||
SCM make_bytes (char const *s, size_t length);
|
||||
SCM make_cell__ (long type, SCM car, SCM cdr);
|
||||
SCM make_hash_table_ (long size);
|
||||
SCM make_hashq_type ();
|
||||
SCM make_initial_module (SCM a);
|
||||
SCM make_string (char const *s, size_t length);
|
||||
SCM make_vector__ (long k);
|
||||
SCM read_input_file_env (SCM);
|
||||
SCM string_equal_p (SCM a, SCM b);
|
||||
SCM struct_ref_ (SCM x, long i);
|
||||
SCM struct_set_x_ (SCM x, long i, SCM e);
|
||||
SCM vector_ref_ (SCM x, long i);
|
||||
SCM vector_set_x_ (SCM x, long i, SCM e);
|
||||
extern char **__execl_c_argv;
|
||||
extern char *__open_boot_buf;
|
||||
extern char *__open_boot_file_name;
|
||||
extern char *__setenv_buf;
|
||||
extern char *__reader_read_char_buf;
|
||||
extern struct timespec *g_start_time;
|
||||
extern struct timeval *__gettimeofday_time;
|
||||
extern struct timespec *__get_internal_run_time_ts;
|
||||
|
||||
struct scm *cast_charp_to_scmp (char const *i);
|
||||
struct scm **cast_charp_to_scmpp (char const *i);
|
||||
char *cast_voidp_to_charp (void const *i);
|
||||
long cast_scmp_to_long (struct scm *i);
|
||||
char *cast_scmp_to_charp (struct scm *i);
|
||||
|
||||
struct scm *alloc (long n);
|
||||
struct scm *apply (struct scm *f, struct scm *x, struct scm *a);
|
||||
struct scm *apply_builtin (struct scm *fn, struct scm *x);
|
||||
struct scm *apply_builtin0 (struct scm *fn);
|
||||
struct scm *apply_builtin1 (struct scm *fn, struct scm *x);
|
||||
struct scm *apply_builtin2 (struct scm *fn, struct scm *x, struct scm *y);
|
||||
struct scm *apply_builtin3 (struct scm *fn, struct scm *x, struct scm *y, struct scm *z);
|
||||
struct scm *builtin_name (struct scm *builtin);
|
||||
struct scm *cstring_to_list (char const *s);
|
||||
struct scm *cstring_to_symbol (char const *s);
|
||||
struct scm *cell_ref (struct scm *cell, long index);
|
||||
struct scm *fdisplay_ (struct scm *, int, int);
|
||||
struct scm *init_symbols ();
|
||||
struct scm *init_time (struct scm *a);
|
||||
struct scm *make_builtin_type ();
|
||||
struct scm *make_bytes (char const *s, size_t length);
|
||||
struct scm *make_cell (long type, struct scm *car, struct scm *cdr);
|
||||
struct scm *make_pointer_cell (long type, long car, void *cdr);
|
||||
struct scm *make_value_cell (long type, long car, long cdr);
|
||||
struct scm *make_char (int n);
|
||||
struct scm *make_continuation (long n);
|
||||
struct scm *make_hash_table_ (long size);
|
||||
struct scm *make_hashq_type ();
|
||||
struct scm *make_initial_module (struct scm *a);
|
||||
struct scm *make_macro (struct scm *name, struct scm *x);
|
||||
struct scm *make_number (long n);
|
||||
struct scm *make_ref (struct scm *x);
|
||||
struct scm *make_string (char const *s, size_t length);
|
||||
struct scm *make_string0 (char const *s);
|
||||
struct scm *make_string_port (struct scm *x);
|
||||
struct scm *make_vector_ (long k, struct scm *e);
|
||||
struct scm *mes_builtins (struct scm *a);
|
||||
struct scm *push_cc (struct scm *p1, struct scm *p2, struct scm *a, struct scm *c);
|
||||
struct scm *struct_ref_ (struct scm *x, long i);
|
||||
struct scm *struct_set_x_ (struct scm *x, long i, struct scm *e);
|
||||
struct scm *vector_ref_ (struct scm *x, long i);
|
||||
struct scm *vector_set_x_ (struct scm *x, long i, struct scm *e);
|
||||
FUNCTION builtin_function (struct scm *builtin);
|
||||
char *cell_bytes (struct scm *x);
|
||||
char *news_bytes (struct scm *x);
|
||||
int peekchar ();
|
||||
int readchar ();
|
||||
int unreadchar ();
|
||||
long length__ (SCM x);
|
||||
long gc_free ();
|
||||
long length__ (struct scm *x);
|
||||
size_t bytes_cells (size_t length);
|
||||
void assert_max_string (size_t i, char const *msg, char *string);
|
||||
void assert_max_string (size_t i, char const *msg, char const *string);
|
||||
void assert_msg (int check, char *msg);
|
||||
void assert_number (char const *name, struct scm *x);
|
||||
void copy_cell (struct scm *to, struct scm *from);
|
||||
void gc_ ();
|
||||
void gc_dump_arena (struct scm *cells, long size);
|
||||
void gc_init ();
|
||||
void gc_peek_frame ();
|
||||
void gc_pop_frame ();
|
||||
void gc_push_frame ();
|
||||
void gc_stats_ (char const* where);
|
||||
void init_symbols_ ();
|
||||
long seconds_and_nanoseconds_to_long (long s, long ns);
|
||||
|
||||
#include "mes/builtins.h"
|
||||
#include "mes/constants.h"
|
||||
#include "mes/macros.h"
|
||||
#include "mes/symbols.h"
|
||||
|
||||
#endif //__MES_MES_H
|
||||
#endif /* __MES_MES_H */
|
||||
|
|
|
@ -0,0 +1,150 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MES_SYMBOLS_H
|
||||
#define __MES_SYMBOLS_H
|
||||
|
||||
extern struct scm *cell_nil;
|
||||
extern struct scm *cell_f;
|
||||
extern struct scm *cell_t;
|
||||
extern struct scm *cell_dot;
|
||||
extern struct scm *cell_arrow;
|
||||
extern struct scm *cell_undefined;
|
||||
extern struct scm *cell_unspecified;
|
||||
extern struct scm *cell_closure;
|
||||
extern struct scm *cell_circular;
|
||||
|
||||
extern struct scm *cell_vm_apply;
|
||||
extern struct scm *cell_vm_apply2;
|
||||
extern struct scm *cell_vm_begin;
|
||||
extern struct scm *cell_vm_begin_eval;
|
||||
extern struct scm *cell_vm_begin_expand;
|
||||
extern struct scm *cell_vm_begin_expand_eval;
|
||||
extern struct scm *cell_vm_begin_expand_macro;
|
||||
extern struct scm *cell_vm_begin_expand_primitive_load;
|
||||
extern struct scm *cell_vm_begin_primitive_load;
|
||||
extern struct scm *cell_vm_begin_read_input_file;
|
||||
extern struct scm *cell_vm_call_with_current_continuation2;
|
||||
extern struct scm *cell_vm_call_with_values2;
|
||||
extern struct scm *cell_vm_eval;
|
||||
extern struct scm *cell_vm_eval2;
|
||||
extern struct scm *cell_vm_eval_check_func;
|
||||
extern struct scm *cell_vm_eval_define;
|
||||
extern struct scm *cell_vm_eval_macro_expand_eval;
|
||||
extern struct scm *cell_vm_eval_macro_expand_expand;
|
||||
extern struct scm *cell_vm_eval_pmatch_car;
|
||||
extern struct scm *cell_vm_eval_pmatch_cdr;
|
||||
extern struct scm *cell_vm_eval_set_x;
|
||||
extern struct scm *cell_vm_evlis;
|
||||
extern struct scm *cell_vm_evlis2;
|
||||
extern struct scm *cell_vm_evlis3;
|
||||
extern struct scm *cell_vm_if;
|
||||
extern struct scm *cell_vm_if_expr;
|
||||
extern struct scm *cell_vm_macro_expand;
|
||||
extern struct scm *cell_vm_macro_expand_car;
|
||||
extern struct scm *cell_vm_macro_expand_cdr;
|
||||
extern struct scm *cell_vm_macro_expand_define;
|
||||
extern struct scm *cell_vm_macro_expand_define_macro;
|
||||
extern struct scm *cell_vm_macro_expand_lambda;
|
||||
extern struct scm *cell_vm_macro_expand_set_x;
|
||||
extern struct scm *cell_vm_return;
|
||||
|
||||
extern struct scm *cell_symbol_lambda;
|
||||
extern struct scm *cell_symbol_begin;
|
||||
extern struct scm *cell_symbol_if;
|
||||
extern struct scm *cell_symbol_quote;
|
||||
extern struct scm *cell_symbol_define;
|
||||
extern struct scm *cell_symbol_define_macro;
|
||||
extern struct scm *cell_symbol_quasiquote;
|
||||
extern struct scm *cell_symbol_unquote;
|
||||
extern struct scm *cell_symbol_unquote_splicing;
|
||||
extern struct scm *cell_symbol_syntax;
|
||||
extern struct scm *cell_symbol_quasisyntax;
|
||||
extern struct scm *cell_symbol_unsyntax;
|
||||
extern struct scm *cell_symbol_unsyntax_splicing;
|
||||
extern struct scm *cell_symbol_set_x;
|
||||
extern struct scm *cell_symbol_sc_expand;
|
||||
extern struct scm *cell_symbol_macro_expand;
|
||||
extern struct scm *cell_symbol_portable_macro_expand;
|
||||
extern struct scm *cell_symbol_sc_expander_alist;
|
||||
extern struct scm *cell_symbol_call_with_values;
|
||||
extern struct scm *cell_symbol_call_with_current_continuation;
|
||||
extern struct scm *cell_symbol_boot_module;
|
||||
extern struct scm *cell_symbol_current_module;
|
||||
extern struct scm *cell_symbol_primitive_load;
|
||||
extern struct scm *cell_symbol_car;
|
||||
extern struct scm *cell_symbol_cdr;
|
||||
extern struct scm *cell_symbol_not_a_number;
|
||||
extern struct scm *cell_symbol_not_a_pair;
|
||||
extern struct scm *cell_symbol_system_error;
|
||||
extern struct scm *cell_symbol_throw;
|
||||
extern struct scm *cell_symbol_unbound_variable;
|
||||
extern struct scm *cell_symbol_wrong_number_of_args;
|
||||
extern struct scm *cell_symbol_wrong_type_arg;
|
||||
extern struct scm *cell_symbol_buckets;
|
||||
extern struct scm *cell_symbol_builtin;
|
||||
extern struct scm *cell_symbol_frame;
|
||||
extern struct scm *cell_symbol_hashq_table;
|
||||
extern struct scm *cell_symbol_module;
|
||||
extern struct scm *cell_symbol_procedure;
|
||||
extern struct scm *cell_symbol_record_type;
|
||||
extern struct scm *cell_symbol_size;
|
||||
extern struct scm *cell_symbol_stack;
|
||||
extern struct scm *cell_symbol_argv;
|
||||
extern struct scm *cell_symbol_mes_datadir;
|
||||
extern struct scm *cell_symbol_mes_version;
|
||||
extern struct scm *cell_symbol_internal_time_units_per_second;
|
||||
extern struct scm *cell_symbol_compiler;
|
||||
extern struct scm *cell_symbol_arch;
|
||||
extern struct scm *cell_symbol_pmatch_car;
|
||||
extern struct scm *cell_symbol_pmatch_cdr;
|
||||
extern struct scm *cell_type_bytes;
|
||||
extern struct scm *cell_type_char;
|
||||
extern struct scm *cell_type_closure;
|
||||
extern struct scm *cell_type_continuation;
|
||||
extern struct scm *cell_type_function;
|
||||
extern struct scm *cell_type_keyword;
|
||||
extern struct scm *cell_type_macro;
|
||||
extern struct scm *cell_type_number;
|
||||
extern struct scm *cell_type_pair;
|
||||
extern struct scm *cell_type_port;
|
||||
extern struct scm *cell_type_ref;
|
||||
extern struct scm *cell_type_special;
|
||||
extern struct scm *cell_type_string;
|
||||
extern struct scm *cell_type_struct;
|
||||
extern struct scm *cell_type_symbol;
|
||||
extern struct scm *cell_type_values;
|
||||
extern struct scm *cell_type_variable;
|
||||
extern struct scm *cell_type_vector;
|
||||
extern struct scm *cell_type_broken_heart;
|
||||
extern struct scm *cell_symbol_program;
|
||||
extern struct scm *cell_symbol_test;
|
||||
|
||||
// CONSTANT SYMBOL_MAX 114
|
||||
#define SYMBOL_MAX 114
|
||||
|
||||
// CONSTANT CELL_UNSPECIFIED 7
|
||||
#define CELL_UNSPECIFIED 7
|
||||
|
||||
// CONSTANT CELL_SYMBOL_RECORD_TYPE 82
|
||||
#define CELL_SYMBOL_RECORD_TYPE 82
|
||||
|
||||
|
||||
#endif /* __MES_SYMBOLS_H */
|
|
@ -0,0 +1,142 @@
|
|||
#! /bin/sh
|
||||
# Copyright © 2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage:
|
||||
# kaem --verbose --strict
|
||||
|
||||
mkdir -p m2
|
||||
|
||||
M2-Planet \
|
||||
--bootstrap-mode \
|
||||
--debug \
|
||||
--architecture ${stage0_cpu} \
|
||||
-f include/m2/lib.h \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/crt1.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/_exit.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/_write.c \
|
||||
-f lib/mes/globals.c \
|
||||
-f lib/m2/cast.c \
|
||||
-f lib/m2/exit.c \
|
||||
-f lib/mes/mini-write.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/syscall.c \
|
||||
-f include/linux/${mes_cpu}/syscall.h \
|
||||
-f lib/stub/__raise.c \
|
||||
-f lib/linux/brk.c \
|
||||
-f lib/m2/malloc.c \
|
||||
-f lib/string/memset.c \
|
||||
-f lib/m2/read.c \
|
||||
-f lib/mes/fdgetc.c \
|
||||
-f lib/stdio/getchar.c \
|
||||
-f lib/stdio/putchar.c \
|
||||
-f lib/m2/open.c \
|
||||
-f lib/m2/mes_open.c \
|
||||
-f lib/string/strlen.c \
|
||||
-f lib/mes/eputs.c \
|
||||
-f lib/mes/fdputc.c \
|
||||
-f lib/mes/eputc.c \
|
||||
\
|
||||
-f include/mes/mes.h \
|
||||
-f include/mes/builtins.h \
|
||||
-f include/mes/constants.h \
|
||||
-f include/mes/symbols.h \
|
||||
\
|
||||
-f lib/mes/__assert_fail.c \
|
||||
-f lib/mes/assert_msg.c \
|
||||
\
|
||||
-f lib/mes/fdputc.c \
|
||||
-f lib/string/strncmp.c \
|
||||
-f lib/posix/getenv.c \
|
||||
-f lib/mes/fdputs.c \
|
||||
-f lib/mes/ntoab.c \
|
||||
-f lib/ctype/isdigit.c \
|
||||
-f lib/ctype/isxdigit.c \
|
||||
-f lib/ctype/isspace.c \
|
||||
-f lib/ctype/isnumber.c \
|
||||
-f lib/mes/abtol.c \
|
||||
-f lib/stdlib/atoi.c \
|
||||
-f lib/string/memcpy.c \
|
||||
-f lib/stdlib/free.c \
|
||||
-f lib/stdlib/realloc.c \
|
||||
-f lib/string/strcpy.c \
|
||||
-f lib/mes/itoa.c \
|
||||
-f lib/mes/ltoa.c \
|
||||
-f lib/mes/fdungetc.c \
|
||||
-f lib/posix/setenv.c \
|
||||
-f lib/linux/access.c \
|
||||
-f lib/m2/chmod.c \
|
||||
-f lib/linux/ioctl3.c \
|
||||
-f lib/m2/isatty.c \
|
||||
-f lib/linux/fork.c \
|
||||
-f lib/m2/execve.c \
|
||||
-f lib/m2/execv.c \
|
||||
-f lib/linux/waitpid.c \
|
||||
-f lib/linux/gettimeofday.c \
|
||||
-f lib/m2/clock_gettime.c \
|
||||
-f lib/m2/time.c \
|
||||
-f lib/linux/_getcwd.c \
|
||||
-f lib/m2/getcwd.c \
|
||||
-f lib/linux/dup.c \
|
||||
-f lib/linux/dup2.c \
|
||||
-f lib/string/strcmp.c \
|
||||
-f lib/string/memcmp.c \
|
||||
-f lib/linux/unlink.c \
|
||||
-f src/builtins.c \
|
||||
-f src/core.c \
|
||||
-f src/display.c \
|
||||
-f src/eval-apply.c \
|
||||
-f src/gc.c \
|
||||
-f src/hash.c \
|
||||
-f src/lib.c \
|
||||
-f src/m2.c \
|
||||
-f src/math.c \
|
||||
-f src/mes.c \
|
||||
-f src/module.c \
|
||||
-f src/posix.c \
|
||||
-f src/reader.c \
|
||||
-f src/stack.c \
|
||||
-f src/string.c \
|
||||
-f src/struct.c \
|
||||
-f src/symbol.c \
|
||||
-f src/vector.c \
|
||||
-o m2/mes.M1
|
||||
|
||||
blood-elf -f m2/mes.M1 -o m2/mes.blood-elf-M1
|
||||
|
||||
M1 \
|
||||
--LittleEndian \
|
||||
--architecture ${stage0_cpu} \
|
||||
-f lib/m2/${mes_cpu}/${mes_cpu}_defs.M1 \
|
||||
-f lib/${mes_cpu}-mes/${mes_cpu}.M1 \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/crt1.M1 \
|
||||
-f m2/mes.M1 \
|
||||
-f m2/mes.blood-elf-M1 \
|
||||
-o m2/mes.hex2
|
||||
|
||||
mkdir -p bin
|
||||
hex2 \
|
||||
--LittleEndian \
|
||||
--architecture ${stage0_cpu} \
|
||||
--BaseAddress 0x1000000 \
|
||||
--exec_enable \
|
||||
-f lib/m2/${mes_cpu}/ELF-${mes_cpu}.hex2 \
|
||||
-f m2/mes.hex2 \
|
||||
-o bin/mes-m2
|
||||
|
||||
echo Running mes-m2
|
||||
./bin/mes-m2 -c "(display 'Hello,M2-mes!) (newline)"
|
||||
cp bin/mes-m2 bin/mes
|
|
@ -143,7 +143,6 @@ DEFINE pop____%lr 04e09de4
|
|||
# L1y:
|
||||
|
||||
DEFINE push___$i32 04909fe504902de5000000ea
|
||||
|
||||
DEFINE push___%r0 04002de5 # str r0, [sp, #-4]!
|
||||
DEFINE push___%r1 04102de5 # str r1, [sp, #-4]!
|
||||
DEFINE push___%r2 04202de5 # str r2, [sp, #-4]!
|
||||
|
|
|
@ -18,14 +18,15 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib-mini.h>
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
|
||||
char *
|
||||
_getcwd (char *buffer, size_t size)
|
||||
{
|
||||
int r = _sys_call2 (SYS_getcwd, (long) buffer, (long) size);
|
||||
long long_buffer = cast_charp_to_long (buffer);
|
||||
int r = _sys_call2 (SYS_getcwd, long_buffer, size);
|
||||
if (r >= 0)
|
||||
return buffer;
|
||||
return 0;
|
||||
|
|
|
@ -27,7 +27,6 @@ int
|
|||
_open3 (char const *file_name, int flags, int mask)
|
||||
{
|
||||
int r = _sys_call3 (SYS_open, (long) file_name, (int) flags, (int) mask);
|
||||
__ungetc_init ();
|
||||
if (r > 2)
|
||||
{
|
||||
__ungetc_clear (r);
|
||||
|
|
|
@ -18,11 +18,14 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
|
||||
int
|
||||
access (char const *file_name, int how)
|
||||
{
|
||||
return _sys_call2 (SYS_access, (long) file_name, (int) how);
|
||||
long long_file_name = cast_charp_to_long (file_name);
|
||||
long long_how = cast_int_to_long (how);
|
||||
return _sys_call2 (SYS_access, long_file_name, long_how);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void
|
||||
_exit ()
|
||||
{
|
||||
asm ("SYS_exit mov____$i8,%r7");
|
||||
asm ("!4 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void
|
||||
_write ()
|
||||
{
|
||||
asm ("SYS_write mov____$i8,%r7");
|
||||
asm ("!4 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r1,(%fp,-#$i8)");
|
||||
asm ("!12 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
### GNU Mes --- Maxwell Equations of Software
|
||||
### Copyright (C) 2016 Jeremiah Orians
|
||||
### Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
### Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
###
|
||||
### 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
:XXX_start
|
||||
'0' SP BP NO_SHIFT MOVE_ALWAYS ; Setup Base Pointer
|
||||
push___%lr
|
||||
push___%ebp
|
||||
mov____%esp,%ebp
|
||||
allocate_stack_4180
|
||||
!0 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stdin
|
||||
!1 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stdout
|
||||
!2 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stderr
|
||||
!8 ldr____%r0,(%fp,+#$i8)
|
||||
mov____%fp,%r1
|
||||
!12 add____%r1,$i8
|
||||
add____%r2,%r1,%r0,lsl#2
|
||||
!4 add____%r2,$i8
|
||||
; M2-Planet calling convention pushes forward
|
||||
push___%r0 ; argc
|
||||
push___%r1 ; argv
|
||||
push___%r2 ; environ
|
||||
mov____%r2,0x32 &GLOBAL_environ
|
||||
^~FUNCTION_main bl
|
||||
!0x0 add____$i8,%esp
|
||||
!0x0 cmp____$i8,%r0
|
||||
SYS_exit mov____$i8,%r7
|
||||
swi____$0
|
||||
:__start_loop
|
||||
wfi
|
||||
!0x1 mov____$i8,%r0
|
||||
!0x0 cmp____$i8,%r0
|
||||
^~__start_loop b
|
||||
mov____%ebp,%esp
|
||||
pop____%ebp
|
||||
ret
|
||||
|
||||
:_start
|
||||
'0' SP BP NO_SHIFT MOVE_ALWAYS ; Setup Base Pointer
|
||||
|
||||
;; Prepare argv
|
||||
!4 R0 ADD BP ARITH_ALWAYS ; ARGV_address = BP + 4
|
||||
{R0} PUSH_ALWAYS ; Put argv on the stack
|
||||
|
||||
;; Prepare envp
|
||||
'0' BP R0 NO_SHIFT MOVE_ALWAYS ; Address we need to load from
|
||||
!0 R0 LOAD32 R0 MEMORY ; Get ARGC
|
||||
!2 R0 ADD R0 ARITH_ALWAYS ; OFFSET = ARGC + 2
|
||||
'0' R0 R0 '1' MOVE_ALWAYS ; OFFSET = OFFSET * WORDSIZE
|
||||
'0' R0 R0 ADD BP ARITH2_ALWAYS ; ENVP_address = BP + OFFSET
|
||||
{R0} PUSH_ALWAYS ; Put envp on the stack
|
||||
|
||||
mov____%r0,0x32 &GLOBAL_environ
|
||||
|
||||
;; Stack offset
|
||||
!4 BP ADD BP ARITH_ALWAYS ; Fix BP
|
||||
|
||||
;;^~FUNCTION___init_io CALL_ALWAYS ; Setup for FILE*
|
||||
|
||||
!0 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stdin
|
||||
!1 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stdout
|
||||
!2 mov____$i8,%r0
|
||||
mov____%r0,0x32 &GLOBAL___stderr
|
||||
|
||||
^~FUNCTION_main CALL_ALWAYS ; Jump right into main
|
||||
|
||||
SYS_exit mov____$i8,%r7
|
||||
swi____$0
|
||||
|
||||
|
||||
# Unsigned Divide
|
||||
:divide
|
||||
{R4} PUSH_ALWAYS ; Protect R4
|
||||
{R3} PUSH_ALWAYS ; Protect R3
|
||||
{R2} PUSH_ALWAYS ; Protect R2
|
||||
|
||||
'0' R0 R3 NO_SHIFT MOVE_ALWAYS ; MOV R3,R0
|
||||
'0' R1 R2 NO_SHIFT MOVE_ALWAYS ; MOV R2,R1
|
||||
|
||||
!0 R0 LOADI8_ALWAYS ; MOV R0,#0
|
||||
!0 CMPI8 R2 IMM_ALWAYS ; CMP R2,#0
|
||||
!1 R0 SUB R0 ARITH_LT ; SUBLT R0,R0,#1
|
||||
!0 CMPI8 R3 IMM_ALWAYS ; CMP R3,#0
|
||||
!0 R3 RSUB R3 ARITH_LT ; RSBLT R3,R3,#0
|
||||
'0' R0 R0 MVN_LT ; MVNLT R0,R0
|
||||
'0' R0 R4 NO_SHIFT MOVE_ALWAYS ; MOV R4,R0
|
||||
|
||||
!32 R0 LOADI8_ALWAYS ; MOV R0,#32.
|
||||
!0 R1 LOADI8_ALWAYS ; MOV R1,#0
|
||||
:divide_loop
|
||||
'0' R2 R2 ADDS R2 ARITH2_ALWAYS ; ADDS R2,R2,R2
|
||||
'0' R1 R1 ADCS R1 ARITH2_ALWAYS ; ADCS R1,R1,R1
|
||||
'0' R3 CMP R1 AUX_ALWAYS ; CMP R1,R3
|
||||
'0' R3 R1 SUB R1 ARITH2_GE ; SUBGE R1,R1,R3
|
||||
!1 R2 ADD R2 ARITH_GE ; ADDGE R2,R2,#1
|
||||
!1 R0 SUB R0 ARITH_ALWAYS ; SUB R0,R0,#1
|
||||
!0 CMPI8 R0 IMM_ALWAYS ; CMP R0,#0
|
||||
^~divide_loop JUMP_NE ; BNE loop
|
||||
|
||||
'0' R2 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R2
|
||||
|
||||
{R2} POP_ALWAYS ; Restore R2
|
||||
{R3} POP_ALWAYS ; Restore R3
|
||||
{R4} POP_ALWAYS ; Restore R4
|
||||
'1' LR RETURN
|
||||
|
||||
# Signed Divide
|
||||
:divides
|
||||
{R4} PUSH_ALWAYS ; Protect R4
|
||||
{R3} PUSH_ALWAYS ; Protect R3
|
||||
{R2} PUSH_ALWAYS ; Protect R2
|
||||
|
||||
'0' R0 R3 NO_SHIFT MOVE_ALWAYS ; MOV R3,R0
|
||||
'0' R1 R2 NO_SHIFT MOVE_ALWAYS ; MOV R2,R1
|
||||
|
||||
!0 R0 LOADI8_ALWAYS ; MOV R0,#0
|
||||
!0 CMPI8 R2 IMM_ALWAYS ; CMP R2,#0
|
||||
!0 R2 RSUB R2 ARITH_LT ; RSBLT R2,R2,#0
|
||||
!1 R0 SUB R0 ARITH_LT ; SUBLT R0,R0,#1
|
||||
!0 CMPI8 R3 IMM_ALWAYS ; CMP R3,#0
|
||||
!0 R3 RSUB R3 ARITH_LT ; RSBLT R3,R3,#0
|
||||
'0' R0 R0 MVN_LT ; MVNLT R0,R0
|
||||
'0' R0 R4 NO_SHIFT MOVE_ALWAYS ; MOV R4,R0
|
||||
|
||||
!32 R0 LOADI8_ALWAYS ; MOV R0,#32.
|
||||
!0 R1 LOADI8_ALWAYS ; MOV R1,#0
|
||||
:divides_loop
|
||||
'0' R2 R2 ADDS R2 ARITH2_ALWAYS ; ADDS R2,R2,R2
|
||||
'0' R1 R1 ADCS R1 ARITH2_ALWAYS ; ADCS R1,R1,R1
|
||||
'0' R3 CMP R1 AUX_ALWAYS ; CMP R1,R3
|
||||
'0' R3 R1 SUB R1 ARITH2_GE ; SUBGE R1,R1,R3
|
||||
!1 R2 ADD R2 ARITH_GE ; ADDGE R2,R2,#1
|
||||
!1 R0 SUB R0 ARITH_ALWAYS ; SUB R0,R0,#1
|
||||
!0 CMPI8 R0 IMM_ALWAYS ; CMP R0,#0
|
||||
^~divides_loop JUMP_NE ; BNE loop
|
||||
|
||||
!0 CMPI8 R4 IMM_ALWAYS ; CMP R4,#0
|
||||
!0 R2 RSUB R2 ARITH_NE ; RSBNE R2,R2,#0
|
||||
'0' R2 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R2
|
||||
|
||||
{R2} POP_ALWAYS ; Restore R2
|
||||
{R3} POP_ALWAYS ; Restore R3
|
||||
{R4} POP_ALWAYS ; Restore R4
|
||||
'1' LR RETURN
|
||||
|
||||
# Unsigned Modulus
|
||||
:modulus
|
||||
{LR} PUSH_ALWAYS ; Prepare to leverage divide
|
||||
^~divide CALL_ALWAYS ; Use divide
|
||||
'0' R1 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R1
|
||||
{LR} POP_ALWAYS ; Prepare for return
|
||||
'1' LR RETURN
|
||||
|
||||
# Signed Modulus
|
||||
:moduluss
|
||||
{LR} PUSH_ALWAYS ; Prepare to leverage divide
|
||||
^~divides CALL_ALWAYS ; Use divides
|
||||
'0' R1 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R1
|
||||
{LR} POP_ALWAYS ; Prepare for return
|
||||
'1' LR RETURN
|
|
@ -0,0 +1,34 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mes/lib-mini.h"
|
||||
|
||||
int __stdin;
|
||||
int __stdout;
|
||||
int __stderr;
|
||||
char **environ;
|
||||
int main (int argc, char **argv, char **envp);
|
||||
|
||||
/* FIXME: this is going to be called `FUNCTION__start' */
|
||||
//#int
|
||||
//#_start ()
|
||||
//#{
|
||||
//# ..
|
||||
//#}
|
|
@ -0,0 +1,165 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <linux/arm/syscall.h>
|
||||
|
||||
int errno;
|
||||
|
||||
int
|
||||
__sys_call (int sys_call)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call1 (int sys_call, int one)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call2 (int sys_call, int one, int two)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("!12 ldr____%r1,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call3 (int sys_call, int one, int two, int three)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("!12 ldr____%r1,(%fp,-#$i8)");
|
||||
asm ("!16 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call4 (int sys_call, int one, int two, int three, int four)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("!12 ldr____%r1,(%fp,-#$i8)");
|
||||
asm ("!16 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("!20 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call6 (int sys_call, int one, int two, int three, int four, int five, int six)
|
||||
{
|
||||
asm ("!4 ldr____%r7,(%fp,-#$i8)");
|
||||
asm ("!8 ldr____%r0,(%fp,-#$i8)");
|
||||
asm ("!12 ldr____%r1,(%fp,-#$i8)");
|
||||
asm ("!16 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("!20 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("!24 ldr____%r2,(%fp,-#$i8)");
|
||||
asm ("swi____$0");
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call (int sys_call)
|
||||
{
|
||||
int r = __sys_call (sys_call);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call1 (int sys_call, int one)
|
||||
{
|
||||
int r = __sys_call1 (sys_call, one);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call2 (int sys_call, int one, int two)
|
||||
{
|
||||
int r = __sys_call2 (sys_call, one, two);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call3 (int sys_call, int one, int two, int three)
|
||||
{
|
||||
int r = __sys_call3 (sys_call, one, two, three);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call4 (int sys_call, int one, int two, int three, int four)
|
||||
{
|
||||
int r = __sys_call4 (sys_call, one, two, three, four);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call6 (int sys_call, int one, int two, int three, int four, int five, int six)
|
||||
{
|
||||
int r = __sys_call6 (sys_call, one, two, three, four, five, six);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
|
@ -18,11 +18,13 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
|
||||
long
|
||||
brk (void *addr)
|
||||
{
|
||||
return _sys_call1 (SYS_brk, (long) addr);
|
||||
long long_addr = cast_voidp_to_long (addr);
|
||||
return _sys_call1 (SYS_brk, long_addr);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -25,5 +26,7 @@
|
|||
int
|
||||
chmod (char const *file_name, mode_t mask)
|
||||
{
|
||||
return _sys_call2 (SYS_chmod, (long) file_name, (long) mask);
|
||||
long long_file_name = cast_charp_to_long (file_name);
|
||||
long long_mask = cast_int_to_long (mask);
|
||||
return _sys_call2 (SYS_chmod, long_file_name, long_mask);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <time.h>
|
||||
|
@ -25,5 +26,7 @@
|
|||
int
|
||||
clock_gettime (clockid_t clk_id, struct timespec *tp)
|
||||
{
|
||||
return _sys_call2 (SYS_clock_gettime, (long) clk_id, (long) tp);
|
||||
long long_clk_id = cast_int_to_long (clk_id);
|
||||
long long_tp = cast_voidp_to_long (tp);
|
||||
return _sys_call2 (SYS_clock_gettime, long_clk_id, long_tp);
|
||||
}
|
||||
|
|
|
@ -24,5 +24,6 @@
|
|||
int
|
||||
dup (int old)
|
||||
{
|
||||
return _sys_call1 (SYS_dup, (int) old);
|
||||
long long_old = old;
|
||||
return _sys_call1 (SYS_dup, long_old);
|
||||
}
|
||||
|
|
|
@ -24,5 +24,7 @@
|
|||
int
|
||||
dup2 (int old, int new)
|
||||
{
|
||||
return _sys_call2 (SYS_dup2, (int) old, (int) new);
|
||||
long long_old = old;
|
||||
long long_new = new;
|
||||
return _sys_call2 (SYS_dup2, long_old, long_new);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -25,5 +26,7 @@
|
|||
int
|
||||
gettimeofday (struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
return _sys_call2 (SYS_gettimeofday, (long) tv, (long) tz);
|
||||
long long_tv = cast_voidp_to_long (tv);
|
||||
long long_tz = cast_voidp_to_long (tz);
|
||||
return _sys_call2 (SYS_gettimeofday, long_tv, long_tz);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -33,10 +33,3 @@ ioctl (int filedes, unsigned long command, ...)
|
|||
va_end (ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
ioctl3 (int filedes, unsigned long command, long data)
|
||||
{
|
||||
int r = _sys_call3 (SYS_ioctl, filedes, command, data);
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <mes/lib.h>
|
||||
|
||||
int
|
||||
ioctl3 (int filedes, size_t command, long data)
|
||||
{
|
||||
long long_filedes = cast_int_to_long (filedes);
|
||||
int r = _sys_call3 (SYS_ioctl, long_filedes, command, data);
|
||||
return r;
|
||||
}
|
|
@ -30,13 +30,13 @@ void *
|
|||
malloc (size_t size)
|
||||
{
|
||||
if (!__brk)
|
||||
__brk = (char *) brk (0);
|
||||
__brk = cast_long_to_charp (brk (0));
|
||||
/* align what we give back. */
|
||||
__brk = (char*) (((uintptr_t) __brk
|
||||
+ sizeof (max_align_t) - 1) & -sizeof (max_align_t));
|
||||
if (brk (__brk + size) == -1)
|
||||
return 0;
|
||||
char *p = __brk;
|
||||
__brk += size;
|
||||
__brk = __brk + size;
|
||||
return p;
|
||||
}
|
||||
|
|
|
@ -26,21 +26,23 @@
|
|||
ssize_t
|
||||
read (int filedes, void *buffer, size_t size)
|
||||
{
|
||||
ssize_t bytes = _sys_call3 (SYS_read, (int) filedes, (long) buffer, (long) size);
|
||||
long long_filedes = filedes;
|
||||
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, buffer, size);
|
||||
if (__mes_debug () > 4)
|
||||
{
|
||||
if (bytes == 1)
|
||||
{
|
||||
eputs ("read fd=");
|
||||
eputs (itoa ((int) filedes));
|
||||
eputs (itoa (filedes));
|
||||
eputs (" c=");
|
||||
eputc (*(char *) buffer);
|
||||
char *s = buffer;
|
||||
eputc (s[0]);
|
||||
eputs ("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
eputs ("read fd=");
|
||||
eputs (itoa ((int) filedes));
|
||||
eputs (itoa (filedes));
|
||||
eputs (" bytes=");
|
||||
eputs (itoa (bytes));
|
||||
eputs ("\n");
|
||||
|
|
|
@ -18,11 +18,13 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
|
||||
int
|
||||
unlink (char const *file_name)
|
||||
{
|
||||
return _sys_call1 (SYS_unlink, (long) file_name);
|
||||
long long_file_name = cast_charp_to_long (file_name);
|
||||
return _sys_call1 (SYS_unlink, long_file_name);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -18,18 +18,22 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
pid_t
|
||||
waitpid (pid_t pid, int *status_ptr, int options)
|
||||
int
|
||||
waitpid (int pid, int *status_ptr, int options)
|
||||
{
|
||||
#if __i386__
|
||||
return _sys_call3 (SYS_waitpid, (long) pid, (long) status_ptr, (int) options);
|
||||
#elif __x86_64__ || __arm__
|
||||
return _sys_call4 (SYS_wait4, (long) pid, (long) status_ptr, (int) options, 0);
|
||||
#else
|
||||
#error arch not supported
|
||||
#endif
|
||||
long long_pid = pid;
|
||||
long long_status_ptr = cast_voidp_to_long (status_ptr);
|
||||
long long_options = options;
|
||||
//##if __i386__
|
||||
//# return _sys_call3 (SYS_waitpid, long_pid, long_status_ptr, long_options);
|
||||
//##elif __x86_64__ || __arm__
|
||||
return _sys_call4 (SYS_wait4, long_pid, long_status_ptr, long_options, 0);
|
||||
//##else
|
||||
//##error arch not supported
|
||||
//##endif
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void
|
||||
_exit ()
|
||||
{
|
||||
asm ("mov____$i32,%eax SYS_exit");
|
||||
asm ("mov____0x8(%ebp),%ebx !-4");
|
||||
asm ("int____$0x80");
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void
|
||||
_write (int filedes, void *buffer, int size)
|
||||
{
|
||||
asm ("mov____$i32,%eax SYS_write");
|
||||
asm ("mov____0x8(%ebp),%ebx !-4");
|
||||
asm ("mov____0x8(%ebp),%ecx !-8");
|
||||
asm ("mov____0x8(%ebp),%edx !-12");
|
||||
asm ("int____$0x80");
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
### GNU Mes --- Maxwell Equations of Software
|
||||
### Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
###
|
||||
### 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
:_start
|
||||
push___%ebp
|
||||
mov____%esp,%ebp
|
||||
sub____$i32,%esp %0x1054
|
||||
mov____$i8,%eax !0
|
||||
mov____%eax,0x32 &GLOBAL___stdin
|
||||
mov____$i8,%eax !1
|
||||
mov____%eax,0x32 &GLOBAL___stdout
|
||||
mov____$i8,%eax !2
|
||||
mov____%eax,0x32 &GLOBAL___stderr
|
||||
mov____%ebp,%eax
|
||||
add____$i8,%eax !4
|
||||
mov____(%eax),%eax
|
||||
add____$i8,%eax !3
|
||||
shl____$i8,%eax !0x02
|
||||
add____%ebp,%eax
|
||||
mov____%eax,0x32 &GLOBAL_environ
|
||||
|
||||
mov____%esp,%edi ; M2-Planet calling convention pushes forward
|
||||
mov____%ebp,%eax ; argc
|
||||
add____$i8,%eax !4
|
||||
mov____(%eax),%eax
|
||||
push___%eax
|
||||
|
||||
mov____%ebp,%eax ; argv
|
||||
add____$i8,%eax !8
|
||||
push___%eax
|
||||
|
||||
mov____0x32,%eax &GLOBAL_environ
|
||||
push___%eax
|
||||
|
||||
mov____%edi,%ebp ; M2-Planet calling convention
|
||||
call32 %FUNCTION_main
|
||||
add____$i8,%esp !0x0
|
||||
test___%eax,%eax
|
||||
mov____%eax,%ebx
|
||||
mov____$i32,%eax %1
|
||||
int____$0x80
|
||||
hlt
|
||||
leave
|
||||
ret
|
|
@ -0,0 +1,34 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mes/lib-mini.h"
|
||||
|
||||
int __stdin;
|
||||
int __stdout;
|
||||
int __stderr;
|
||||
char **environ;
|
||||
int main (int argc, char **argv, char **envp);
|
||||
|
||||
/* FIXME: this is going to be called `FUNCTION__start' */
|
||||
//#int
|
||||
//#_start ()
|
||||
//#{
|
||||
//# ..
|
||||
//#}
|
|
@ -0,0 +1,139 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <linux/x86/syscall.h>
|
||||
|
||||
int errno;
|
||||
|
||||
int
|
||||
__sys_call (int sys_call)
|
||||
{
|
||||
asm ("mov____0x8(%ebp),%eax !-4");
|
||||
asm ("int____$0x80");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call1 (int sys_call, int one)
|
||||
{
|
||||
asm ("mov____0x8(%ebp),%eax !-4");
|
||||
asm ("mov____0x8(%ebp),%ebx !-8");
|
||||
asm ("int____$0x80");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call2 (int sys_call, int one, int two)
|
||||
{
|
||||
asm ("mov____0x8(%ebp),%eax !-4");
|
||||
asm ("mov____0x8(%ebp),%ebx !-8");
|
||||
asm ("mov____0x8(%ebp),%ecx !-12");
|
||||
asm ("int____$0x80");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call3 (int sys_call, int one, int two, int three)
|
||||
{
|
||||
asm ("mov____0x8(%ebp),%eax !-4");
|
||||
asm ("mov____0x8(%ebp),%ebx !-8");
|
||||
asm ("mov____0x8(%ebp),%ecx !-12");
|
||||
asm ("mov____0x8(%ebp),%edx !-16");
|
||||
asm ("int____$0x80");
|
||||
}
|
||||
|
||||
int
|
||||
__sys_call4 (int sys_call, int one, int two, int three, int four)
|
||||
{
|
||||
asm ("mov____0x8(%ebp),%eax !-4");
|
||||
asm ("mov____0x8(%ebp),%ebx !-8");
|
||||
asm ("mov____0x8(%ebp),%ecx !-12");
|
||||
asm ("mov____0x8(%ebp),%edx !-16");
|
||||
asm ("mov____0x8(%ebp),%esi !-20");
|
||||
asm ("int____$0x80");
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call (int sys_call)
|
||||
{
|
||||
int r = __sys_call (sys_call);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call1 (int sys_call, int one)
|
||||
{
|
||||
int r = __sys_call1 (sys_call, one);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call2 (int sys_call, int one, int two)
|
||||
{
|
||||
int r = __sys_call2 (sys_call, one, two);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call3 (int sys_call, int one, int two, int three)
|
||||
{
|
||||
int r = __sys_call3 (sys_call, one, two, three);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
_sys_call4 (int sys_call, int one, int two, int three, int four)
|
||||
{
|
||||
int r = __sys_call4 (sys_call, one, two, three, four);
|
||||
if (r < 0)
|
||||
{
|
||||
errno = -r;
|
||||
r = -1;
|
||||
}
|
||||
else
|
||||
errno = 0;
|
||||
return r;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
### Copyright (C) 2016 Jeremiah Orians
|
||||
### Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
### 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/>.
|
||||
|
||||
### stage0's hex2 format
|
||||
### !<label> 1 byte relative
|
||||
### $<label> 2 byte address
|
||||
### @<label> 2 byte relative
|
||||
### &<label> 4 byte address
|
||||
### %<label> 4 byte relative
|
||||
|
||||
### if you wish to use this header, you need to add :ELF_end to the end of your
|
||||
### M1 or hex2 files.
|
||||
|
||||
## ELF Header
|
||||
|
||||
:ELF_base
|
||||
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
|
||||
|
||||
01 # e_ident[EI_CLASS] Indicating 32 bit
|
||||
01 # e_ident[EI_DATA] Indicating little endianness
|
||||
01 # e_ident[EI_VERSION] Indicating original elf
|
||||
|
||||
03 # e_ident[EI_OSABI] Set at 3 because FreeBSD is strict
|
||||
00 # e_ident[EI_ABIVERSION] See above
|
||||
|
||||
00 00 00 00 00 00 00 # e_ident[EI_PAD]
|
||||
|
||||
02 00 # e_type Indicating Executable
|
||||
28 00 # e_machine Indicating 32bit ARM
|
||||
01 00 00 00 # e_version Indicating original elf
|
||||
|
||||
&_start # e_entry Address of the entry point
|
||||
%ELF_program_headers>ELF_base # e_phoff Address of program header table
|
||||
%ELF_section_headers>ELF_base # e_shoff Address of section header table
|
||||
|
||||
00 02 00 05 # e_flags
|
||||
|
||||
34 00 # e_ehsize Indicating our 52 Byte header
|
||||
|
||||
20 00 # e_phentsize size of a program header table
|
||||
01 00 # e_phnum number of entries in program table
|
||||
|
||||
28 00 # e_shentsize size of a section header table
|
||||
05 00 # e_shnum number of entries in section table
|
||||
|
||||
02 00 # e_shstrndx index of the section names
|
||||
|
||||
|
||||
:ELF_program_headers
|
||||
:ELF_program_header__text
|
||||
01 00 00 00 # ph_type: PT-LOAD = 1
|
||||
00 00 00 00 # ph_offset
|
||||
&ELF_base # ph_vaddr
|
||||
&ELF_base # ph_physaddr
|
||||
%ELF_end>ELF_base # ph_filesz
|
||||
%ELF_end>ELF_base # ph_memsz
|
||||
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
|
||||
00 00 01 00 # ph_alignment
|
||||
|
||||
:ELF_text
|
|
@ -0,0 +1,117 @@
|
|||
## Copyright (C) 2016 Jeremiah Orians
|
||||
## This file is part of stage0.
|
||||
##
|
||||
## stage0 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.
|
||||
##
|
||||
## stage0 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 stage0. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# M2-Planet standards
|
||||
DEFINE NULL 00000000
|
||||
|
||||
# Registers
|
||||
DEFINE R0 0
|
||||
DEFINE R1 1
|
||||
DEFINE R2 2
|
||||
DEFINE R3 3
|
||||
DEFINE R4 4
|
||||
DEFINE R5 5
|
||||
DEFINE R6 6
|
||||
DEFINE R7 7
|
||||
DEFINE R8 8
|
||||
DEFINE R9 9
|
||||
DEFINE R10 A
|
||||
DEFINE R11 B
|
||||
DEFINE R12 C
|
||||
DEFINE BP C
|
||||
DEFINE R13 D
|
||||
DEFINE SP D
|
||||
DEFINE R14 E
|
||||
DEFINE LR E
|
||||
DEFINE R15 F
|
||||
DEFINE PC F
|
||||
|
||||
# Register masks for push/pop16
|
||||
DEFINE {R0} 0100
|
||||
DEFINE {R1} 0200
|
||||
DEFINE {R2} 0400
|
||||
DEFINE {R3} 0800
|
||||
DEFINE {R4} 1000
|
||||
DEFINE {R11} 0008
|
||||
DEFINE {BP} 0010
|
||||
DEFINE {LR} 0040
|
||||
|
||||
# Bitshift constants
|
||||
DEFINE NO_SHIFT 0
|
||||
DEFINE LEFT 1
|
||||
DEFINE RIGHT 3
|
||||
DEFINE ARITH_RIGHT 5
|
||||
|
||||
# LOAD/STORE
|
||||
DEFINE MEMORY E5
|
||||
DEFINE STORE32 08
|
||||
DEFINE STORE8 0C
|
||||
DEFINE LOAD32 09
|
||||
DEFINE LOAD8 0D
|
||||
DEFINE LOADI8_ALWAYS 0A0E3
|
||||
DEFINE LOADI8_G 0A0C3
|
||||
DEFINE LOADI8_GE 0A0A3
|
||||
DEFINE LOADI8_EQUAL 0A003
|
||||
DEFINE LOADI8_NE 0A013
|
||||
DEFINE LOADI8_LE 0A0D3
|
||||
DEFINE LOADI8_L 0A0B3
|
||||
DEFINE LOADI8_HI 0A083
|
||||
DEFINE LOADI8_HS 0A023
|
||||
DEFINE LOADI8_LS 0A093
|
||||
DEFINE LOADI8_LO 0A033
|
||||
|
||||
# JUMP/BRANCH
|
||||
DEFINE JUMP_ALWAYS EA
|
||||
DEFINE JUMP_EQUAL 0A
|
||||
DEFINE JUMP_NE 1A
|
||||
DEFINE CALL_ALWAYS EB
|
||||
DEFINE CALL_REG_ALWAYS FF2FE1
|
||||
DEFINE RETURN FF2FE1
|
||||
|
||||
# Data movement
|
||||
DEFINE MOVE_ALWAYS A0E1
|
||||
DEFINE MVN_ALWAYS 0E0E1
|
||||
DEFINE MVN_LT 0E0B1
|
||||
DEFINE MVNI8_EQUAL 0E003
|
||||
DEFINE PUSH_ALWAYS 2DE9
|
||||
DEFINE POP_ALWAYS BDE8
|
||||
|
||||
# Arithmetic/logic
|
||||
DEFINE AUX_ALWAYS E1
|
||||
DEFINE IMM_ALWAYS E3
|
||||
DEFINE ARITH_ALWAYS E2
|
||||
DEFINE ARITH_GE A2
|
||||
DEFINE ARITH_LT B2
|
||||
DEFINE ARITH_NE 12
|
||||
DEFINE ARITH2_ALWAYS E0
|
||||
DEFINE ARITH2_GE A0
|
||||
DEFINE ADC 0A
|
||||
DEFINE ADCS 0B
|
||||
DEFINE ADD 08
|
||||
DEFINE ADDS 09
|
||||
DEFINE AND 00
|
||||
DEFINE CMP 005
|
||||
DEFINE CMPI8 005
|
||||
DEFINE MUL 0
|
||||
DEFINE MULS 1
|
||||
DEFINE OR 08
|
||||
DEFINE SHIFT A0
|
||||
DEFINE SUB 04
|
||||
DEFINE RSUB 06
|
||||
DEFINE XOR 02
|
||||
|
||||
# SYSCALL
|
||||
DEFINE SYSCALL_ALWAYS 000000EF
|
|
@ -0,0 +1,51 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
|
||||
char*
|
||||
cast_intp_to_charp (int const *i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
char*
|
||||
cast_long_to_charp (long i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_charp_to_long (char const *i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_int_to_long (int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_voidp_to_long (void const *i)
|
||||
{
|
||||
return i;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
chmod (char const *file_name, int mask)
|
||||
{
|
||||
long long_file_name = file_name;
|
||||
long long_mask = mask;
|
||||
return _sys_call2 (SYS_chmod, long_file_name, long_mask);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <time.h>
|
||||
|
||||
int
|
||||
clock_gettime (long clk_id, struct timespec *tp)
|
||||
{
|
||||
long long_tp = tp;
|
||||
return _sys_call2 (SYS_clock_gettime, clk_id, tp);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
int
|
||||
execv (char *file_name, char **argv)
|
||||
{
|
||||
return execve (file_name, argv, environ);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
|
||||
int
|
||||
execve (char const *file_name, char **argv, char **env)
|
||||
{
|
||||
long long_file_name = file_name;
|
||||
long long_argv = argv;
|
||||
long long_env = env;
|
||||
return _sys_call3 (SYS_execve, file_name, argv, env);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
|
||||
void _exit (int code);
|
||||
|
||||
void
|
||||
exit (int code)
|
||||
{
|
||||
_exit (code);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <mes/mes.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// CONSTANT PATH_MAX 1024
|
||||
|
||||
char *__getcwd_buf;
|
||||
|
||||
char *
|
||||
getcwd (char *buffer, int size)
|
||||
{
|
||||
if (buffer == 0)
|
||||
buffer = __getcwd_buf;
|
||||
if (buffer == 0)
|
||||
{
|
||||
__getcwd_buf = malloc (PATH_MAX);
|
||||
buffer = __getcwd_buf;
|
||||
}
|
||||
return _getcwd (buffer, size);
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <termio.h>
|
||||
|
||||
// CONSTANT TCGETS 0x5401
|
||||
#define TCGETS 0x5401
|
||||
|
||||
struct ktermios
|
||||
{
|
||||
unsigned c_iflag;
|
||||
unsigned c_oflag;
|
||||
unsigned c_cflag;
|
||||
unsigned c_lflag;
|
||||
char c_line;
|
||||
char c_cc[19];
|
||||
unsigned c_ispeed;
|
||||
unsigned c_ospeed;
|
||||
};
|
||||
|
||||
struct ktermios *__isatty_kernel_termios;
|
||||
|
||||
int
|
||||
isatty (int filedes)
|
||||
{
|
||||
if (__isatty_kernel_termios == 0)
|
||||
__isatty_kernel_termios = malloc (sizeof (struct ktermios));
|
||||
int r = ioctl3 (filedes, TCGETS, __isatty_kernel_termios);
|
||||
return r == 0;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <string.h>
|
||||
|
||||
char *__brk = 0;
|
||||
|
||||
void *
|
||||
malloc (size_t size)
|
||||
{
|
||||
if (!__brk)
|
||||
__brk = cast_long_to_charp (brk (0));
|
||||
if (brk (__brk + size) == -1)
|
||||
return 0;
|
||||
char *p = __brk;
|
||||
__brk = __brk + size;
|
||||
return p;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
int
|
||||
mes_open (char *file_name, int flags, int mask)
|
||||
{
|
||||
int filedes = open (file_name, flags, mask);
|
||||
if (filedes > 2)
|
||||
__ungetc_clear (filedes);
|
||||
return filedes;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int
|
||||
open (char *file_name, int flags, int mask)
|
||||
{
|
||||
int r = _sys_call3 (SYS_open, file_name, flags, mask);
|
||||
if (r > 2)
|
||||
__ungetc_clear (r);
|
||||
return r;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <mes/lib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
long
|
||||
read (int filedes, void *buffer, long size)
|
||||
{
|
||||
long bytes = _sys_call3 (SYS_read, filedes, buffer, size);
|
||||
return bytes;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <time.h>
|
||||
|
||||
long
|
||||
time (long* result)
|
||||
{
|
||||
int r;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
r = _sys_call2 (SYS_gettimeofday, tv, tz);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
if (result != 0)
|
||||
result[0] = tv->tv_sec;
|
||||
return tv->tv_sec;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
### Copyright (C) 2016 Jeremiah Orians
|
||||
### Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
### 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/>.
|
||||
|
||||
### stage0's hex2 format
|
||||
### !<label> 1 byte relative
|
||||
### $<label> 2 byte address
|
||||
### @<label> 2 byte relative
|
||||
### &<label> 4 byte address
|
||||
### %<label> 4 byte relative
|
||||
|
||||
### if you wish to use this header, you need to add :ELF_end to the end of your
|
||||
### M1 or hex2 files.
|
||||
|
||||
## ELF Header
|
||||
|
||||
:ELF_base
|
||||
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
|
||||
|
||||
01 # e_ident[EI_CLASS] Indicating 32 bit
|
||||
01 # e_ident[EI_DATA] Indicating little endianness
|
||||
01 # e_ident[EI_VERSION] Indicating original elf
|
||||
|
||||
03 # e_ident[EI_OSABI] Set at 3 because FreeBSD is strict
|
||||
00 # e_ident[EI_ABIVERSION] See above
|
||||
|
||||
00 00 00 00 00 00 00 # e_ident[EI_PAD]
|
||||
|
||||
02 00 # e_type Indicating Executable
|
||||
03 00 # e_machine Indicating 386
|
||||
01 00 00 00 # e_version Indicating original elf
|
||||
|
||||
&_start # e_entry Address of the entry point
|
||||
%ELF_program_headers>ELF_base # e_phoff Address of program header table
|
||||
%ELF_section_headers>ELF_base # e_shoff Address of section header table
|
||||
|
||||
00 00 00 00 # e_flags
|
||||
|
||||
34 00 # e_ehsize Indicating our 52 Byte header
|
||||
|
||||
20 00 # e_phentsize size of a program header table
|
||||
01 00 # e_phnum number of entries in program table
|
||||
|
||||
28 00 # e_shentsize size of a section header table
|
||||
05 00 # e_shnum number of entries in section table
|
||||
|
||||
02 00 # e_shstrndx index of the section names
|
||||
|
||||
|
||||
:ELF_program_headers
|
||||
:ELF_program_header__text
|
||||
01 00 00 00 # ph_type: PT-LOAD = 1
|
||||
00 00 00 00 # ph_offset
|
||||
&ELF_base # ph_vaddr
|
||||
&ELF_base # ph_physaddr
|
||||
%ELF_end>ELF_base # ph_filesz
|
||||
%ELF_end>ELF_base # ph_memsz
|
||||
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
|
||||
01 00 00 00 # ph_alignment
|
||||
|
||||
:ELF_text
|
|
@ -0,0 +1,103 @@
|
|||
## Copyright (C) 2017 Jeremiah Orians
|
||||
## Copyright (C) 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
## 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/>.
|
||||
|
||||
|
||||
DEFINE ADD_IMMEDIATE_to_eax 81C0
|
||||
DEFINE ADD_IMMEDIATE_to_ebp 81C5
|
||||
DEFINE ADD_eax_to_ebx 01C3
|
||||
DEFINE ADD_ebp_to_eax 01E8
|
||||
DEFINE ADD_ebx_to_eax 01D8
|
||||
DEFINE AND_eax_ebx 21D8
|
||||
DEFINE CALL_IMMEDIATE E8
|
||||
DEFINE CALL_eax FFD0
|
||||
DEFINE CMP 39C3
|
||||
DEFINE COPY_eax_to_ebx 89C3
|
||||
DEFINE COPY_eax_to_ecx 89C1
|
||||
DEFINE COPY_ebp_to_eax 89E8
|
||||
DEFINE COPY_ebx_to_eax 89D8
|
||||
DEFINE COPY_ebx_to_edx 89DA
|
||||
DEFINE COPY_ecx_to_ebp 89CD
|
||||
DEFINE COPY_edi_to_ebp 89fd
|
||||
DEFINE COPY_esp_to_ebp 89E5
|
||||
DEFINE COPY_esp_to_ecx 89E1
|
||||
DEFINE COPY_esp_to_edi 89E7
|
||||
DEFINE CDTQ 99
|
||||
DEFINE DIVIDE_eax_by_ebx_into_eax F7F3
|
||||
DEFINE DIVIDES_eax_by_ebx_into_eax F7FB
|
||||
DEFINE INT_80 CD80
|
||||
DEFINE JUMP E9
|
||||
DEFINE JUMP_EQ 0F84
|
||||
DEFINE JUMP_NE 0F85
|
||||
DEFINE JUMP_EQ8 74
|
||||
DEFINE JUMP_NE8 75
|
||||
DEFINE LOAD_BASE_ADDRESS_eax 8D85
|
||||
DEFINE LOAD_BYTE 0FBE00
|
||||
DEFINE LOAD_EFFECTIVE_ADDRESS 8D8424
|
||||
DEFINE LOAD_EFFECTIVE_ADDRESS_ebx 8D9C24
|
||||
DEFINE LOAD_EFFECTIVE_ADDRESS_ecx 8D8C24
|
||||
DEFINE LOAD_EFFECTIVE_ADDRESS_edx 8D9424
|
||||
DEFINE LOAD_ESP_IMMEDIATE_into_eax 8B8424
|
||||
DEFINE LOAD_IMMEDIATE_eax B8
|
||||
DEFINE LOAD_IMMEDIATE_ebx BB
|
||||
DEFINE LOAD_IMMEDIATE_ecx B9
|
||||
DEFINE LOAD_IMMEDIATE_edx BA
|
||||
DEFINE LOAD_INTEGER 8B00
|
||||
DEFINE LOAD_INTEGER_ebx 8B1B
|
||||
DEFINE LOAD_INTEGER_ecx 8B09
|
||||
DEFINE LOAD_INTEGER_edx 8B12
|
||||
DEFINE MODULUS_eax_from_ebx_into_ebx F7F3
|
||||
DEFINE MODULUSS_eax_from_ebx_into_ebx F7FB
|
||||
DEFINE MOVEZBL 0FB6C0
|
||||
DEFINE MOVE_ebx_to_eax 89D8
|
||||
DEFINE MOVE_ecx_to_eax 89C8
|
||||
DEFINE MOVE_edx_to_eax 89D0
|
||||
DEFINE MULTIPLY_eax_by_ebx_into_eax F7EB
|
||||
DEFINE MULTIPLYS_eax_by_ebx_into_eax F7E3
|
||||
DEFINE NULL 00000000
|
||||
DEFINE NOT_eax F7D0
|
||||
DEFINE NOP 00000000
|
||||
DEFINE OR_eax_ebx 09D8
|
||||
DEFINE POP_eax 58
|
||||
DEFINE POP_ebx 5B
|
||||
DEFINE POP_ebp 5D
|
||||
DEFINE POP_edi 5F
|
||||
DEFINE PUSH_eax 50
|
||||
DEFINE PUSH_ebx 53
|
||||
DEFINE PUSH_ebp 55
|
||||
DEFINE PUSH_edi 57
|
||||
DEFINE RETURN C3
|
||||
DEFINE SAL_eax_Immediate8 C1E0
|
||||
DEFINE SHL_eax_cl D3E0
|
||||
DEFINE SAL_eax_cl D3F0
|
||||
DEFINE SHR_eax_cl D3E8
|
||||
DEFINE SAR_eax_cl D3F8
|
||||
DEFINE SETA 0F97C0
|
||||
DEFINE SETAE 0F93C0
|
||||
DEFINE SETB 0F92C0
|
||||
DEFINE SETBE 0F96C0
|
||||
DEFINE SETE 0F94C0
|
||||
DEFINE SETLE 0F9EC0
|
||||
DEFINE SETL 0F9CC0
|
||||
DEFINE SETGE 0F9DC0
|
||||
DEFINE SETG 0F9FC0
|
||||
DEFINE SETNE 0F95C0
|
||||
DEFINE STORE_CHAR 8803
|
||||
DEFINE STORE_INTEGER 8903
|
||||
DEFINE SUBTRACT_eax_from_ebx_into_ebx 29C3
|
||||
DEFINE TEST 85C0
|
||||
DEFINE XCHG_eax_ebx 93
|
||||
DEFINE XOR_ebx_eax_into_eax 31D8
|
|
@ -28,5 +28,5 @@ __assert_fail (char *s)
|
|||
eputs ("\n");
|
||||
char *fail = s;
|
||||
fail = 0;
|
||||
*fail = 0;
|
||||
fail[0] = 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -24,27 +24,32 @@
|
|||
long
|
||||
abtol (char const **p, int base)
|
||||
{
|
||||
char const *s = *p;
|
||||
char const *s = p[0];
|
||||
int i = 0;
|
||||
int sign_p = 0;
|
||||
if (!base)
|
||||
int m = '0';
|
||||
if (base == 0)
|
||||
base = 10;
|
||||
while (isspace (*s))
|
||||
s++;
|
||||
if (*s && *s == '+')
|
||||
s++;
|
||||
if (*s && *s == '-')
|
||||
while (isspace (s[0]) != 0)
|
||||
s = s + 1;
|
||||
if (s[0] != 0 && s[0] == '+')
|
||||
s = s + 1;
|
||||
if (s[0] != 0 && s[0] == '-')
|
||||
{
|
||||
sign_p = 1;
|
||||
s++;
|
||||
s = s + 1;
|
||||
}
|
||||
while (isnumber (*s, base))
|
||||
while (isnumber (s[0], base) != 0)
|
||||
{
|
||||
i *= base;
|
||||
int m = *s > '9' ? 'a' - 10 : '0';
|
||||
i += *s - m;
|
||||
s++;
|
||||
i = i * base;
|
||||
if (s[0] > '9')
|
||||
m = 'a' - 10;
|
||||
i = i + s[0] - m;
|
||||
s = s + 1;
|
||||
}
|
||||
*p = s;
|
||||
return sign_p ? -i : i;
|
||||
p[0] = s;
|
||||
if (sign_p != 0)
|
||||
return -i;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019 Jeremiah Orians <jeremiah@pdp10.guru>
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void
|
||||
assert_msg (int bool, char *msg)
|
||||
{
|
||||
if (bool == 0)
|
||||
__assert_fail (msg);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
|
||||
#undef cast_intp_to_charp
|
||||
#undef cast_long_to_charp
|
||||
#undef cast_charp_to_long
|
||||
#undef cast_int_to_long
|
||||
#undef cast_voidp_to_long
|
||||
|
||||
char*
|
||||
cast_intp_to_charp (int const *i)
|
||||
{
|
||||
return (char*)i;
|
||||
}
|
||||
|
||||
char*
|
||||
cast_long_to_charp (long i)
|
||||
{
|
||||
return (char*)i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_charp_to_long (char const *i)
|
||||
{
|
||||
return (long)i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_int_to_long (int i)
|
||||
{
|
||||
return (long)i;
|
||||
}
|
||||
|
||||
long
|
||||
cast_voidp_to_long (void const *i)
|
||||
{
|
||||
return (long)i;
|
||||
}
|
|
@ -33,7 +33,7 @@ struct ldiv_t
|
|||
|
||||
int __raise (int);
|
||||
|
||||
#if __TINYC__
|
||||
#if __TINYC__ || SYSTEM_LIBC
|
||||
#define __raise(x) -1
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,42 +19,56 @@
|
|||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int __ungetc_buf[__FILEDES_MAX + 1] = { 0 };
|
||||
int *__ungetc_buf;
|
||||
|
||||
int
|
||||
__ungetc_p (int filedes)
|
||||
{
|
||||
if (__ungetc_buf == 0)
|
||||
__ungetc_init ();
|
||||
return __ungetc_buf[filedes] >= 0;
|
||||
}
|
||||
|
||||
void
|
||||
__ungetc_init ()
|
||||
{
|
||||
if (__ungetc_buf[__FILEDES_MAX] == 0)
|
||||
memset (__ungetc_buf, -1, (__FILEDES_MAX + 1) * sizeof (int));
|
||||
if (__ungetc_buf == 0)
|
||||
{
|
||||
int save_errno = errno;
|
||||
__ungetc_buf = malloc ((__FILEDES_MAX + 1) * sizeof (int));
|
||||
errno = save_errno;
|
||||
memset (__ungetc_buf, -1, (__FILEDES_MAX + 1) * sizeof (int));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__ungetc_clear (int filedes)
|
||||
{
|
||||
if (__ungetc_buf == 0)
|
||||
__ungetc_init ();
|
||||
__ungetc_buf[filedes] = -1;
|
||||
}
|
||||
|
||||
void
|
||||
__ungetc_set (int filedes, int c)
|
||||
{
|
||||
if (__ungetc_buf == 0)
|
||||
__ungetc_init ();
|
||||
__ungetc_buf[filedes] = c;
|
||||
}
|
||||
|
||||
int
|
||||
fdgetc (int fd)
|
||||
{
|
||||
__ungetc_init ();
|
||||
if (__ungetc_buf == 0)
|
||||
__ungetc_init ();
|
||||
|
||||
char c;
|
||||
int i = __ungetc_buf[fd];
|
||||
|
@ -65,10 +79,10 @@ fdgetc (int fd)
|
|||
int r = read (fd, &c, 1);
|
||||
if (r < 1)
|
||||
return -1;
|
||||
i = (int) c;
|
||||
i = c;
|
||||
}
|
||||
if (i < 0)
|
||||
i += 256;
|
||||
i = i + 256;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
int
|
||||
fdputc (int c, int fd)
|
||||
{
|
||||
write (fd, (char *) &c, 1);
|
||||
char *p = cast_intp_to_charp (&c);
|
||||
write (fd, p, 1);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,10 @@
|
|||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <assert.h>
|
||||
|
||||
int
|
||||
fdungetc (int c, int fd)
|
||||
{
|
||||
__ungetc_init ();
|
||||
if (c == -1)
|
||||
return c;
|
||||
else if (__ungetc_p (fd))
|
||||
|
@ -32,7 +30,7 @@ fdungetc (int c, int fd)
|
|||
eputs (" ***MES C LIB*** fdungetc ungetc buffer overflow fd=");
|
||||
eputs (itoa (fd));
|
||||
eputs ("\n");
|
||||
assert (0);
|
||||
assert_msg (0, "0");
|
||||
}
|
||||
__ungetc_set (fd, c);
|
||||
return c;
|
||||
|
|
|
@ -32,7 +32,6 @@ int __stderr = STDERR;
|
|||
int
|
||||
mes_open (char const *file_name, int flags, int mask)
|
||||
{
|
||||
__ungetc_init ();
|
||||
int filedes = open (file_name, flags, mask);
|
||||
if (filedes > 2)
|
||||
__ungetc_clear (filedes);
|
||||
|
|
|
@ -18,48 +18,63 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <mes/lib.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define STR(x) #x
|
||||
#define XSTR(s) STR(s)
|
||||
#if __M2_PLANET__ || !(__MESC__ && __arm__)
|
||||
size_t
|
||||
__mesabi_uldiv (size_t a, size_t b, size_t *remainder)
|
||||
{
|
||||
remainder[0] = a % b;
|
||||
return a / b;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *__itoa_buf;
|
||||
|
||||
char *
|
||||
ntoab (long x, unsigned base, int signed_p)
|
||||
{
|
||||
static char itoa_buf[20];
|
||||
char *p = itoa_buf + 11;
|
||||
*p-- = 0;
|
||||
assert(base > 1);
|
||||
if (__itoa_buf == 0)
|
||||
__itoa_buf = malloc (20);
|
||||
char *p = __itoa_buf + 11;
|
||||
|
||||
p[0] = 0;
|
||||
p = p - 1;
|
||||
assert_msg (base > 0, "base > 0");
|
||||
|
||||
int sign_p = 0;
|
||||
unsigned long u;
|
||||
if (signed_p && x < 0)
|
||||
size_t i;
|
||||
size_t u;
|
||||
size_t b = base;
|
||||
if (signed_p != 0 && x < 0)
|
||||
{
|
||||
sign_p = 1;
|
||||
/* Avoid LONG_MIN */
|
||||
u = (unsigned long) (-(x + 1));
|
||||
++u;
|
||||
u = (-(x + 1));
|
||||
u = u + 1;
|
||||
}
|
||||
else
|
||||
u = x;
|
||||
|
||||
do
|
||||
{
|
||||
unsigned long i;
|
||||
#if __MESC__ && __arm__
|
||||
u = __mesabi_uldiv (u, (unsigned long) base, &i);
|
||||
#else
|
||||
i = u % base;
|
||||
u = u / base;
|
||||
#endif
|
||||
*p-- = i > 9 ? 'a' + i - 10 : '0' + i;
|
||||
u = __mesabi_uldiv (u, b, &i);
|
||||
if (i > 9)
|
||||
p[0] = 'a' + i - 10;
|
||||
else
|
||||
p[0] = '0' + i;
|
||||
p = p - 1;
|
||||
}
|
||||
while (u);
|
||||
while (u != 0);
|
||||
|
||||
if (sign_p && *(p + 1) != '0')
|
||||
*p-- = '-';
|
||||
if (sign_p && p[1] != '0')
|
||||
{
|
||||
p[0] = '-';
|
||||
p = p - 1;
|
||||
}
|
||||
|
||||
return p + 1;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -23,11 +23,13 @@
|
|||
#include <sys/types.h>
|
||||
#include <mes/lib.h>
|
||||
|
||||
char *__getcwd_buf;
|
||||
|
||||
char *
|
||||
getcwd (char *buffer, size_t size)
|
||||
{
|
||||
static char buf[PATH_MAX];
|
||||
if (buffer)
|
||||
return _getcwd (buffer, size);
|
||||
return _getcwd (buf, PATH_MAX);
|
||||
if (buffer == 0)
|
||||
buffer = buf;
|
||||
return _getcwd (buffer, size);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
/*
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -22,16 +22,31 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// CONSTANT M2_PTR_SIZE 4
|
||||
#define M2_PTR_SIZE 1
|
||||
|
||||
char *
|
||||
getenv (char const *s)
|
||||
{
|
||||
/* eputs ("\ngetenv s="); eputs (s); eputs ("\n"); */
|
||||
char **p = environ;
|
||||
char *q;
|
||||
int length = strlen (s);
|
||||
while (*p)
|
||||
|
||||
while (p[0] != 0)
|
||||
{
|
||||
if (!strncmp (s, *p, length) && *(*p + length) == '=')
|
||||
return (*p + length + 1);
|
||||
p++;
|
||||
/* eputs ("getenv p[0]="); eputs (p[0]); eputs ("\n"); */
|
||||
if (strncmp (s, p[0], length) == 0)
|
||||
{
|
||||
/* eputs ("found!\n"); */
|
||||
q = p[0] + length;
|
||||
if (q[0] == '=')
|
||||
return q + 1;
|
||||
}
|
||||
/* else */
|
||||
/* eputs ("not found!\n"); */
|
||||
p = p + M2_PTR_SIZE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -22,25 +22,35 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// CONSTANT M2_PTR_SIZE 4
|
||||
#define M2_PTR_SIZE 1
|
||||
|
||||
int
|
||||
setenv (char const *s, char const *v, int overwrite_p)
|
||||
{
|
||||
char **p = environ;
|
||||
int length = strlen (s);
|
||||
while (*p)
|
||||
char* q;
|
||||
|
||||
while (p[0] != 0)
|
||||
{
|
||||
if (!strncmp (s, *p, length) && *(*p + length) == '=')
|
||||
break;
|
||||
p++;
|
||||
if (strncmp (s, p[0], length) == 0)
|
||||
{
|
||||
q = p[0] + length;
|
||||
if (q[0] == '=')
|
||||
break;
|
||||
}
|
||||
p = p + M2_PTR_SIZE;
|
||||
}
|
||||
char *entry = malloc (length + strlen (v) + 2);
|
||||
int end_p = *p == 0;
|
||||
*p = entry;
|
||||
int end_p = p[0] == 0;
|
||||
p[0] = entry;
|
||||
strcpy (entry, s);
|
||||
strcpy (entry + length, "=");
|
||||
strcpy (entry + length + 1, v);
|
||||
*(entry + length + strlen (v) + 2) = 0;
|
||||
if (end_p)
|
||||
*++p = 0;
|
||||
entry[length + strlen (v) + 2] = 0;
|
||||
if (end_p != 0)
|
||||
p[1] = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -18,11 +18,13 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mes/lib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
putchar (int c)
|
||||
{
|
||||
write (STDOUT, (char *) &c, 1);
|
||||
char *p = cast_intp_to_charp (&c);
|
||||
write (__stdout, p, 1);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -23,9 +23,10 @@
|
|||
void
|
||||
abort (void)
|
||||
{
|
||||
if (raise (SIGABRT) < 0) { /* could not raise SIGABRT */
|
||||
/* Fail in any way possible */
|
||||
unsigned char* x = (unsigned char*) 0;
|
||||
*x = 2;
|
||||
}
|
||||
if (raise (SIGABRT) < 0) /* could not raise SIGABRT */
|
||||
{
|
||||
/* Fail in any way possible */
|
||||
unsigned char* x = (unsigned char*) 0;
|
||||
*x = 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ void *
|
|||
realloc (void *ptr, size_t size)
|
||||
{
|
||||
void *new = malloc (size);
|
||||
if (ptr && new)
|
||||
if (ptr != 0 && new != 0)
|
||||
{
|
||||
memcpy (new, ptr, size);
|
||||
free (ptr);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -24,11 +24,14 @@ void *
|
|||
memchr (void const *block, int c, size_t size)
|
||||
{
|
||||
char const *p = block;
|
||||
while (size--)
|
||||
|
||||
while (size != 0)
|
||||
{
|
||||
if (c == *p)
|
||||
return (void *) p;
|
||||
p++;
|
||||
size = size - 1;
|
||||
if (c == p[0])
|
||||
return (void*) p;
|
||||
p = p + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue