From 41a18aef39b16d72fd1cb0a31b937060c40a8caa Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Sun, 8 Jun 2008 09:00:00 +0000 Subject: [PATCH] add a compatible sync command --- WEGA/src/cmd/Makefile | 12 +++++++++++- WEGA/src/cmd/compat1crt.s | 28 ++++++++++++++++++++++++++++ WEGA/src/cmd/sync.c | 7 +++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 WEGA/src/cmd/compat1crt.s create mode 100644 WEGA/src/cmd/sync.c diff --git a/WEGA/src/cmd/Makefile b/WEGA/src/cmd/Makefile index ea0c117..039d51f 100644 --- a/WEGA/src/cmd/Makefile +++ b/WEGA/src/cmd/Makefile @@ -1,5 +1,9 @@ +CAS= cas +CC= cc +LD= ld + FILES= getud putud -STRIPFILES= copydisk dump dumpdir format restor tar verify +STRIPFILES= copydisk dump dumpdir format restor sync tar verify all: $(FILES) $(STRIPFILES) strip @@ -8,3 +12,9 @@ strip: clean: rm -f $(FILES) $(STRIPFILES) + +compat1crt.o: compat1crt.s + $(CAS) -u -o $@ $*.s + +sync: compat1crt.o sync.o + $(LD) -o $@ -e start compat1crt.o sync.o -lc diff --git a/WEGA/src/cmd/compat1crt.s b/WEGA/src/cmd/compat1crt.s new file mode 100644 index 0000000..f1d695e --- /dev/null +++ b/WEGA/src/cmd/compat1crt.s @@ -0,0 +1,28 @@ +.comm 2, _environ; + +.code +start:: + { + jr foo +.byte "......1981 87wega3.2." +.byte %00 +foo: + ld r7,@r15 + lda r6,%0000+2(r15) + ld r2,@r6 + clr %0000-2(r2) + ld r5,r6 + subl rr0,rr0 + cpir r0,@r5,r1,eq + cp r5,r2 + jr ult,_foo + dec r5,#2 +_foo: + ld _environ,r5 + call _main + ld r7,r2 + call __callex + sc #1 + } +.data +. = .+2 diff --git a/WEGA/src/cmd/sync.c b/WEGA/src/cmd/sync.c new file mode 100644 index 0000000..7e5a9a4 --- /dev/null +++ b/WEGA/src/cmd/sync.c @@ -0,0 +1,7 @@ +char whatstr[] = "@[$]sync.c 1.2 07/24/82 03:16:45 - 87wega3.2"; + +main() +{ + sync(); + exit(0); +}