@@ -14,13 +14,6 @@ sdget.c
stime.c
time.c
wait.c
-_exit.s
-_pipe.s
-_profil.s
-_sdget.s
-_stime.s
-_time.s
-_wait.s
access.s
acct.s
alarm.s
@@ -85,4 +78,34 @@ ustat.s
utime.s
waitsem.s
write.s
+_Xpipe.s
+_Xwait.s
+_alarm.s
+_brk.s
+_close.s
+_dup2.c
+_execl.c
+_execve.s
+_exit.s
+_fork.s
+_fstat.s
+_ftime.s
+_getpid.s
+_gtty.c
+_ioctl.s
+_kill.s
+_link.s
+_lseek.s
+_open.s
+_pause.s
+_pipe.c
+_profil.s
+_read.s
+_sbrk.s
+_sdget.s
+_stime.s
+_time.s
+_unlink.s
+_wait.c
+_write.s
xdup.s
@@ -0,0 +1,13 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __Xpipe
+.sect .text
+__Xpipe:
+ mov ax,42
+ call syscal
+ mov dx,bx
+ jae 1f
+ mov (_errno),ax
+ mov ax,-1
+ cwd
+1:
+ ret
+.define __Xwait
+__Xwait:
+ mov ax,7
@@ -0,0 +1,11 @@
+.define __alarm
+__alarm:
+ mov ax,27
+ push bp
+ mov bp,sp
+ mov bx,4(bp)
+ pop bp
@@ -0,0 +1,6 @@
+.define __brk
+__brk:
+ mov ax,17
+ jmp sysal
+.define __close
+__close:
+ mov ax,6
+int
+_dup2(oldd, newd)
+{
+ oldd |= 64;
+ return __xdup(oldd, newd);
+}
@@ -0,0 +1,9 @@
+_execl(name,args)
+ char *name;
+ int args;
+ extern char **environ;
+
+ return _execve(name,&args,environ);
@@ -0,0 +1,19 @@
+.define __execve
+__execve:
+ mov ax,59
+ push si
+ mov si,8(bp)
+ mov cx,6(bp)
+ pop si
@@ -0,0 +1,20 @@
+.define __fork, _par_uid
+.sect .bss
+.comm _par_uid, 2
+__fork:
+ mov ax,2
+ jb 1f
+ and bx,bx
+ je 2f
+2:
+ mov (_par_uid),ax
+ xor ax,ax
+.define __fstat
+__fstat:
+ mov ax,28
@@ -0,0 +1,12 @@
+.define __ftime
+__ftime:
+ mov ax,2856
@@ -0,0 +1,7 @@
+.define __getpid
+__getpid:
+ mov ax,20
@@ -0,0 +1,5 @@
+_gtty(fildes, arg)
+ char *arg;
+ return _ioctl(fildes, ('t' << 8) | 8, arg);
+.define __ioctl
+__ioctl:
+ mov ax,54
+.define __kill
+__kill:
+ mov ax,37
+.define __link
+__link:
+ mov ax,9
@@ -0,0 +1,25 @@
+.define __lseek
+__lseek:
+ mov ax,19
+ push di
+ mov di,10(bp)
+ pop di
+ mov dx,ax
+.define __open
+__open:
+ mov ax,5
+.define __pause
+__pause:
+ mov ax,29
@@ -0,0 +1,14 @@
+long _Xpipe();
+_pipe(f)
+ int f[2];
+ long x;
+ x = _Xpipe();
+ if (x == -1) return -1;
+ f[0] = x;
+ f[1] = x >> 16;
+ return 0;
+.define __read
+__read:
+ mov ax,3
@@ -0,0 +1,22 @@
+.define __sbrk
+__sbrk:
+ push ds
+ mov ax,4(bp)
+ push dx
+ push ax
+ mov ax,1
+ call __brkctl
+ add sp,8
+__brkctl:
+ mov ax,4904
+.define __unlink
+__unlink:
+ mov ax,10
@@ -0,0 +1,10 @@
+long _Xwait();
+_wait(p)
+ int *p;
+ long l = _Xwait();
+ if (l == -1) return -1;
+ if (p) *p = (l >> 16);
+ return (int) l;
+.define __write
+__write:
+ mov ax,4
@@ -1,14 +1,6 @@
-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;
+ return _pipe(f);
}
@@ -1,11 +1,5 @@
-long _wait();
wait(p)
int *p;
- long l = _wait();
- if (l == -1) return -1;
- if (p) *p = (l >> 16);
- return (int) l;
+ return _wait(p);