Skip to content

Commit 4eb459e

Browse files
committed
Initial commit
0 parents  commit 4eb459e

File tree

350 files changed

+205669
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+205669
-0
lines changed

.VLM

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
genera.network: tap1:CHAOS|402;host=777,tap0:INTERNET|192.168.2.2;gateway=192.168.2.1;host=192.168.2.1
2+
3+
genera.virtualMemory: 512
4+
genera.trace: no
5+
genera.worldSearchPath: /home/lispm/snap5/jj-vlm:/home/lispm/snap5/vlods:/var/lib/symbolics
6+
*main.geometry: 1280x1024+0+1024
7+
*coldLoad.geometry: 800x600+1280+0
8+
*coldLoad.iconic: yes
9+
*coldLoad.background: gray85
10+
*coldLoad.foreground: gray15
11+
12+
genera.world: ../vlods/Genera-8-5.vlod
13+
genera.spy: no
14+
15+
genera.debugger: VLM_debugger
16+
17+

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/Makefile
2+
/Makefile.in
3+
/aclocal.m4
4+
/autom4te.cache/
5+
/config.*
6+
/VLM_debugger
7+
/m4/
8+
/stamp-h?
9+
.deps/
10+
.dirstamp
11+
*.o
12+
*~
13+
/autoscan.*
14+
/configure.scan
15+
/keyboard.c
16+
/keyboard
17+
/machine
18+
/2machines
19+
/tozeb
20+
/vlm-*.xz
21+

AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
authors:
2+
vlm on alpha:P.T.Withington, Scott McKay, and Gary Palter at Symbolics Inc.
3+
Paul Robertson at Dynamic Object Language Group
4+
see: http://pt.withy.org/publications/VLM.html
5+
6+
x86_64 port: by bard parker ([email protected])
7+
8+
last modified: Joachim Jachemich ([email protected])

COPYING

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/share/automake-1.13/COPYING

ChangeLog

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
in 2013 disassembled Brad's genera to locate and fix the integer division
2+
code. Located and binary patched it - integer division works ok.
3+
Oct 2014 eventually located the vlm source code and began to work on it.
4+
in 2014 changed stub/process.lisp to work with clisp
5+
implemented rational division as "asm" operation in
6+
alpha-emulator/imacmath.lisp and stub/process.lisp
7+
implemented double-float trap as "c" code in
8+
alpha-emulator/imactrap.lisp and stub/process.lisp
9+
implemented networking using a tap interface for internet
10+
as well as chaos in life-support/network-tap-linux.c.
11+
floor/ceiling/round produce erroneous results - fixed them by
12+
introducing new "pseudo" alpha-ops and generating code in
13+
stub/process.lisp to make use of the libm-functions
14+
floor, ceil, trunc, and rint functions.
15+
in 2015 implemented check for and workaround for X11 with xcb in
16+
life-support/cold-load.c and life-support/console.c
17+
changed keyboard detection code and key translation for
18+
the cold-load/debugger window in life-support/cold-load.c
19+
changed timing in life-support/signals.c and utilitites.c
20+
implemented nfs version 3 client in LISP.
21+
implemented a server for the "MINI" protocol in LISP,
22+
patched qld and friends to be able to do a cold load
23+
using two OG2 instances. Finally able to do a cold-load.
24+
Still looking for the cold-load generator sources...
25+
Implemented a few additions to the embedded communication
26+
area (cwd, home dir), added block-size setting for FEP-disks,
27+
added unix crypt as a callable routine. Did some changes to
28+
gc routines to be able to gc even more areas. Succeeded in
29+
saving worlds smaller then the original 8-5 world.
30+
Aug 2016 made a version of genera work on the alpha using the
31+
original alpha-assembly generation, fixed some glitches
32+
when shutting down genera (move termination of network in front
33+
of all other termination routines). moved to the x64 version as well
34+
Oct 2016 added alpha assembly instruction in alpha-emulator/imactrap.lisp
35+
to correctly identify double-float traps. Tested on alpha, then
36+
also moved to the x64 version.
37+
Nov 2016 worked on the chaosnet network module for Linux 'til
38+
Nov 2017
39+
Nov 2017 moved the source tree into an autoconf/automake project
40+
fixed a lot of compilation warnings
41+
Feb 2018 cleaned up the sources
42+
reverted useless code changes in emulator/interface.c
43+
04/21/18 added <dev>:MAC|aa:bb:cc:dd:ee:ff to network options on
44+
request from Jean Marangos. This is an additional option for the
45+
interface and is used for CHAOS as well as INTERNET interfaces. By
46+
default the tap interface code will generate a new MAC address for
47+
the OG2 end of the tap tunnel each time genera is started.
48+
04/24/18 developed a LISP patch to use the hosts time at startup instead
49+
of asking around on the network
50+
04/26/18 added "host=address" option to network specifications, so a
51+
network specification could now look like
52+
"tap0:INTERNET|192.168.2.2;gateway=192.168.2.1;host=192.168.2.1",
53+
for example or
54+
"tap0:CHAOS|401;host=777". By default the tap interface code
55+
assumes its host is ".1" on the guests subnet for ip, or "377" on the
56+
guest subnet for chaos. Giving the "host=" option will override
57+
this default, should you ever need it. I you give the host option
58+
the address used should be the same address you've used when you
59+
configured the tap interface.
60+
added some of the LISP patches I use to the OG2-patches directory
61+
04/27/18 removed "while (1);" from vpunt() to allow termination after an
62+
error
63+
04/28/18 use ucontext_t instead of struct ucontext in emulator/interfac.c
64+
and emulator/memory.c as reported by Seth Morabito
65+
added extern definitions for fixtfloat, _ADDS, _SUBS, _MULS, _DIVS
66+
as those caused gcc hickups on Ubuntu reported by Seth Morabito
67+
bumped version to vlm-0.99-1
68+
04/29/18 fixed a bug in life-support/disks.c where passing a negative
69+
blocksize lead to non-logical blocksize settings
70+

GNUmakefile.orig

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
#
2+
# Builds the Ivory Emulator (VLM)
3+
#
4+
# The command line to build an emulator is
5+
#
6+
# make {OPTIONS="option1 option2 ..."} {NONSHARED=YES} TARGET
7+
#
8+
# where TARGET is either "genera", "minima", or "iverify". The makefile will
9+
# automatically include the -DGENERA, -DMINIMA, or -DIVERIFY preprocessor option
10+
# when invoking the compiler and assembler.
11+
#
12+
# On the make command line, use OPTIONS="option1 option2 ..." to specify compiler
13+
# and assembler options, notably preprocessor options.
14+
#
15+
# The main preprocessor options used throughout the sources are
16+
# GENERA to build an emulator that is intended to run Genera
17+
# MINIMA to build an emulator that is intended to run Minima
18+
# IVERIFY to build an emulator that is intended to run the instruction test suite
19+
# TRACING to enable instruction tracing and counting
20+
# CACHEMETERING to enable instruction cache metering facilities
21+
# TRAPMETERING to enable trap metering facilities
22+
# STATISTICS to enable other statistics-gathering facilities
23+
# if enabled:
24+
# EXECTIMES : enable execution times statistics
25+
# ends up in "usagedata.lisp" / "usagedata.text" after a vlm run
26+
# DEBUGGING to enable debugging facilities
27+
# DEBUG* to enable other, more specific debugging facilities
28+
# AUTOSTART to immediately start execution of the loaded image without waiting for
29+
# a :Start Interactor command from the Minima Debugger. (This option is defined
30+
# automatically when the TARGET is "genera".)
31+
# USE_CPU_FOR_MICROSECOND_CLOCK to use the process CPU time rather than elapsed time
32+
# as the value of Ivory's microsecond clock
33+
# DISK_SIZE_1536 to enable disks.c to read 1536 bytes sectors
34+
# instead of the default 8192 byte sectors
35+
# DEBUG_DISK
36+
# enable disk read/write verbosity
37+
# DEBUG_NETWORk
38+
# Networking debug verbosity
39+
# if enabled:
40+
# DEBUG_CHAOS
41+
# DEBUG_IP
42+
# DEBUG_ARP
43+
# DEBUG_ICMP
44+
# verbosity of indiv. netwoeking parts
45+
#
46+
# For example, to create an emulator that runs Genera but waits for a :Start Interactor
47+
# command from the Minima Debugger before booting and also has debugging features enabled,
48+
#
49+
# make genera OPTIONS="-DDEBUGGING -UAUTOSTART"
50+
#
51+
# If you specify a target different from your last build, you must remove all object
52+
# files first to ensure that everything is properly compiled. Use the "clean" target.
53+
#
54+
# In fact, if you change any settings between builds, it's a good idea to build from scratch
55+
#
56+
# On the make command line, use PROFILE=YES to build the VLM using the profiling option
57+
# to gather statistics on execution frequencies.
58+
#
59+
# On the make command line, use NONSHARED=YES to build the VLM using the non-shared
60+
# libraries. (The default is to use the shared libraries.)
61+
#
62+
63+
64+
LIFE = ./life-support
65+
EMULATOR = ./emulator
66+
G5EMULATOR = ./g5-emulator
67+
X86EMULATOR = ./x86_64-emulator
68+
OTHER = ./other
69+
70+
CPU = $(X86EMULATOR)
71+
CLISP = /usr/bin/clisp
72+
CCL=/home/lispm/ccl/scripts/ccl64
73+
OPTIMOPT = -Ofast -march=native -fno-strict-aliasing
74+
NOCONAOPTIMOPT = -Ofast -march=nocona -fno-strict-aliasing
75+
76+
genera: MAINOPTIONS = -DGENERA -DAUTOSTART -DUSE_TAP #-DUSE_CPU_FOR_MICROSECOND_CLOCK
77+
minima: MAINOPTIONS = -DMINIMA -DUSE_TAP
78+
iverify: MAINOPTIONS = -DIVERIFY -DUSE_TAP
79+
80+
genera.nocona: MAINOPTIONS = -DGENERA -DAUTOSTART -DUSE_TAP #-DUSE_CPU_FOR_MICROSECOND_
81+
82+
SYMBOLSOPT =
83+
#SYMBOLSOPT = -g
84+
85+
# -foptimize-sibling-calls -fstrength-reduce \
86+
# -fexpensive-optimizations \
87+
# -fsched-interblock -fsched-spec -fpeephole2 \
88+
# -freorder-blocks -freorder-functions \
89+
# -funit-at-a-time \
90+
# -falign-functions -falign-jumps -falign-loops -falign-labels \
91+
# -fcrossjumping \
92+
# -finline-functions -frename-registers -funswitch-loops \
93+
# -fregmove \
94+
# -fcse-follow-jumps \
95+
# -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse \
96+
# -fgcse-lm -fgcse-sm -fgcse-las -fdelete-null-pointer-checks \
97+
# -foptimize-sibling-calls -fcaller-saves -Winline \
98+
# -fno-strict-aliasing \
99+
# -fschedule-insns -fschedule-insns2
100+
101+
# broken
102+
#-fstrict-aliasing
103+
#-fschedule-insns -fschedule-insns2
104+
105+
#-fforce-mem -foptimize-sibling-calls -fstrength-reduce -fcse-follow-jumps
106+
#-fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse
107+
#-fgcse-lm -fgcse-sm -fgcse-las -fdelete-null-pointer-checks
108+
#-fexpensive-optimizations -fregmove -fschedule-insns -fsched-ule-insns2
109+
#-fsched-interblock -fsched-spec -fcaller-saves -fpeep-hole2
110+
#-freorder-blocks -freorder-functions -fstrict-aliasing
111+
#-funit-at-a-time -falign-functions -falign-jumps -falign-loops
112+
#-falign-labels -fcrossjumping
113+
114+
#-finline-functions, -fweb, -frename-registers and -funswitch-loops
115+
116+
CFLAGS = $(OPTIMOPT) $(SYMBOLSOPT) -std=gnu99 -I/usr/X11R6/include -I. -I$(LIFE) -I$(EMULATOR) -I$(X86EMULATOR) $(MAINOPTIONS) $(OPTIONS)
117+
AFLAGS = $(SYMBOLSOPT) -I. -I$(LIFE) -I$(EMULATOR) -I$(X86EMULATOR) $(MAINOPTIONS) $(OPTIONS)
118+
119+
.SUFFIXES:
120+
.SUFFIXES: .o .c .S
121+
122+
.c.o:
123+
$(CC) $(CFLAGS) -o $@ -c $<
124+
125+
.S.o:
126+
$(CC) $(AFLAGS) -o $@ -c $<
127+
128+
SRCS = main.c spy.c world_tools.c utilities.c \
129+
$(LIFE)/cold_load.c $(LIFE)/console.c $(LIFE)/disks.c $(LIFE)/initialization.c \
130+
$(LIFE)/network.c $(LIFE)/message_channels.c $(LIFE)/polling.c $(LIFE)/queues.c \
131+
$(LIFE)/signals.c $(LIFE)/unixcrypt.c \
132+
$(EMULATOR)/interfac.c $(EMULATOR)/interpds.c $(EMULATOR)/externals.c \
133+
$(EMULATOR)/memory.c
134+
135+
NETWORKSOURCES = $(LIFE)/network-osf.c \
136+
$(LIFE)/network-linux.c $(LIFE)/network-tun-linux.c \
137+
$(LIFE)/network-darwin.c $(LIFE)/network-libpcap.c
138+
139+
FAKEEMULATOR=y
140+
ifndef FAKEEMULATOR
141+
ASMS = $(EMULATOR)/emulator.S
142+
EMULATOROBJ = $(EMULATOR)/emulator.o
143+
COMPONENTS = $(CPU)/idispat.s $(CPU)/ifuncom1.s $(CPU)/ifuncom2.s \
144+
$(CPU)/ifungene.s $(CPU)/ifunfcal.s $(CPU)/ifunloop.s \
145+
$(CPU)/ifunlist.s $(CPU)/ifuninst.s $(CPU)/ifunmath.s \
146+
$(CPU)/ifunarra.s $(CPU)/ifunmove.s $(CPU)/ifunpred.s \
147+
$(CPU)/ifunsubp.s $(CPU)/ifunfext.s $(CPU)/ifunlexi.s \
148+
$(CPU)/ifunbits.s $(CPU)/ifunblok.s $(CPU)/ifunbind.s \
149+
$(CPU)/ifunfull.s $(CPU)/ifunbnum.s $(CPU)/ifuntrap.s \
150+
$(CPU)/ihalt.s $(CPU)/idouble.s $(CPU)/ifunjosh.s \
151+
$(CPU)/ifuntran.s
152+
else
153+
# ASMS = $(EMULATOR)/fake_emulator.c
154+
# EMULATOROBJ = $(EMULATOR)/fake_emulator.o
155+
ASMS = stub/stub.c
156+
EMULATOROBJ = stub/stub.o
157+
COMPONENTS =
158+
endif
159+
160+
OBJS = $(LIFE)/cold_load.o $(LIFE)/console.o $(LIFE)/disks.o $(LIFE)/initialization.o \
161+
$(LIFE)/network.o $(LIFE)/message_channels.o $(LIFE)/polling.o $(LIFE)/queues.o \
162+
$(LIFE)/signals.o $(LIFE)/unixcrypt.o \
163+
world_tools.o utilities.o spy.o \
164+
$(EMULATOR)/interfac.o $(EMULATOR)/interpds.o $(EMULATOR)/externals.o \
165+
$(EMULATOR)/memory.o $(EMULATOROBJ)
166+
167+
EMULATORINCLUDES = $(EMULATOR)/aihead.h $(CPU)/aistat.h $(EMULATOR)/ivoryrep.h
168+
169+
OTHEROBJS =
170+
171+
ifdef NONSHARED
172+
OTHEROBJS +=
173+
# LIBRARIES = -lpthread -lc -lX11 -lm -lpcap
174+
LIBRARIES = -lpthread -lc -lX11 -lm
175+
EARLYLIBS = -L/opt/ppc64/X11R6/lib
176+
else
177+
OTHEROBJS +=
178+
# LIBRARIES = -lpthread -lc -lX11 -lm
179+
# EARLYLIBS = -L/opt/ppc64/X11R6/lib
180+
# LIBRARIES = -rdynamic -lpthread -lc -lX11 -lm -ldl -lX11-xcb -lpcap
181+
# LIBRARIES = -rdynamic -lpthread -lc -lX11 -lm -ldl -lX11-xcb
182+
LIBRARIES = -rdynamic -lpthread -lc -lX11 -lm -ldl -lcrypt
183+
EARLYLIBS = -L/usr/X11R6/lib64 -L/usr/X11R6/lib
184+
endif
185+
186+
ifdef PROFILE
187+
override PROFILE = -p
188+
endif
189+
190+
all: clean genera
191+
nocona: clean genera.nocona
192+
193+
$(SRCS): $(EMULATORINCLUDES)
194+
195+
$(LIFE)/network.o: $(NETWORKSOURCES) $(EMULATORINCLUDES)
196+
197+
alpha-emulator/aistat.h: alpha-emulator/aistat.sid
198+
$(CCL) -b -Q -l compile-alpha-emulator.lisp </dev/null
199+
200+
emulator/aihead.h: emulator/aihead.sid
201+
$(CCL) -b -Q -l compile-alpha-emulator.lisp </dev/null
202+
203+
$(CPU)/aistat.h: alpha-emulator/aistat.sid
204+
$(CCL) -b -Q -l compile-alpha-emulator.lisp </dev/null
205+
cp alpha-emulator/aistat.h $(CPU)/aistat.h
206+
207+
stub/stub.o: stub/i*.c stub/float2 stub/dispatch stub/*.c alpha-emulator/*.lisp $(EMULATORINCLUDES)
208+
209+
stub/i*.c: alpha-emulator/*.as alpha-emulator/*lisp alpha-emulator/*.c alpha-emulator/*.h stub/*.lisp $(EMULATORINCLUDES)
210+
cd stub ; $(CLISP) process.lisp
211+
212+
$(EMULATOROBJ): $(ASMS) $(COMPONENTS) $(EMULATORINCLUDES)
213+
214+
$(EMULATOR)/externals.o: $(EMULATOR)/externals.c $(EMULATORINCLUDES)
215+
$(EMULATOR)/interpds.o: $(EMULATOR)/interpds.c $(EMULATORINCLUDES) $(EMULATOR)/asmfuns.h
216+
$(EMULATOR)/interfac.o: $(EMULATOR)/interfac.c $(EMULATORINCLUDES)
217+
spy.o: spy.c $(EMULATORINCLUDES)
218+
219+
genera: CFLAGS = $(OPTIMOPT) $(SYMBOLSOPT) -std=gnu99 -I/usr/X11R6/include -I. -I$(LIFE) -I$(EMULATOR) -I$(X86EMULATOR) $(MAINOPTIONS) $(OPTIONS)
220+
221+
genera: main.o byteswap_world.o $(OBJS) $(OTHEROBJS)
222+
cc $(PROFILE) -o genera $(EARLYLIBS) $(OTHEROBJS) main.o $(OBJS) $(LIBRARIES)
223+
cc $(PROFILE) -o byteswap_world $(EARLYLIBS) $(OTHEROBJS) byteswap_world.o $(OBJS) $(LIBRARIES)
224+
225+
#OPTIMOPT = -Ofast -march=nocona -fno-strict-aliasing
226+
genera.nocona: CFLAGS = $(NOCONAOPTIMOPT) $(SYMBOLSOPT) -std=gnu99 -I/usr/X11R6/include -I. -I$(LIFE) -I$(EMULATOR) -I$(X86EMULATOR) $(MAINOPTIONS) $(OPTIONS)
227+
228+
genera.nocona: main.o byteswap_world.o $(OBJS) $(OTHEROBJS)
229+
cc $(PROFILE) -o genera.nocona $(EARLYLIBS) $(OTHEROBJS) main.o $(OBJS) $(LIBRARIES)
230+
cc $(PROFILE) -o byteswap_world.nocona $(EARLYLIBS) $(OTHEROBJS) byteswap_world.o $(OBJS) $(LIBRARIES)
231+
232+
minima: main.o $(OBJS) $(OTHEROBJS)
233+
cc $(PROFILE) -o minima $(EARLYLIBS) $(OTHEROBJS) main.o $(OBJS) $(LIBRARIES)
234+
235+
iverify: main.o $(OBJS) $(OTHEROBJS)
236+
cc $(PROFILE) -o iverify $(EARLYLIBS) $(OTHEROBJS) main.o $(OBJS) $(LIBRARIES)
237+
238+
clean:
239+
rm -f main.o byteswap_world.o $(OBJS) *~ ./stub/i*.c ./stub/*~ $(LIFE)/*~ $(EMULATOR)/*~ $(CPU)/*~ **/*~
240+

0 commit comments

Comments
 (0)