Browse Source

Initial revision

ceriel 37 years ago
parent
commit
c2805a25bd
54 changed files with 671 additions and 0 deletions
  1. 52 0
      mach/i86/libsys/LIST
  2. 21 0
      mach/i86/libsys/Makefile
  3. 10 0
      mach/i86/libsys/_exit.s
  4. 13 0
      mach/i86/libsys/abort.s
  5. 9 0
      mach/i86/libsys/access.s
  6. 8 0
      mach/i86/libsys/alarm.s
  7. 39 0
      mach/i86/libsys/brk.s
  8. 9 0
      mach/i86/libsys/cerror.s
  9. 8 0
      mach/i86/libsys/chdir.s
  10. 8 0
      mach/i86/libsys/chmod.s
  11. 8 0
      mach/i86/libsys/chown.s
  12. 9 0
      mach/i86/libsys/cleanup.s
  13. 8 0
      mach/i86/libsys/close.s
  14. 4 0
      mach/i86/libsys/compmodule
  15. 7 0
      mach/i86/libsys/creat.s
  16. 8 0
      mach/i86/libsys/dup.s
  17. 7 0
      mach/i86/libsys/error.s
  18. 7 0
      mach/i86/libsys/exece.s
  19. 20 0
      mach/i86/libsys/execl.s
  20. 24 0
      mach/i86/libsys/execle.s
  21. 12 0
      mach/i86/libsys/execv.s
  22. 8 0
      mach/i86/libsys/execve.s
  23. 13 0
      mach/i86/libsys/exit.s
  24. 11 0
      mach/i86/libsys/fork.s
  25. 8 0
      mach/i86/libsys/fstat.s
  26. 8 0
      mach/i86/libsys/ftime.s
  27. 8 0
      mach/i86/libsys/getgid.s
  28. 8 0
      mach/i86/libsys/getpid.s
  29. 8 0
      mach/i86/libsys/getuid.s
  30. 15 0
      mach/i86/libsys/gtty.s
  31. 7 0
      mach/i86/libsys/ioctl.s
  32. 8 0
      mach/i86/libsys/kill.s
  33. 7 0
      mach/i86/libsys/link.s
  34. 7 0
      mach/i86/libsys/lseek.s
  35. 8 0
      mach/i86/libsys/mknod.s
  36. 8 0
      mach/i86/libsys/mount.s
  37. 8 0
      mach/i86/libsys/nice.s
  38. 7 0
      mach/i86/libsys/open.s
  39. 8 0
      mach/i86/libsys/pause.s
  40. 8 0
      mach/i86/libsys/pipe.s
  41. 8 0
      mach/i86/libsys/profil.s
  42. 7 0
      mach/i86/libsys/read.s
  43. 25 0
      mach/i86/libsys/sbrk.s
  44. 8 0
      mach/i86/libsys/setgid.s
  45. 8 0
      mach/i86/libsys/setuid.s
  46. 62 0
      mach/i86/libsys/signal.s
  47. 8 0
      mach/i86/libsys/stat.s
  48. 15 0
      mach/i86/libsys/stty.s
  49. 8 0
      mach/i86/libsys/sync.s
  50. 27 0
      mach/i86/libsys/time.s
  51. 9 0
      mach/i86/libsys/umount.s
  52. 8 0
      mach/i86/libsys/unlink.s
  53. 17 0
      mach/i86/libsys/wait.s
  54. 7 0
      mach/i86/libsys/write.s

+ 52 - 0
mach/i86/libsys/LIST

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

+ 21 - 0
mach/i86/libsys/Makefile

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

+ 10 - 0
mach/i86/libsys/_exit.s

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

+ 13 - 0
mach/i86/libsys/abort.s

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

+ 9 - 0
mach/i86/libsys/access.s

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

+ 8 - 0
mach/i86/libsys/alarm.s

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

+ 39 - 0
mach/i86/libsys/brk.s

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

+ 9 - 0
mach/i86/libsys/cerror.s

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

+ 8 - 0
mach/i86/libsys/chdir.s

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

+ 8 - 0
mach/i86/libsys/chmod.s

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

+ 8 - 0
mach/i86/libsys/chown.s

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

+ 9 - 0
mach/i86/libsys/cleanup.s

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

+ 8 - 0
mach/i86/libsys/close.s

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

+ 4 - 0
mach/i86/libsys/compmodule

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

+ 7 - 0
mach/i86/libsys/creat.s

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

+ 8 - 0
mach/i86/libsys/dup.s

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

+ 7 - 0
mach/i86/libsys/error.s

@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define _errno
+.extern _errno
+
+_errno:
+	.space 2
+.sect .text

+ 7 - 0
mach/i86/libsys/exece.s

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

+ 20 - 0
mach/i86/libsys/execl.s

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

+ 24 - 0
mach/i86/libsys/execle.s

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

+ 12 - 0
mach/i86/libsys/execv.s

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

+ 8 - 0
mach/i86/libsys/execve.s

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

+ 13 - 0
mach/i86/libsys/exit.s

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

+ 11 - 0
mach/i86/libsys/fork.s

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

+ 8 - 0
mach/i86/libsys/fstat.s

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

+ 8 - 0
mach/i86/libsys/ftime.s

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

+ 8 - 0
mach/i86/libsys/getgid.s

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

+ 8 - 0
mach/i86/libsys/getpid.s

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

+ 8 - 0
mach/i86/libsys/getuid.s

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

+ 15 - 0
mach/i86/libsys/gtty.s

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

+ 7 - 0
mach/i86/libsys/ioctl.s

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

+ 8 - 0
mach/i86/libsys/kill.s

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

+ 7 - 0
mach/i86/libsys/link.s

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

+ 7 - 0
mach/i86/libsys/lseek.s

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

+ 8 - 0
mach/i86/libsys/mknod.s

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

+ 8 - 0
mach/i86/libsys/mount.s

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

+ 8 - 0
mach/i86/libsys/nice.s

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

+ 7 - 0
mach/i86/libsys/open.s

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

+ 8 - 0
mach/i86/libsys/pause.s

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

+ 8 - 0
mach/i86/libsys/pipe.s

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

+ 8 - 0
mach/i86/libsys/profil.s

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

+ 7 - 0
mach/i86/libsys/read.s

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

+ 25 - 0
mach/i86/libsys/sbrk.s

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

+ 8 - 0
mach/i86/libsys/setgid.s

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

+ 8 - 0
mach/i86/libsys/setuid.s

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

+ 62 - 0
mach/i86/libsys/signal.s

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

+ 8 - 0
mach/i86/libsys/stat.s

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

+ 15 - 0
mach/i86/libsys/stty.s

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

+ 8 - 0
mach/i86/libsys/sync.s

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

+ 27 - 0
mach/i86/libsys/time.s

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

+ 9 - 0
mach/i86/libsys/umount.s

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

+ 8 - 0
mach/i86/libsys/unlink.s

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

+ 17 - 0
mach/i86/libsys/wait.s

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

+ 7 - 0
mach/i86/libsys/write.s

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