Initial revision
authorceriel <none@none>
Thu, 8 Jan 1987 10:41:08 +0000 (10:41 +0000)
committerceriel <none@none>
Thu, 8 Jan 1987 10:41:08 +0000 (10:41 +0000)
54 files changed:
mach/i86/libsys/LIST [new file with mode: 0644]
mach/i86/libsys/Makefile [new file with mode: 0644]
mach/i86/libsys/_exit.s [new file with mode: 0644]
mach/i86/libsys/abort.s [new file with mode: 0644]
mach/i86/libsys/access.s [new file with mode: 0644]
mach/i86/libsys/alarm.s [new file with mode: 0644]
mach/i86/libsys/brk.s [new file with mode: 0644]
mach/i86/libsys/cerror.s [new file with mode: 0644]
mach/i86/libsys/chdir.s [new file with mode: 0644]
mach/i86/libsys/chmod.s [new file with mode: 0644]
mach/i86/libsys/chown.s [new file with mode: 0644]
mach/i86/libsys/cleanup.s [new file with mode: 0644]
mach/i86/libsys/close.s [new file with mode: 0644]
mach/i86/libsys/compmodule [new file with mode: 0755]
mach/i86/libsys/creat.s [new file with mode: 0644]
mach/i86/libsys/dup.s [new file with mode: 0644]
mach/i86/libsys/error.s [new file with mode: 0644]
mach/i86/libsys/exece.s [new file with mode: 0644]
mach/i86/libsys/execl.s [new file with mode: 0644]
mach/i86/libsys/execle.s [new file with mode: 0644]
mach/i86/libsys/execv.s [new file with mode: 0644]
mach/i86/libsys/execve.s [new file with mode: 0644]
mach/i86/libsys/exit.s [new file with mode: 0644]
mach/i86/libsys/fork.s [new file with mode: 0644]
mach/i86/libsys/fstat.s [new file with mode: 0644]
mach/i86/libsys/ftime.s [new file with mode: 0644]
mach/i86/libsys/getgid.s [new file with mode: 0644]
mach/i86/libsys/getpid.s [new file with mode: 0644]
mach/i86/libsys/getuid.s [new file with mode: 0644]
mach/i86/libsys/gtty.s [new file with mode: 0644]
mach/i86/libsys/ioctl.s [new file with mode: 0644]
mach/i86/libsys/kill.s [new file with mode: 0644]
mach/i86/libsys/link.s [new file with mode: 0644]
mach/i86/libsys/lseek.s [new file with mode: 0644]
mach/i86/libsys/mknod.s [new file with mode: 0644]
mach/i86/libsys/mount.s [new file with mode: 0644]
mach/i86/libsys/nice.s [new file with mode: 0644]
mach/i86/libsys/open.s [new file with mode: 0644]
mach/i86/libsys/pause.s [new file with mode: 0644]
mach/i86/libsys/pipe.s [new file with mode: 0644]
mach/i86/libsys/profil.s [new file with mode: 0644]
mach/i86/libsys/read.s [new file with mode: 0644]
mach/i86/libsys/sbrk.s [new file with mode: 0644]
mach/i86/libsys/setgid.s [new file with mode: 0644]
mach/i86/libsys/setuid.s [new file with mode: 0644]
mach/i86/libsys/signal.s [new file with mode: 0644]
mach/i86/libsys/stat.s [new file with mode: 0644]
mach/i86/libsys/stty.s [new file with mode: 0644]
mach/i86/libsys/sync.s [new file with mode: 0644]
mach/i86/libsys/time.s [new file with mode: 0644]
mach/i86/libsys/umount.s [new file with mode: 0644]
mach/i86/libsys/unlink.s [new file with mode: 0644]
mach/i86/libsys/wait.s [new file with mode: 0644]
mach/i86/libsys/write.s [new file with mode: 0644]

diff --git a/mach/i86/libsys/LIST b/mach/i86/libsys/LIST
new file mode 100644 (file)
index 0000000..9012197
--- /dev/null
@@ -0,0 +1,52 @@
+tail_mon.a
+exit.s
+_exit.s
+abort.s
+access.s
+chdir.s
+chmod.s
+chown.s
+cleanup.s
+close.s
+creat.s
+dup.s
+execl.s
+execle.s
+execv.s
+execve.s
+time.s
+exece.s
+fork.s
+fstat.s
+getgid.s
+getpid.s
+getuid.s
+gtty.s
+stty.s
+ioctl.s
+kill.s
+link.s
+lseek.s
+mknod.s
+mount.s
+nice.s
+open.s
+pipe.s
+profil.s
+read.s
+sbrk.s
+brk.s
+setgid.s
+setuid.s
+signal.s
+stat.s
+sync.s
+umount.s
+unlink.s
+wait.s
+write.s
+cerror.s
+error.s
+pause.s
+alarm.s
+ftime.s
diff --git a/mach/i86/libsys/Makefile b/mach/i86/libsys/Makefile
new file mode 100644 (file)
index 0000000..2e2f712
--- /dev/null
@@ -0,0 +1,21 @@
+# $Header$
+MACH=l86
+all:           tail_mon
+install:       all
+               ../../install tail_mon
+
+cmp:           all
+               -../../compare tail_mon
+
+tail_mon:
+               ASAR=aal ; export ASAR ;\
+               march . tail_mon
+
+clean:
+               rm -f *.o
+
+opr :
+               make pr | opr
+
+pr:
+               @ar pv tail_mon.a
diff --git a/mach/i86/libsys/_exit.s b/mach/i86/libsys/_exit.s
new file mode 100644 (file)
index 0000000..0f138b8
--- /dev/null
@@ -0,0 +1,10 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __exit
+.sect .text
+__exit:
+       mov bx,sp
+       xor ax,ax
+       push ax ! unused memory
+       push 2(bx)
+       push ax ! dummy return address
+       int 0x81
diff --git a/mach/i86/libsys/abort.s b/mach/i86/libsys/abort.s
new file mode 100644 (file)
index 0000000..bd6d754
--- /dev/null
@@ -0,0 +1,13 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _abort
+.extern _abort
+_abort:        push    si
+       push    di
+       push    bp
+       mov     bp,sp
+       int     128
+       mov     sp,bp
+       pop     bp
+       pop     di
+       pop     si
+       ret
diff --git a/mach/i86/libsys/access.s b/mach/i86/libsys/access.s
new file mode 100644 (file)
index 0000000..f0059aa
--- /dev/null
@@ -0,0 +1,9 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _access
+.extern _access, cerror
+_access:       int 0xa1
+       jb 9f
+       xor ax,ax
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/alarm.s b/mach/i86/libsys/alarm.s
new file mode 100644 (file)
index 0000000..df92e89
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _alarm
+.extern _alarm, cerror
+_alarm:        int 0x9b
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/brk.s b/mach/i86/libsys/brk.s
new file mode 100644 (file)
index 0000000..0ddc587
--- /dev/null
@@ -0,0 +1,39 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _brk
+.define xbrk
+.define np
+.extern _brk
+.extern xbrk
+.extern np, cerror
+_brk:  
+       mov bx,sp
+       mov ax,2(bx)
+       mov cx,sp
+       sub cx,128
+       jbe 1f
+       mov bx,(np)
+       mov (np),ax
+       sub ax,bx
+       jbe 2f
+       call xbrk
+2:
+       xor ax,ax
+       ret
+1:
+       mov ax,0xc
+       jmp cerror
+xbrk:
+       push di
+       mov di,bx
+       mov cx,ax
+       xor ax,ax
+       shr cx,1
+       repz stos
+       jae 3f
+       stosb
+3:
+       pop di
+       ret
+.sect .data
+np: .data2 0
+.sect .text
diff --git a/mach/i86/libsys/cerror.s b/mach/i86/libsys/cerror.s
new file mode 100644 (file)
index 0000000..fad3993
--- /dev/null
@@ -0,0 +1,9 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define cerror
+.extern cerror
+.extern _errno
+cerror:
+       mov (_errno),ax
+       mov dx,-1
+       mov ax,dx
+       ret
diff --git a/mach/i86/libsys/chdir.s b/mach/i86/libsys/chdir.s
new file mode 100644 (file)
index 0000000..c5012f9
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _chdir
+.extern _chdir, cerror
+_chdir:        int 0x8c
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/chmod.s b/mach/i86/libsys/chmod.s
new file mode 100644 (file)
index 0000000..298babe
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _chmod
+.extern _chmod, cerror
+_chmod:        int 0x8f
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/chown.s b/mach/i86/libsys/chown.s
new file mode 100644 (file)
index 0000000..dc39ab6
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _chown
+.extern _chown, cerror
+_chown: int 0x90
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/cleanup.s b/mach/i86/libsys/cleanup.s
new file mode 100644 (file)
index 0000000..61db566
--- /dev/null
@@ -0,0 +1,9 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __cleanup
+.extern __cleanup
+__cleanup:
+       push    bp
+       mov     bp,sp
+mov sp,bp
+pop bp
+ret
diff --git a/mach/i86/libsys/close.s b/mach/i86/libsys/close.s
new file mode 100644 (file)
index 0000000..29e7b03
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _close
+.extern _close, cerror
+_close:        int 0x86
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/compmodule b/mach/i86/libsys/compmodule
new file mode 100755 (executable)
index 0000000..8ec2f67
--- /dev/null
@@ -0,0 +1,4 @@
+if i86 -c $1 1>&2
+then echo `basename $1 $2`.o
+else exit 1
+fi
diff --git a/mach/i86/libsys/creat.s b/mach/i86/libsys/creat.s
new file mode 100644 (file)
index 0000000..ababb86
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _creat
+.extern _creat, cerror
+_creat:        int 0x88
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/dup.s b/mach/i86/libsys/dup.s
new file mode 100644 (file)
index 0000000..d0e6ba0
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+
+.define _dup
+.extern _dup, cerror
+_dup:  int 0xc9
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/error.s b/mach/i86/libsys/error.s
new file mode 100644 (file)
index 0000000..ec32cc3
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _errno
+.extern _errno
+
+_errno:
+       .space 2
+.sect .text
diff --git a/mach/i86/libsys/exece.s b/mach/i86/libsys/exece.s
new file mode 100644 (file)
index 0000000..c2495ad
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _exece
+.extern _exece, cerror
+_exece:        int 0xdb
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/execl.s b/mach/i86/libsys/execl.s
new file mode 100644 (file)
index 0000000..9f2130f
--- /dev/null
@@ -0,0 +1,20 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+
+.define _execl
+.extern _execl, _environ, _execve
+_execl:
+       push    si
+       push    di
+       push    bp
+       mov     bp,sp
+       push    (_environ)
+       lea     ax,10(bp)
+       push    ax
+       push    8(bp)
+       call    _execve
+       add     sp,6
+       mov     sp,bp
+       pop     bp
+       pop     di
+       pop     si
+       ret
diff --git a/mach/i86/libsys/execle.s b/mach/i86/libsys/execle.s
new file mode 100644 (file)
index 0000000..bba5408
--- /dev/null
@@ -0,0 +1,24 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _execle
+.extern _execle, _execve
+_execle:
+       push    si
+       push    di
+       push    bp
+       mov     bp,sp
+       lea     si,10(bp)
+1:     mov     di,si
+       add     si,2
+       cmp     (di),0
+       jne     1b
+       push    (si)
+       lea     ax,10(bp)
+       push    ax
+       push    8(bp)
+       call    _execve
+       add     sp,6
+       mov     sp,bp
+       pop     bp
+       pop     di
+       pop     si
+       ret
diff --git a/mach/i86/libsys/execv.s b/mach/i86/libsys/execv.s
new file mode 100644 (file)
index 0000000..bbbc2e6
--- /dev/null
@@ -0,0 +1,12 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _execv
+.extern _execv, _environ, cerror
+_execv:
+       mov     bx,sp
+       push    (_environ)
+       push    4(bx)
+       push    2(bx)
+       push    ax
+       int     0xbb
+       add     sp,8
+       jmp     cerror
diff --git a/mach/i86/libsys/execve.s b/mach/i86/libsys/execve.s
new file mode 100644 (file)
index 0000000..964b6b9
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _execve
+.extern _execve, cerror
+_execve:
+       int 0x8b
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/exit.s b/mach/i86/libsys/exit.s
new file mode 100644 (file)
index 0000000..28cfca1
--- /dev/null
@@ -0,0 +1,13 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _exit
+.extern _exit, __cleanup, __exit
+_exit:
+       push    bp
+       mov     bp,sp
+call __cleanup
+push 4(bp)
+call __exit
+pop si
+mov sp,bp
+pop bp
+ret
diff --git a/mach/i86/libsys/fork.s b/mach/i86/libsys/fork.s
new file mode 100644 (file)
index 0000000..e280f58
--- /dev/null
@@ -0,0 +1,11 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _fork
+.extern _fork, cerror
+_fork: int 0x82
+       jmp 1f
+       jae 2f
+       jmp cerror
+1:
+       xor ax,ax
+2:
+       ret
diff --git a/mach/i86/libsys/fstat.s b/mach/i86/libsys/fstat.s
new file mode 100644 (file)
index 0000000..d7977f9
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _fstat
+.extern _fstat, cerror
+_fstat:        int 0x9c
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/ftime.s b/mach/i86/libsys/ftime.s
new file mode 100644 (file)
index 0000000..be3604f
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _ftime
+.extern _ftime, cerror
+_ftime:        int 0xa3
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/getgid.s b/mach/i86/libsys/getgid.s
new file mode 100644 (file)
index 0000000..dc769ae
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _getgid
+.extern _getgid, cerror
+_getgid:       int 0xaf
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/getpid.s b/mach/i86/libsys/getpid.s
new file mode 100644 (file)
index 0000000..8300a7a
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _getpid
+.extern _getpid, cerror
+_getpid:       int 0x94
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/getuid.s b/mach/i86/libsys/getuid.s
new file mode 100644 (file)
index 0000000..ff5d6fa
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _getuid
+.extern _getuid, cerror
+_getuid:       int 0x98
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/gtty.s b/mach/i86/libsys/gtty.s
new file mode 100644 (file)
index 0000000..4e8b0e6
--- /dev/null
@@ -0,0 +1,15 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _gtty
+.extern _gtty, _ioctl
+_gtty:
+       push    bp
+       mov     bp,sp
+push 6(bp)
+mov ax,29704
+push ax
+push 4(bp)
+call _ioctl
+add sp,6
+mov sp,bp
+pop bp
+ret
diff --git a/mach/i86/libsys/ioctl.s b/mach/i86/libsys/ioctl.s
new file mode 100644 (file)
index 0000000..b7e2427
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _ioctl
+.extern _ioctl, cerror
+_ioctl:        int 0xb6
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/kill.s b/mach/i86/libsys/kill.s
new file mode 100644 (file)
index 0000000..3c6ce52
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _kill
+.extern _kill, cerror
+_kill: int 0xa5
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/link.s b/mach/i86/libsys/link.s
new file mode 100644 (file)
index 0000000..0be0cf2
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _link
+.extern _link, cerror
+_link: int 0x89
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/lseek.s b/mach/i86/libsys/lseek.s
new file mode 100644 (file)
index 0000000..a54326b
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _lseek
+.extern _lseek, cerror
+_lseek:        int 0x93
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/mknod.s b/mach/i86/libsys/mknod.s
new file mode 100644 (file)
index 0000000..0d6aa3d
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _mknod
+.extern _mknod, cerror
+_mknod:        int 0x8e
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/mount.s b/mach/i86/libsys/mount.s
new file mode 100644 (file)
index 0000000..ad3e4b2
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _mount
+.extern _mount, cerror
+_mount:        int 0x95
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/nice.s b/mach/i86/libsys/nice.s
new file mode 100644 (file)
index 0000000..1e89774
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _nice
+.extern _nice, cerror
+_nice: int 0xa2
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/open.s b/mach/i86/libsys/open.s
new file mode 100644 (file)
index 0000000..2cf6df3
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _open
+.extern _open, cerror
+_open: int 0x85
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/pause.s b/mach/i86/libsys/pause.s
new file mode 100644 (file)
index 0000000..05a6fe7
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _pause
+.extern _pause, cerror
+_pause:        int 0x9d
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/pipe.s b/mach/i86/libsys/pipe.s
new file mode 100644 (file)
index 0000000..47865c8
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _pipe
+.extern _pipe, cerror
+_pipe: int 0xaa
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/profil.s b/mach/i86/libsys/profil.s
new file mode 100644 (file)
index 0000000..52e3b7f
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _profil
+.extern _profil, cerror
+_profil:       int 0xac
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/read.s b/mach/i86/libsys/read.s
new file mode 100644 (file)
index 0000000..a9839bf
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _read
+.extern _read, cerror
+_read: int 0x83
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/sbrk.s b/mach/i86/libsys/sbrk.s
new file mode 100644 (file)
index 0000000..b3b4e6a
--- /dev/null
@@ -0,0 +1,25 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _sbrk
+.extern _sbrk, xbrk, cerror
+_sbrk:
+push   bp
+mov    bp,sp
+mov    ax,4(bp)
+mov    bx,(np)
+add    ax,bx
+mov    cx,sp
+sub    cx,128
+sub    cx,ax
+jbe    1f
+mov    (np),ax
+sub    ax,bx
+jbe    2f
+call   xbrk
+2:
+mov    ax,bx
+pop    bp
+ret
+1:
+mov    ax,0xc
+pop    bp
+jmp    cerror
diff --git a/mach/i86/libsys/setgid.s b/mach/i86/libsys/setgid.s
new file mode 100644 (file)
index 0000000..52f9b11
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _setgid
+.extern _setgid, cerror
+setgid:        int 0xae
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/setuid.s b/mach/i86/libsys/setuid.s
new file mode 100644 (file)
index 0000000..e27c0fd
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _setuid
+.extern _setuid, cerror
+_setuid:       int 0x97
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/signal.s b/mach/i86/libsys/signal.s
new file mode 100644 (file)
index 0000000..cc23eb8
--- /dev/null
@@ -0,0 +1,62 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _signal
+.extern _signal, cerror
+NSIG=16
+_signal:       mov     bx,sp
+       mov cx,4(bx)
+       mov bx,2(bx)
+       cmp bx,NSIG
+       jae 1f
+       shl bx,1
+       mov dx,dvect(bx)
+       cmp cx,1
+       jbe 2f
+       mov dvect(bx),cx
+       mov bx,sp
+       mov 4(bx),enter
+       mov bx,dx
+       int 0xb0
+       mov dx,bx
+       mov bx,sp
+       mov 4(bx),cx
+       jb 3f
+       jmp 4f
+2:
+       int 0xb0
+       jb 3f
+       mov dvect(bx),cx
+4:
+       cmp ax,1
+       jbe 5f
+       mov ax,dx
+5:
+       ret
+1:
+       mov ax,22
+3:
+       jmp cerror
+
+enter:
+       push bx
+       push cx
+       push dx
+       push di
+       push si
+       mov bx,sp
+       mov di,10(bx)
+       mov 10(bx),ax
+       push di
+       shl di,1
+       call dvect(di)
+       add sp,2
+       pop si
+       pop di
+       pop dx
+       pop cx
+       pop bx
+       pop ax
+       popf
+       ret
+.sect .bss
+dvect: .space 2*NSIG
+.sect .text
diff --git a/mach/i86/libsys/stat.s b/mach/i86/libsys/stat.s
new file mode 100644 (file)
index 0000000..31153b4
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _stat
+.extern _stat, cerror
+_stat: int 0x92
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/stty.s b/mach/i86/libsys/stty.s
new file mode 100644 (file)
index 0000000..701bb18
--- /dev/null
@@ -0,0 +1,15 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _stty
+.extern _stty, _ioctl
+_stty:
+       push    bp
+       mov     bp,sp
+push 6(bp)
+mov ax,29705
+push ax
+push 4(bp)
+call _ioctl
+add sp,6
+mov sp,bp
+pop bp
+ret
diff --git a/mach/i86/libsys/sync.s b/mach/i86/libsys/sync.s
new file mode 100644 (file)
index 0000000..973cc27
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _sync
+.extern _sync, cerror
+_sync: int 0xa4
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/time.s b/mach/i86/libsys/time.s
new file mode 100644 (file)
index 0000000..ec87adb
--- /dev/null
@@ -0,0 +1,27 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _time
+.extern _time, _ftime
+_time:
+       push    si
+       push    di
+       push    bp
+       mov     bp,sp
+       sub     sp,10
+       lea     ax,-10(bp)
+       push    ax
+       call    _ftime
+       add     sp,2
+       cmp     8(bp),0
+       je      1f
+       mov     ax,-10(bp)
+       mov     dx,-8(bp)
+       mov     di,8(bp)
+       mov     (di),ax
+       mov     2(di),dx
+1:     mov     ax,-10(bp)
+       mov     dx,-8(bp)
+       mov     sp,bp
+       pop     bp
+       pop     di
+       pop     si
+       ret
diff --git a/mach/i86/libsys/umount.s b/mach/i86/libsys/umount.s
new file mode 100644 (file)
index 0000000..bee1815
--- /dev/null
@@ -0,0 +1,9 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _umount
+.extern _umount, cerror
+_umount:       int 0x96
+       jb 9f
+       xor ax,ax
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/unlink.s b/mach/i86/libsys/unlink.s
new file mode 100644 (file)
index 0000000..6d54599
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _unlink
+.extern _unlink, cerror
+_unlink:       int 0x8a
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/wait.s b/mach/i86/libsys/wait.s
new file mode 100644 (file)
index 0000000..ae27c3b
--- /dev/null
@@ -0,0 +1,17 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _wait
+.extern _wait, cerror
+_wait:
+       mov bx,sp
+       mov ax,2        ! void info about unused memory
+       ! Should be 0 according to /usr/include/sys.s, but
+       ! that doesn't work
+       push ax
+       push 2(bx)
+       push ax         ! dummy return address
+       int 0x87
+       jb 9f
+       add sp,6
+       ret
+9:     add sp,6
+       jmp cerror
diff --git a/mach/i86/libsys/write.s b/mach/i86/libsys/write.s
new file mode 100644 (file)
index 0000000..935d3ee
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _write
+.extern _write, cerror
+_write:        int 0x84
+       jb 9f
+       ret
+9: jmp cerror