Browse Source

initial version

ceriel 35 years ago
parent
commit
1273c73366
74 changed files with 719 additions and 0 deletions
  1. 5 0
      mach/i386/libsys/.distr
  2. 69 0
      mach/i386/libsys/LIST
  3. 28 0
      mach/i386/libsys/Makefile
  4. 2 0
      mach/i386/libsys/TODO
  5. 7 0
      mach/i386/libsys/_exit.s
  6. 12 0
      mach/i386/libsys/_pipe.s
  7. 6 0
      mach/i386/libsys/_profil.s
  8. 6 0
      mach/i386/libsys/_stime.s
  9. 6 0
      mach/i386/libsys/_time.s
  10. 12 0
      mach/i386/libsys/_wait.s
  11. 6 0
      mach/i386/libsys/access.s
  12. 6 0
      mach/i386/libsys/acct.s
  13. 6 0
      mach/i386/libsys/alarm.s
  14. 13 0
      mach/i386/libsys/brk.s
  15. 6 0
      mach/i386/libsys/chdir.s
  16. 6 0
      mach/i386/libsys/chmod.s
  17. 6 0
      mach/i386/libsys/chown.s
  18. 6 0
      mach/i386/libsys/chroot.s
  19. 1 0
      mach/i386/libsys/cleanup.c
  20. 6 0
      mach/i386/libsys/close.s
  21. 4 0
      mach/i386/libsys/compmodule
  22. 6 0
      mach/i386/libsys/creat.s
  23. 5 0
      mach/i386/libsys/dup.c
  24. 6 0
      mach/i386/libsys/dup2.c
  25. 9 0
      mach/i386/libsys/execl.c
  26. 10 0
      mach/i386/libsys/execle.c
  27. 8 0
      mach/i386/libsys/execv.c
  28. 7 0
      mach/i386/libsys/execve.s
  29. 5 0
      mach/i386/libsys/exit.c
  30. 6 0
      mach/i386/libsys/fcntl.s
  31. 18 0
      mach/i386/libsys/fork.s
  32. 6 0
      mach/i386/libsys/fstat.s
  33. 6 0
      mach/i386/libsys/ftime.s
  34. 11 0
      mach/i386/libsys/getegid.s
  35. 11 0
      mach/i386/libsys/geteuid.s
  36. 6 0
      mach/i386/libsys/getgid.s
  37. 10 0
      mach/i386/libsys/getpgrp.s
  38. 6 0
      mach/i386/libsys/getpid.s
  39. 11 0
      mach/i386/libsys/getppid.s
  40. 6 0
      mach/i386/libsys/getuid.s
  41. 5 0
      mach/i386/libsys/gtty.c
  42. 62 0
      mach/i386/libsys/head_em.s
  43. 6 0
      mach/i386/libsys/ioctl.s
  44. 6 0
      mach/i386/libsys/kill.s
  45. 6 0
      mach/i386/libsys/link.s
  46. 6 0
      mach/i386/libsys/lseek.s
  47. 6 0
      mach/i386/libsys/mknod.s
  48. 6 0
      mach/i386/libsys/mount.s
  49. 6 0
      mach/i386/libsys/nice.s
  50. 6 0
      mach/i386/libsys/open.s
  51. 6 0
      mach/i386/libsys/pause.s
  52. 14 0
      mach/i386/libsys/pipe.c
  53. 6 0
      mach/i386/libsys/profil.c
  54. 6 0
      mach/i386/libsys/read.s
  55. 29 0
      mach/i386/libsys/sbrk.s
  56. 6 0
      mach/i386/libsys/setgid.s
  57. 6 0
      mach/i386/libsys/setuid.s
  58. 38 0
      mach/i386/libsys/signal.s
  59. 6 0
      mach/i386/libsys/stat.s
  60. 5 0
      mach/i386/libsys/stime.c
  61. 5 0
      mach/i386/libsys/stty.c
  62. 6 0
      mach/i386/libsys/sync.s
  63. 23 0
      mach/i386/libsys/sys.s
  64. 11 0
      mach/i386/libsys/time.c
  65. 6 0
      mach/i386/libsys/times.s
  66. 6 0
      mach/i386/libsys/ulimit.s
  67. 6 0
      mach/i386/libsys/umask.s
  68. 6 0
      mach/i386/libsys/umount.s
  69. 6 0
      mach/i386/libsys/uname.s
  70. 6 0
      mach/i386/libsys/unlink.s
  71. 6 0
      mach/i386/libsys/utime.s
  72. 11 0
      mach/i386/libsys/wait.c
  73. 6 0
      mach/i386/libsys/write.s
  74. 6 0
      mach/i386/libsys/xdup.s

+ 5 - 0
mach/i386/libsys/.distr

@@ -0,0 +1,5 @@
+LIST
+Makefile
+compmodule
+head_em.s
+libmon_s.a

+ 69 - 0
mach/i386/libsys/LIST

@@ -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

+ 28 - 0
mach/i386/libsys/Makefile

@@ -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

+ 2 - 0
mach/i386/libsys/TODO

@@ -0,0 +1,2 @@
+This library is incomplete. Of some Xenix systemcalls the interface is
+not implemented.

+ 7 - 0
mach/i386/libsys/_exit.s

@@ -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

+ 12 - 0
mach/i386/libsys/_pipe.s

@@ -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

+ 6 - 0
mach/i386/libsys/_profil.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __profil
+.sect .text
+__profil:
+	mov	ax,44
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/_stime.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __stime
+.sect .text
+__stime:
+	mov	ax,25
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/_time.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __time
+.sect .text
+__time:
+	mov	ax,13
+	jmp	syscal

+ 12 - 0
mach/i386/libsys/_wait.s

@@ -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

+ 6 - 0
mach/i386/libsys/access.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _access
+.sect .text
+_access:
+	mov	ax,33
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/acct.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _acct
+.sect .text
+_acct:
+	mov	ax,51
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/alarm.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _alarm
+.sect .text
+_alarm:
+	mov	ax,27
+	jmp	syscal

+ 13 - 0
mach/i386/libsys/brk.s

@@ -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

+ 6 - 0
mach/i386/libsys/chdir.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chdir
+.sect .text
+_chdir:
+	mov	ax,12
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/chmod.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chmod
+.sect .text
+_chmod:
+	mov	ax,15
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/chown.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chown
+.sect .text
+_chown:
+	mov	ax,16
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/chroot.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _chroot
+.sect .text
+_chroot:
+	mov	ax,61
+	jmp	sysx

+ 1 - 0
mach/i386/libsys/cleanup.c

@@ -0,0 +1 @@
+_cleanup() { }

+ 6 - 0
mach/i386/libsys/close.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _close
+.sect .text
+_close:
+	mov	ax,6
+	jmp	sysx

+ 4 - 0
mach/i386/libsys/compmodule

@@ -0,0 +1,4 @@
+if i386 -c -L $1 1>&2
+then echo `basename $1 $2`.o
+else exit 1
+fi

+ 6 - 0
mach/i386/libsys/creat.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _creat
+.sect .text
+_creat:
+	mov	ax,8
+	jmp	syscal

+ 5 - 0
mach/i386/libsys/dup.c

@@ -0,0 +1,5 @@
+int
+dup(d)
+{
+	return __xdup(d, 0);
+}

+ 6 - 0
mach/i386/libsys/dup2.c

@@ -0,0 +1,6 @@
+int
+dup2(oldd, newd)
+{
+	oldd |= 64;
+	return __xdup(oldd, newd);
+}

+ 9 - 0
mach/i386/libsys/execl.c

@@ -0,0 +1,9 @@
+int
+execl(name,args)
+	char *name;
+	int args;
+{
+	extern char **environ;
+
+	return execve(name,&args,environ);
+}

+ 10 - 0
mach/i386/libsys/execle.c

@@ -0,0 +1,10 @@
+int
+execle(name,args)
+	char *name;
+	char *args;
+{
+	char **p = &args;
+	while (*p++) ;
+
+	return execve(name,&args,*p);
+}

+ 8 - 0
mach/i386/libsys/execv.c

@@ -0,0 +1,8 @@
+int
+execv(name,args)
+	char *name;
+	char **args;
+{
+	extern char **environ;
+	return execve(name,args,environ);
+}

+ 7 - 0
mach/i386/libsys/execve.s

@@ -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

+ 5 - 0
mach/i386/libsys/exit.c

@@ -0,0 +1,5 @@
+exit(n)
+{
+	_cleanup();
+	_exit(n);
+}

+ 6 - 0
mach/i386/libsys/fcntl.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _fcntl
+.sect .text
+_fcntl:
+	mov	ax,62
+	jmp	syscal

+ 18 - 0
mach/i386/libsys/fork.s

@@ -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

+ 6 - 0
mach/i386/libsys/fstat.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _fstat
+.sect .text
+_fstat:
+	mov	ax,28
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/ftime.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ftime
+.sect .text
+_ftime:
+	mov	ax,2856
+	jmp	syscal

+ 11 - 0
mach/i386/libsys/getegid.s

@@ -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

+ 11 - 0
mach/i386/libsys/geteuid.s

@@ -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

+ 6 - 0
mach/i386/libsys/getgid.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getgid
+.sect .text
+_getgid:
+	mov	ax,47
+	jmp	syscal

+ 10 - 0
mach/i386/libsys/getpgrp.s

@@ -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

+ 6 - 0
mach/i386/libsys/getpid.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getpid
+.sect .text
+_getpid:
+	mov	ax,20
+	jmp	syscal

+ 11 - 0
mach/i386/libsys/getppid.s

@@ -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

+ 6 - 0
mach/i386/libsys/getuid.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _getuid
+.sect .text
+_getuid:
+	mov	ax,24
+	jmp	syscal

+ 5 - 0
mach/i386/libsys/gtty.c

@@ -0,0 +1,5 @@
+gtty(fildes, arg)
+	char *arg;
+{
+	return ioctl(fildes, ('t' << 8) | 8, arg);
+}

+ 62 - 0
mach/i386/libsys/head_em.s

@@ -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:

+ 6 - 0
mach/i386/libsys/ioctl.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ioctl
+.sect .text
+_ioctl:
+	mov	ax,54
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/kill.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _kill
+.sect .text
+_kill:
+	mov	ax,37
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/link.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _link
+.sect .text
+_link:
+	mov	ax,9
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/lseek.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _lseek
+.sect .text
+_lseek:
+	mov	ax,19
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/mknod.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _mknod
+.sect .text
+_mknod:
+	mov	ax,14
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/mount.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _mount
+.sect .text
+_mount:
+	mov	ax,21
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/nice.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _nice
+.sect .text
+_nice:
+	mov	ax,34
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/open.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _open
+.sect .text
+_open:
+	mov	ax,5
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/pause.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _pause
+.sect .text
+_pause:
+	mov	ax,29
+	jmp	syscal

+ 14 - 0
mach/i386/libsys/pipe.c

@@ -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;
+}

+ 6 - 0
mach/i386/libsys/profil.c

@@ -0,0 +1,6 @@
+profil(buff, bufsiz, offset, scale)
+	char *buff;
+	int (*offset)();
+{
+	_profil(buff, bufsiz, offset, scale, 7262);
+}

+ 6 - 0
mach/i386/libsys/read.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _read
+.sect .text
+_read:
+	mov	ax,3
+	jmp	syscal

+ 29 - 0
mach/i386/libsys/sbrk.s

@@ -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

+ 6 - 0
mach/i386/libsys/setgid.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _setgid
+.sect .text
+_setgid:
+	mov	ax,46
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/setuid.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _setuid
+.sect .text
+_setuid:
+	mov	ax,23
+	jmp	sysx

+ 38 - 0
mach/i386/libsys/signal.s

@@ -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
+

+ 6 - 0
mach/i386/libsys/stat.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _stat
+.sect .text
+_stat:
+	mov	ax,18
+	jmp	sysx

+ 5 - 0
mach/i386/libsys/stime.c

@@ -0,0 +1,5 @@
+stime(p)
+	long *p;
+{
+	return _stime(*p);
+}

+ 5 - 0
mach/i386/libsys/stty.c

@@ -0,0 +1,5 @@
+stty(fildes, arg)
+	char *arg;
+{
+	return ioctl(fildes, ('t' << 8) | 9, arg);
+}

+ 6 - 0
mach/i386/libsys/sync.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _sync
+.sect .text
+_sync:
+	mov	ax,36
+	jmp	syscal

+ 23 - 0
mach/i386/libsys/sys.s

@@ -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
+

+ 11 - 0
mach/i386/libsys/time.c

@@ -0,0 +1,11 @@
+long _time();
+
+long
+time(p)
+	long *p;
+{
+	long l = _time();
+	if (p) *p = l;
+
+	return l;
+}

+ 6 - 0
mach/i386/libsys/times.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _times
+.sect .text
+_times:
+	mov	ax,43
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/ulimit.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _ulimit
+.sect .text
+_ulimit:
+	mov	ax,63
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/umask.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _umask
+.sect .text
+_umask:
+	mov	ax,60
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/umount.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _umount
+.sect .text
+_umount:
+	mov	ax,22
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/uname.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _uname
+.sect .text
+_uname:
+	mov	ax,57
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/unlink.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _unlink
+.sect .text
+_unlink:
+	mov	ax,10
+	jmp	sysx

+ 6 - 0
mach/i386/libsys/utime.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _utime
+.sect .text
+_utime:
+	mov	ax,30
+	jmp	sysx

+ 11 - 0
mach/i386/libsys/wait.c

@@ -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;
+}

+ 6 - 0
mach/i386/libsys/write.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _write
+.sect .text
+_write:
+	mov	ax,4
+	jmp	syscal

+ 6 - 0
mach/i386/libsys/xdup.s

@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define ___xdup
+.sect .text
+___xdup:
+	mov	ax,41
+	jmp	syscal