mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-19 08:05:12 +00:00
Compare commits
1 Commits
pi-init
...
testing123
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
439d92adbd |
13
README.md
13
README.md
@@ -4,7 +4,7 @@ Maiko is the implementation of the Medley Interlisp virtual machine, for a
|
||||
byte-coded Lisp instruction set and some low-level functions for
|
||||
connecting with Lisp for access to display (via X11) and disk etc.
|
||||
|
||||
For an overview, see [Medley Interlisp Introduction](https://github.com/Interlisp/medley/wiki/Medley-Interlisp-Introduction).
|
||||
Newcomers should check out the [Medley Interlisp Introduction](https://github.com/Interlisp/medley/wiki/Medley-Interlisp-Introduction).
|
||||
|
||||
See [the Medley repository](https://github.org/Interlisp/medley) for
|
||||
* [Issues](https://github.com/Interlisp/medley/issues) (note that maiko issues are there too)
|
||||
@@ -33,17 +33,18 @@ $ cd maiko/bin
|
||||
$ ./makeright x
|
||||
```
|
||||
|
||||
* The build will (attempt to) detect the OS-type and cpu-type. It will build binaries `lde` and `ldex` in `../ostype.cputype` (with .o files in `..ostype.cputype-x`. For example, Linux on a 64-bit x86 will use `linux.x86_64`, while MacOS 11 on a (new M1) Mac will use `darwin.aarch64`.
|
||||
* If you prefer using `gcc` over `clang`, you will need to edit the makefile fragment for your configuration (`makefile-ostype.cputype-x`) and comment out the line (with a #) that defines `CC` for `clang` and uncomment the line (delete the #) for the line that defines `CC` for `gcc`.
|
||||
* There is a cmake configuration (TBD To Be Described here).
|
||||
* The build will (attempt to) detect the OS-type and cpu-type. It will build binaries `lde` and `ldex` in `../ostype.cputype` (with .o files in `..ostype.cputype-x`. For example, Linux on a 64-bit x86 will use `linux.x86_64`, while MacOS 11 on (new) Mac will use `darwin.arm64`.
|
||||
* If you prefer using `gcc` over `clang`, you will need to edit the makefile fragment for your configuration (`makefile-ostype.cputype-x1) and comment out the line (with a #) that defines `CC` for `clang` and uncomment the line (delete the #) for the line that defines `CC` for `gcc`.
|
||||
* There is a cmake configuration (TBD)
|
||||
|
||||
### Building For MacOS
|
||||
|
||||
* Running on MacOS requires an X server, and building on a Mac requires X client libraries.
|
||||
An X-server for MacOS (and X11 client libraries) can be freely obtained at https://www.xquartz.org/releases
|
||||
An X-server for x86 MacOS (and X11 client libraries) can be freely obtained at https://www.xquartz.org/
|
||||
For the new arm64 MacOS 11, you'll need https://x.org which you can get via MacPorts or Brew.
|
||||
|
||||
### Building for Windows 10
|
||||
|
||||
Windows 10 currently requires "Docker for Desktop" or WSL2 and a (Windows X-server).
|
||||
Windows 10 currently requires "Docker for Desktop" or WSL2 -- basically a Linux virtual machine -- and a (Windows X-server).
|
||||
See [Medley's README](https://github.com/Interlisp/medley/blob/master/README.md) for more.
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Options for Linux, ARMv7 and X-Window INIT
|
||||
|
||||
CC = gcc $(GCC_CFLAGS)
|
||||
#CC = clang $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||
$(OBJECTDIR)xbbt.o \
|
||||
$(OBJECTDIR)dspif.o \
|
||||
$(OBJECTDIR)xinit.o \
|
||||
$(OBJECTDIR)xscroll.o \
|
||||
$(OBJECTDIR)xcursor.o \
|
||||
$(OBJECTDIR)xlspwin.o \
|
||||
$(OBJECTDIR)xrdopt.o \
|
||||
$(OBJECTDIR)xwinman.o
|
||||
|
||||
XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O0 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/lde
|
||||
@@ -1,27 +0,0 @@
|
||||
# Options for Linux, ARMv7 and X-Window
|
||||
|
||||
CC = gcc $(GCC_CFLAGS)
|
||||
#CC = clang $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||
$(OBJECTDIR)xbbt.o \
|
||||
$(OBJECTDIR)dspif.o \
|
||||
$(OBJECTDIR)xinit.o \
|
||||
$(OBJECTDIR)xscroll.o \
|
||||
$(OBJECTDIR)xcursor.o \
|
||||
$(OBJECTDIR)xlspwin.o \
|
||||
$(OBJECTDIR)xrdopt.o \
|
||||
$(OBJECTDIR)xwinman.o
|
||||
|
||||
XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex
|
||||
@@ -191,4 +191,6 @@
|
||||
#define user_subr_DUMMY 012
|
||||
#define user_subr_SAMPLE_USER_SUBR 00
|
||||
|
||||
/* Experimental yield */
|
||||
#define sb_YIELD 0322
|
||||
#endif
|
||||
|
||||
15
src/subr.c
15
src/subr.c
@@ -29,6 +29,7 @@
|
||||
/***********************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "lispemul.h"
|
||||
#include "address.h"
|
||||
#include "adr68k.h"
|
||||
@@ -779,6 +780,20 @@ void OP_subrcall(int subr_no, int argnum) {
|
||||
break;
|
||||
}
|
||||
#endif /* LPSOLVE */
|
||||
case sb_YIELD: {
|
||||
struct timespec rqts = {0, 833333};
|
||||
unsigned sleepnanos;
|
||||
POP_SUBR_ARGS;
|
||||
N_GETNUMBER(args[0], sleepnanos, ret_nil);
|
||||
if (sleepnanos > 999999999) {
|
||||
TopOfStack = NIL;
|
||||
break;
|
||||
}
|
||||
rqts.tv_nsec = sleepnanos;
|
||||
nanosleep(&rqts, NULL);
|
||||
TopOfStack = ATOM_T;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
char errtext[200];
|
||||
sprintf(errtext, "OP_subrcall: Invalid alpha byte 0%o", ((*(PC + 1)) & 0xff));
|
||||
|
||||
Reference in New Issue
Block a user