initial version
authorceriel <none@none>
Tue, 10 Oct 1989 11:40:55 +0000 (11:40 +0000)
committerceriel <none@none>
Tue, 10 Oct 1989 11:40:55 +0000 (11:40 +0000)
74 files changed:
mach/i386/libsys/.distr [new file with mode: 0644]
mach/i386/libsys/LIST [new file with mode: 0644]
mach/i386/libsys/Makefile [new file with mode: 0644]
mach/i386/libsys/TODO [new file with mode: 0644]
mach/i386/libsys/_exit.s [new file with mode: 0644]
mach/i386/libsys/_pipe.s [new file with mode: 0644]
mach/i386/libsys/_profil.s [new file with mode: 0644]
mach/i386/libsys/_stime.s [new file with mode: 0644]
mach/i386/libsys/_time.s [new file with mode: 0644]
mach/i386/libsys/_wait.s [new file with mode: 0644]
mach/i386/libsys/access.s [new file with mode: 0644]
mach/i386/libsys/acct.s [new file with mode: 0644]
mach/i386/libsys/alarm.s [new file with mode: 0644]
mach/i386/libsys/brk.s [new file with mode: 0644]
mach/i386/libsys/chdir.s [new file with mode: 0644]
mach/i386/libsys/chmod.s [new file with mode: 0644]
mach/i386/libsys/chown.s [new file with mode: 0644]
mach/i386/libsys/chroot.s [new file with mode: 0644]
mach/i386/libsys/cleanup.c [new file with mode: 0644]
mach/i386/libsys/close.s [new file with mode: 0644]
mach/i386/libsys/compmodule [new file with mode: 0755]
mach/i386/libsys/creat.s [new file with mode: 0644]
mach/i386/libsys/dup.c [new file with mode: 0644]
mach/i386/libsys/dup2.c [new file with mode: 0644]
mach/i386/libsys/execl.c [new file with mode: 0644]
mach/i386/libsys/execle.c [new file with mode: 0644]
mach/i386/libsys/execv.c [new file with mode: 0644]
mach/i386/libsys/execve.s [new file with mode: 0644]
mach/i386/libsys/exit.c [new file with mode: 0644]
mach/i386/libsys/fcntl.s [new file with mode: 0644]
mach/i386/libsys/fork.s [new file with mode: 0644]
mach/i386/libsys/fstat.s [new file with mode: 0644]
mach/i386/libsys/ftime.s [new file with mode: 0644]
mach/i386/libsys/getegid.s [new file with mode: 0644]
mach/i386/libsys/geteuid.s [new file with mode: 0644]
mach/i386/libsys/getgid.s [new file with mode: 0644]
mach/i386/libsys/getpgrp.s [new file with mode: 0644]
mach/i386/libsys/getpid.s [new file with mode: 0644]
mach/i386/libsys/getppid.s [new file with mode: 0644]
mach/i386/libsys/getuid.s [new file with mode: 0644]
mach/i386/libsys/gtty.c [new file with mode: 0644]
mach/i386/libsys/head_em.s [new file with mode: 0644]
mach/i386/libsys/ioctl.s [new file with mode: 0644]
mach/i386/libsys/kill.s [new file with mode: 0644]
mach/i386/libsys/link.s [new file with mode: 0644]
mach/i386/libsys/lseek.s [new file with mode: 0644]
mach/i386/libsys/mknod.s [new file with mode: 0644]
mach/i386/libsys/mount.s [new file with mode: 0644]
mach/i386/libsys/nice.s [new file with mode: 0644]
mach/i386/libsys/open.s [new file with mode: 0644]
mach/i386/libsys/pause.s [new file with mode: 0644]
mach/i386/libsys/pipe.c [new file with mode: 0644]
mach/i386/libsys/profil.c [new file with mode: 0644]
mach/i386/libsys/read.s [new file with mode: 0644]
mach/i386/libsys/sbrk.s [new file with mode: 0644]
mach/i386/libsys/setgid.s [new file with mode: 0644]
mach/i386/libsys/setuid.s [new file with mode: 0644]
mach/i386/libsys/signal.s [new file with mode: 0644]
mach/i386/libsys/stat.s [new file with mode: 0644]
mach/i386/libsys/stime.c [new file with mode: 0644]
mach/i386/libsys/stty.c [new file with mode: 0644]
mach/i386/libsys/sync.s [new file with mode: 0644]
mach/i386/libsys/sys.s [new file with mode: 0644]
mach/i386/libsys/time.c [new file with mode: 0644]
mach/i386/libsys/times.s [new file with mode: 0644]
mach/i386/libsys/ulimit.s [new file with mode: 0644]
mach/i386/libsys/umask.s [new file with mode: 0644]
mach/i386/libsys/umount.s [new file with mode: 0644]
mach/i386/libsys/uname.s [new file with mode: 0644]
mach/i386/libsys/unlink.s [new file with mode: 0644]
mach/i386/libsys/utime.s [new file with mode: 0644]
mach/i386/libsys/wait.c [new file with mode: 0644]
mach/i386/libsys/write.s [new file with mode: 0644]
mach/i386/libsys/xdup.s [new file with mode: 0644]

diff --git a/mach/i386/libsys/.distr b/mach/i386/libsys/.distr
new file mode 100644 (file)
index 0000000..d5a561d
--- /dev/null
@@ -0,0 +1,5 @@
+LIST
+Makefile
+compmodule
+head_em.s
+libmon_s.a
diff --git a/mach/i386/libsys/LIST b/mach/i386/libsys/LIST
new file mode 100644 (file)
index 0000000..0a9b5dc
--- /dev/null
@@ -0,0 +1,69 @@
+libmon_s.a
+exit.c
+cleanup.c
+stty.c
+gtty.c
+dup.c
+dup2.c
+execl.c
+execle.c
+execv.c
+pipe.c
+profil.c
+stime.c
+time.c
+wait.c
+_exit.s
+_pipe.s
+_profil.s
+_stime.s
+_time.s
+_wait.s
+access.s
+acct.s
+alarm.s
+brk.s
+chdir.s
+chmod.s
+chown.s
+chroot.s
+close.s
+creat.s
+execve.s
+fcntl.s
+fork.s
+fstat.s
+ftime.s
+getegid.s
+geteuid.s
+getgid.s
+getpgrp.s
+getpid.s
+getppid.s
+getuid.s
+ioctl.s
+kill.s
+link.s
+lseek.s
+mknod.s
+mount.s
+nice.s
+open.s
+pause.s
+read.s
+sbrk.s
+setgid.s
+setuid.s
+signal.s
+stat.s
+sync.s
+sys.s
+times.s
+ulimit.s
+umask.s
+umount.s
+uname.s
+unlink.s
+utime.s
+write.s
+xdup.s
diff --git a/mach/i386/libsys/Makefile b/mach/i386/libsys/Makefile
new file mode 100644 (file)
index 0000000..d00169f
--- /dev/null
@@ -0,0 +1,28 @@
+# $Header$
+MACH=i386
+all:           libmon_o.a head_em.o
+
+install:       all
+               ../../install libmon_o.a tail_mon
+               ../../install head_em.o head_em
+
+cmp:           all
+               -../../compare libmon_o.a tail_mon
+               -../../compare head_em.o head_em
+
+libmon_o.a:    libmon_s.a
+               ASAR=aal ; export ASAR ;\
+               march . libmon_o.a
+
+head_em.o:     head_em.s
+               $(MACH) -O -c head_em.s
+
+clean:
+               rm -f *.o libmon_o.a
+
+opr :
+               make pr | opr
+
+pr:
+               @pr `pwd`/head_em.s
+               @arch pv libmon_s.a | pr -h `pwd`/libmon_s.a
diff --git a/mach/i386/libsys/TODO b/mach/i386/libsys/TODO
new file mode 100644 (file)
index 0000000..8ddc880
--- /dev/null
@@ -0,0 +1,2 @@
+This library is incomplete. Of some Xenix systemcalls the interface is
+not implemented.
diff --git a/mach/i386/libsys/_exit.s b/mach/i386/libsys/_exit.s
new file mode 100644 (file)
index 0000000..445d1e2
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __exit
+.sect .text
+__exit:
+       mov     ax,1
+       callf   0x7:0x0
+       jmp     cerror
diff --git a/mach/i386/libsys/_pipe.s b/mach/i386/libsys/_pipe.s
new file mode 100644 (file)
index 0000000..a511032
--- /dev/null
@@ -0,0 +1,12 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __pipe
+.sect .text
+__pipe:
+       mov     ax,42
+       callf   0x7:0x0
+       jae     1f
+       jmp     cerror
+1:
+       shl     dx,0x10
+       or      eax,edx
+       ret
diff --git a/mach/i386/libsys/_profil.s b/mach/i386/libsys/_profil.s
new file mode 100644 (file)
index 0000000..53ce087
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __profil
+.sect .text
+__profil:
+       mov     ax,44
+       jmp     syscal
diff --git a/mach/i386/libsys/_stime.s b/mach/i386/libsys/_stime.s
new file mode 100644 (file)
index 0000000..5b8aa68
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __stime
+.sect .text
+__stime:
+       mov     ax,25
+       jmp     sysx
diff --git a/mach/i386/libsys/_time.s b/mach/i386/libsys/_time.s
new file mode 100644 (file)
index 0000000..9e71c45
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __time
+.sect .text
+__time:
+       mov     ax,13
+       jmp     syscal
diff --git a/mach/i386/libsys/_wait.s b/mach/i386/libsys/_wait.s
new file mode 100644 (file)
index 0000000..045f50e
--- /dev/null
@@ -0,0 +1,12 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __wait
+.sect .text
+__wait:
+       mov     ax,7
+       callf   0x7:0x0
+       jb      1f
+       shl     dx,0x10
+       or      eax,edx
+       ret
+1:
+       jmp     cerror
diff --git a/mach/i386/libsys/access.s b/mach/i386/libsys/access.s
new file mode 100644 (file)
index 0000000..2ada3bb
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _access
+.sect .text
+_access:
+       mov     ax,33
+       jmp     sysx
diff --git a/mach/i386/libsys/acct.s b/mach/i386/libsys/acct.s
new file mode 100644 (file)
index 0000000..17a698d
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _acct
+.sect .text
+_acct:
+       mov     ax,51
+       jmp     sysx
diff --git a/mach/i386/libsys/alarm.s b/mach/i386/libsys/alarm.s
new file mode 100644 (file)
index 0000000..e826ee4
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _alarm
+.sect .text
+_alarm:
+       mov     ax,27
+       jmp     syscal
diff --git a/mach/i386/libsys/brk.s b/mach/i386/libsys/brk.s
new file mode 100644 (file)
index 0000000..7933cd4
--- /dev/null
@@ -0,0 +1,13 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _brk
+.sect .text
+_brk:
+       mov     ax,17
+       callf   0x7:0x0
+       jb      1f
+       mov     ax,4(sp)
+       mov     (.limhp),ax
+       xor     ax,ax
+       ret
+1:
+       jmp     cerror
diff --git a/mach/i386/libsys/chdir.s b/mach/i386/libsys/chdir.s
new file mode 100644 (file)
index 0000000..410245e
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chdir
+.sect .text
+_chdir:
+       mov     ax,12
+       jmp     sysx
diff --git a/mach/i386/libsys/chmod.s b/mach/i386/libsys/chmod.s
new file mode 100644 (file)
index 0000000..ecc11ba
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chmod
+.sect .text
+_chmod:
+       mov     ax,15
+       jmp     sysx
diff --git a/mach/i386/libsys/chown.s b/mach/i386/libsys/chown.s
new file mode 100644 (file)
index 0000000..6aa5d12
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chown
+.sect .text
+_chown:
+       mov     ax,16
+       jmp     sysx
diff --git a/mach/i386/libsys/chroot.s b/mach/i386/libsys/chroot.s
new file mode 100644 (file)
index 0000000..dad1312
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chroot
+.sect .text
+_chroot:
+       mov     ax,61
+       jmp     sysx
diff --git a/mach/i386/libsys/cleanup.c b/mach/i386/libsys/cleanup.c
new file mode 100644 (file)
index 0000000..6cd9c63
--- /dev/null
@@ -0,0 +1 @@
+_cleanup() { }
diff --git a/mach/i386/libsys/close.s b/mach/i386/libsys/close.s
new file mode 100644 (file)
index 0000000..e81f5d1
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _close
+.sect .text
+_close:
+       mov     ax,6
+       jmp     sysx
diff --git a/mach/i386/libsys/compmodule b/mach/i386/libsys/compmodule
new file mode 100755 (executable)
index 0000000..db47c61
--- /dev/null
@@ -0,0 +1,4 @@
+if i386 -c -L $1 1>&2
+then echo `basename $1 $2`.o
+else exit 1
+fi
diff --git a/mach/i386/libsys/creat.s b/mach/i386/libsys/creat.s
new file mode 100644 (file)
index 0000000..6d38983
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _creat
+.sect .text
+_creat:
+       mov     ax,8
+       jmp     syscal
diff --git a/mach/i386/libsys/dup.c b/mach/i386/libsys/dup.c
new file mode 100644 (file)
index 0000000..a1dfc2a
--- /dev/null
@@ -0,0 +1,5 @@
+int
+dup(d)
+{
+       return __xdup(d, 0);
+}
diff --git a/mach/i386/libsys/dup2.c b/mach/i386/libsys/dup2.c
new file mode 100644 (file)
index 0000000..ba0513b
--- /dev/null
@@ -0,0 +1,6 @@
+int
+dup2(oldd, newd)
+{
+       oldd |= 64;
+       return __xdup(oldd, newd);
+}
diff --git a/mach/i386/libsys/execl.c b/mach/i386/libsys/execl.c
new file mode 100644 (file)
index 0000000..6fdcea3
--- /dev/null
@@ -0,0 +1,9 @@
+int
+execl(name,args)
+       char *name;
+       int args;
+{
+       extern char **environ;
+
+       return execve(name,&args,environ);
+}
diff --git a/mach/i386/libsys/execle.c b/mach/i386/libsys/execle.c
new file mode 100644 (file)
index 0000000..6de27d8
--- /dev/null
@@ -0,0 +1,10 @@
+int
+execle(name,args)
+       char *name;
+       char *args;
+{
+       char **p = &args;
+       while (*p++) ;
+
+       return execve(name,&args,*p);
+}
diff --git a/mach/i386/libsys/execv.c b/mach/i386/libsys/execv.c
new file mode 100644 (file)
index 0000000..748fec7
--- /dev/null
@@ -0,0 +1,8 @@
+int
+execv(name,args)
+       char *name;
+       char **args;
+{
+       extern char **environ;
+       return execve(name,args,environ);
+}
diff --git a/mach/i386/libsys/execve.s b/mach/i386/libsys/execve.s
new file mode 100644 (file)
index 0000000..73b60ae
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _execve
+.sect .text
+_execve:
+       mov     ax,59
+       callf   0x7:0x0
+       jmp     cerror
diff --git a/mach/i386/libsys/exit.c b/mach/i386/libsys/exit.c
new file mode 100644 (file)
index 0000000..afd54b3
--- /dev/null
@@ -0,0 +1,5 @@
+exit(n)
+{
+       _cleanup();
+       _exit(n);
+}
diff --git a/mach/i386/libsys/fcntl.s b/mach/i386/libsys/fcntl.s
new file mode 100644 (file)
index 0000000..28cd821
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _fcntl
+.sect .text
+_fcntl:
+       mov     ax,62
+       jmp     syscal
diff --git a/mach/i386/libsys/fork.s b/mach/i386/libsys/fork.s
new file mode 100644 (file)
index 0000000..a685319
--- /dev/null
@@ -0,0 +1,18 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _fork, _par_uid
+.sect .bss
+.comm  _par_uid, 4
+.sect .text
+_fork:
+       mov     ax,2
+       callf   0x7:0x0
+       jb      1f
+       and     dx,dx
+       jne     2f
+       ret
+1:
+       jmp     cerror
+2:
+       mov     (_par_uid),ax
+       xor     ax,ax
+       ret
diff --git a/mach/i386/libsys/fstat.s b/mach/i386/libsys/fstat.s
new file mode 100644 (file)
index 0000000..97fa8d0
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _fstat
+.sect .text
+_fstat:
+       mov     ax,28
+       jmp     sysx
diff --git a/mach/i386/libsys/ftime.s b/mach/i386/libsys/ftime.s
new file mode 100644 (file)
index 0000000..e2c78e2
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ftime
+.sect .text
+_ftime:
+       mov     ax,2856
+       jmp     syscal
diff --git a/mach/i386/libsys/getegid.s b/mach/i386/libsys/getegid.s
new file mode 100644 (file)
index 0000000..3225f78
--- /dev/null
@@ -0,0 +1,11 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getegid
+.sect .text
+_getegid:
+       mov     ax,47
+       callf   0x7:0x0
+       jb      1f
+       xchg    dx,ax
+       ret
+1:
+       jmp     cerror
diff --git a/mach/i386/libsys/geteuid.s b/mach/i386/libsys/geteuid.s
new file mode 100644 (file)
index 0000000..483c6f7
--- /dev/null
@@ -0,0 +1,11 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _geteuid
+.sect .text
+_geteuid:
+       mov     ax,24
+       callf   0x7:0x0
+       jb      1f
+       xchg    dx,ax
+       ret
+1:
+       jmp     cerror
diff --git a/mach/i386/libsys/getgid.s b/mach/i386/libsys/getgid.s
new file mode 100644 (file)
index 0000000..a218ff2
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getgid
+.sect .text
+_getgid:
+       mov     ax,47
+       jmp     syscal
diff --git a/mach/i386/libsys/getpgrp.s b/mach/i386/libsys/getpgrp.s
new file mode 100644 (file)
index 0000000..c49f1bd
--- /dev/null
@@ -0,0 +1,10 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getpgrp
+.sect .text
+_getpgrp:
+       xor     ax,ax
+       push    ax
+       mov     ax,39
+       call    syscal
+       pop     bx
+       ret
diff --git a/mach/i386/libsys/getpid.s b/mach/i386/libsys/getpid.s
new file mode 100644 (file)
index 0000000..3bf7eec
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getpid
+.sect .text
+_getpid:
+       mov     ax,20
+       jmp     syscal
diff --git a/mach/i386/libsys/getppid.s b/mach/i386/libsys/getppid.s
new file mode 100644 (file)
index 0000000..250ae11
--- /dev/null
@@ -0,0 +1,11 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getppid
+.sect .text
+_getppid:
+       mov     ax,20
+       callf   0x7:0x0
+       jb      1f
+       xchg    dx,ax
+       ret
+1:
+       jmp     cerror
diff --git a/mach/i386/libsys/getuid.s b/mach/i386/libsys/getuid.s
new file mode 100644 (file)
index 0000000..f59edd3
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getuid
+.sect .text
+_getuid:
+       mov     ax,24
+       jmp     syscal
diff --git a/mach/i386/libsys/gtty.c b/mach/i386/libsys/gtty.c
new file mode 100644 (file)
index 0000000..b24c145
--- /dev/null
@@ -0,0 +1,5 @@
+gtty(fildes, arg)
+       char *arg;
+{
+       return ioctl(fildes, ('t' << 8) | 8, arg);
+}
diff --git a/mach/i386/libsys/head_em.s b/mach/i386/libsys/head_em.s
new file mode 100644 (file)
index 0000000..a69785c
--- /dev/null
@@ -0,0 +1,62 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+
+.define begtext,begdata,begbss,syscal
+.define hol0,.reghp,.limhp,.trppc,.ignmask
+.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EIDIVZ,EODDZ
+.extern _end
+
+ERANGE          = 1
+ESET            = 2
+EIDIVZ          = 6
+EHEAP           = 17
+EILLINS         = 18
+EODDZ           = 19
+ECASE           = 20
+
+.sect .text
+       .data1  0353
+       .data1  0176    ! jmp to begtext in 2 bytes. Assembler generates 3
+                       ! bytes.
+       .data2 -277, -277, -277, -277
+       .space 116
+       .data2 49920
+
+begtext:
+       mov     (.limhp),ax
+       mov     (.reghp),ax
+       xor     bp,bp
+       mov bx,sp
+       mov cx,(bx)
+       add bx,4
+       mov ax,cx
+       inc ax
+       shl ax,2
+       add ax,bx
+       push ax
+       push bx
+       push cx
+       call    _m_a_i_n
+       push    ax
+       call    __exit
+.sect  .data
+begdata:
+hol0:
+       .data2   0,0
+       .data2   0,0
+argv:
+       .data4   3f
+envp:
+       .data4  0
+3:
+       .asciz "PROGRAM"
+.reghp:
+       .data4   endbss
+.limhp:
+       .data4   endbss
+.ignmask:
+       .data4   0
+.trppc:
+       .data4   0
+
+       .sect .bss
+begbss:
diff --git a/mach/i386/libsys/ioctl.s b/mach/i386/libsys/ioctl.s
new file mode 100644 (file)
index 0000000..1391669
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ioctl
+.sect .text
+_ioctl:
+       mov     ax,54
+       jmp     syscal
diff --git a/mach/i386/libsys/kill.s b/mach/i386/libsys/kill.s
new file mode 100644 (file)
index 0000000..93ee93a
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _kill
+.sect .text
+_kill:
+       mov     ax,37
+       jmp     sysx
diff --git a/mach/i386/libsys/link.s b/mach/i386/libsys/link.s
new file mode 100644 (file)
index 0000000..838f909
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _link
+.sect .text
+_link:
+       mov     ax,9
+       jmp     sysx
diff --git a/mach/i386/libsys/lseek.s b/mach/i386/libsys/lseek.s
new file mode 100644 (file)
index 0000000..547dc82
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _lseek
+.sect .text
+_lseek:
+       mov     ax,19
+       jmp     syscal
diff --git a/mach/i386/libsys/mknod.s b/mach/i386/libsys/mknod.s
new file mode 100644 (file)
index 0000000..e7d415d
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _mknod
+.sect .text
+_mknod:
+       mov     ax,14
+       jmp     sysx
diff --git a/mach/i386/libsys/mount.s b/mach/i386/libsys/mount.s
new file mode 100644 (file)
index 0000000..71ecc44
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _mount
+.sect .text
+_mount:
+       mov     ax,21
+       jmp     sysx
diff --git a/mach/i386/libsys/nice.s b/mach/i386/libsys/nice.s
new file mode 100644 (file)
index 0000000..32dea5f
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _nice
+.sect .text
+_nice:
+       mov     ax,34
+       jmp     syscal
diff --git a/mach/i386/libsys/open.s b/mach/i386/libsys/open.s
new file mode 100644 (file)
index 0000000..7fa7b1b
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _open
+.sect .text
+_open:
+       mov     ax,5
+       jmp     syscal
diff --git a/mach/i386/libsys/pause.s b/mach/i386/libsys/pause.s
new file mode 100644 (file)
index 0000000..d81d7ca
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _pause
+.sect .text
+_pause:
+       mov     ax,29
+       jmp     syscal
diff --git a/mach/i386/libsys/pipe.c b/mach/i386/libsys/pipe.c
new file mode 100644 (file)
index 0000000..fa38108
--- /dev/null
@@ -0,0 +1,14 @@
+long _pipe();
+
+int
+pipe(f)
+       int f[2];
+{
+       long x;
+
+       x = _pipe();
+       if (x == -1) return -1;
+       f[0] = x;
+       f[1] = x >> 16;
+       return 0;
+}
diff --git a/mach/i386/libsys/profil.c b/mach/i386/libsys/profil.c
new file mode 100644 (file)
index 0000000..f20e10c
--- /dev/null
@@ -0,0 +1,6 @@
+profil(buff, bufsiz, offset, scale)
+       char *buff;
+       int (*offset)();
+{
+       _profil(buff, bufsiz, offset, scale, 7262);
+}
diff --git a/mach/i386/libsys/read.s b/mach/i386/libsys/read.s
new file mode 100644 (file)
index 0000000..fd529e8
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _read
+.sect .text
+_read:
+       mov     ax,3
+       jmp     syscal
diff --git a/mach/i386/libsys/sbrk.s b/mach/i386/libsys/sbrk.s
new file mode 100644 (file)
index 0000000..cccd151
--- /dev/null
@@ -0,0 +1,29 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _sbrk
+.sect .text
+_sbrk:
+       push    bp
+       mov     bp,sp
+       mov     ax,8(bp)
+       or      ax,ax
+       jne     1f
+       mov     ax,(.limhp)
+       pop     bp
+       ret
+1:
+       mov     bx,(.limhp)
+       add     ax,bx
+       push    ax
+       call    _brk
+       or      ax,ax
+       jne     1f
+       pop     ax
+       mov     (.limhp),ax
+       mov     ax,bx
+       pop     bp
+       ret
+1:
+       pop     ax
+       mov     ax,-1
+       pop     bp
+       ret
diff --git a/mach/i386/libsys/setgid.s b/mach/i386/libsys/setgid.s
new file mode 100644 (file)
index 0000000..4ca72f9
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _setgid
+.sect .text
+_setgid:
+       mov     ax,46
+       jmp     sysx
diff --git a/mach/i386/libsys/setuid.s b/mach/i386/libsys/setuid.s
new file mode 100644 (file)
index 0000000..698143e
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _setuid
+.sect .text
+_setuid:
+       mov     ax,23
+       jmp     sysx
diff --git a/mach/i386/libsys/signal.s b/mach/i386/libsys/signal.s
new file mode 100644 (file)
index 0000000..66ac58f
--- /dev/null
@@ -0,0 +1,38 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _signal
+.sect .text
+_signal:
+       call    sig1
+       mov     ax,48
+       mov     dx,ctch
+       callf   0x7:0x0
+       jb      4f
+       ret
+sig1:
+       mov     ax,8(sp)
+       cmp     ax,20
+       jae     1f
+       mov     dx,table(ax*4)
+       mov     (prev),dx
+       mov     dx,12(sp)
+       mov     table(ax*4),dx
+       ret
+1:
+       pop     ax
+       mov     ax,0x16
+4:
+       mov     (_errno),ax
+       mov     ax,-1
+       cdq
+       ret
+
+ctch:
+       add     sp,4
+       callf   0xf:0x0
+
+.sect .bss
+table:
+       .space 40
+prev:
+       .space 4
+
diff --git a/mach/i386/libsys/stat.s b/mach/i386/libsys/stat.s
new file mode 100644 (file)
index 0000000..315a61a
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _stat
+.sect .text
+_stat:
+       mov     ax,18
+       jmp     sysx
diff --git a/mach/i386/libsys/stime.c b/mach/i386/libsys/stime.c
new file mode 100644 (file)
index 0000000..ce03130
--- /dev/null
@@ -0,0 +1,5 @@
+stime(p)
+       long *p;
+{
+       return _stime(*p);
+}
diff --git a/mach/i386/libsys/stty.c b/mach/i386/libsys/stty.c
new file mode 100644 (file)
index 0000000..84d37cc
--- /dev/null
@@ -0,0 +1,5 @@
+stty(fildes, arg)
+       char *arg;
+{
+       return ioctl(fildes, ('t' << 8) | 9, arg);
+}
diff --git a/mach/i386/libsys/sync.s b/mach/i386/libsys/sync.s
new file mode 100644 (file)
index 0000000..6d03a84
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _sync
+.sect .text
+_sync:
+       mov     ax,36
+       jmp     syscal
diff --git a/mach/i386/libsys/sys.s b/mach/i386/libsys/sys.s
new file mode 100644 (file)
index 0000000..167b037
--- /dev/null
@@ -0,0 +1,23 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define sysx, syscal, cerror, _errno
+
+.sect .bss
+       .comm   _errno, 4
+
+.sect .text
+
+syscal:
+       callf   0x7:0x0
+       jb      cerror
+       ret
+
+sysx:
+       callf   0x7:0x0
+       jb      cerror
+       xor     ax,ax
+       ret
+cerror:
+       mov     (_errno),ax
+       mov     ax,-1
+       ret
+
diff --git a/mach/i386/libsys/time.c b/mach/i386/libsys/time.c
new file mode 100644 (file)
index 0000000..600b941
--- /dev/null
@@ -0,0 +1,11 @@
+long _time();
+
+long
+time(p)
+       long *p;
+{
+       long l = _time();
+       if (p) *p = l;
+
+       return l;
+}
diff --git a/mach/i386/libsys/times.s b/mach/i386/libsys/times.s
new file mode 100644 (file)
index 0000000..9500cd3
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _times
+.sect .text
+_times:
+       mov     ax,43
+       jmp     syscal
diff --git a/mach/i386/libsys/ulimit.s b/mach/i386/libsys/ulimit.s
new file mode 100644 (file)
index 0000000..7de69a7
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ulimit
+.sect .text
+_ulimit:
+       mov     ax,63
+       jmp     syscal
diff --git a/mach/i386/libsys/umask.s b/mach/i386/libsys/umask.s
new file mode 100644 (file)
index 0000000..b1103ec
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _umask
+.sect .text
+_umask:
+       mov     ax,60
+       jmp     syscal
diff --git a/mach/i386/libsys/umount.s b/mach/i386/libsys/umount.s
new file mode 100644 (file)
index 0000000..37c34e1
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _umount
+.sect .text
+_umount:
+       mov     ax,22
+       jmp     sysx
diff --git a/mach/i386/libsys/uname.s b/mach/i386/libsys/uname.s
new file mode 100644 (file)
index 0000000..0ebeca4
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _uname
+.sect .text
+_uname:
+       mov     ax,57
+       jmp     syscal
diff --git a/mach/i386/libsys/unlink.s b/mach/i386/libsys/unlink.s
new file mode 100644 (file)
index 0000000..5c71222
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _unlink
+.sect .text
+_unlink:
+       mov     ax,10
+       jmp     sysx
diff --git a/mach/i386/libsys/utime.s b/mach/i386/libsys/utime.s
new file mode 100644 (file)
index 0000000..4c68d1b
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _utime
+.sect .text
+_utime:
+       mov     ax,30
+       jmp     sysx
diff --git a/mach/i386/libsys/wait.c b/mach/i386/libsys/wait.c
new file mode 100644 (file)
index 0000000..d8d01d7
--- /dev/null
@@ -0,0 +1,11 @@
+long _wait();
+
+wait(p)
+       int *p;
+{
+       long l = _wait();
+
+       if (l == -1) return -1;
+       if (p) *p = (l >> 16);
+       return l & 0xffff;
+}
diff --git a/mach/i386/libsys/write.s b/mach/i386/libsys/write.s
new file mode 100644 (file)
index 0000000..4a49555
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _write
+.sect .text
+_write:
+       mov     ax,4
+       jmp     syscal
diff --git a/mach/i386/libsys/xdup.s b/mach/i386/libsys/xdup.s
new file mode 100644 (file)
index 0000000..12d4488
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define ___xdup
+.sect .text
+___xdup:
+       mov     ax,41
+       jmp     syscal