From: ceriel Date: Tue, 19 Apr 1988 10:19:15 +0000 (+0000) Subject: Initial revision X-Git-Tag: release-5-5~3394 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=709fee14c67e6ffbd87b0dac889b6cdf46ece879;p=ack.git Initial revision --- diff --git a/mach/minix/.distr b/mach/minix/.distr new file mode 100644 index 000000000..f3273f12e --- /dev/null +++ b/mach/minix/.distr @@ -0,0 +1,6 @@ +Action +libm2 +liboc +libcc +libpc +libsys diff --git a/mach/minix/Action b/mach/minix/Action new file mode 100644 index 000000000..3996b33d5 --- /dev/null +++ b/mach/minix/Action @@ -0,0 +1,15 @@ +name "Minix PC C libraries" +dir libcc +end +name "Minix PC Pascal library" +dir libpc +end +name "Minix PC systemcall library" +dir libsys +end +name "Minix PC Occam library" +dir liboc +end +name "Minix PC Modula-2 library" +dir libm2 +end diff --git a/mach/minix/libsys/.distr b/mach/minix/libsys/.distr new file mode 100644 index 000000000..4e77ea92e --- /dev/null +++ b/mach/minix/libsys/.distr @@ -0,0 +1,7 @@ +LIST +Makefile +compmodule +head_em.s +end.s +lib.h +libsys_s.a diff --git a/mach/minix/libsys/LIST b/mach/minix/libsys/LIST new file mode 100644 index 000000000..48159c1c3 --- /dev/null +++ b/mach/minix/libsys/LIST @@ -0,0 +1,56 @@ +libsys_s.a +stty.c +gtty.c +access.c +alarm.c +brk.c +call.c +chdir.c +chmod.c +chown.c +chroot.c +close.c +creat.c +dup.c +dup2.c +exec.c +exit.c +cleanup.c +fork.c +fstat.c +getegid.c +geteuid.c +getgid.c +getpid.c +getuid.c +ioctl.c +kill.c +link.c +lseek.c +message.c +mknod.c +mktemp.c +mount.c +open.c +pause.c +pipe.c +read.c +setgid.c +setuid.c +signal.c +stat.c +stderr.c +stime.c +sync.c +syslib.c +time.c +times.c +umask.c +umount.c +unlink.c +utime.c +wait.c +write.c +brksize.s +sendrec.s +catchsig.s diff --git a/mach/minix/libsys/Makefile b/mach/minix/libsys/Makefile new file mode 100644 index 000000000..d3986485b --- /dev/null +++ b/mach/minix/libsys/Makefile @@ -0,0 +1,40 @@ +# $Header$ +MACH=minix + +all: libsys_o.a end.o head_em.o + +install: all + ../../install libsys_o.a tail_mon + ../../install head_em.o head_em + ../../install end.o end_em + +cmp: all + -../../compare libsys_o.a tail_mon + -../../compare head_em.o head_em + -../../compare end.o end_em + + +end.o: end.s + $(MACH) -I../../../h -O -c end.s + +head_em.o: head_em.s + $(MACH) -I../../../h -O -c head_em.s + +libsys.a: libsys_s.a + ASAR=aal ; export ASAR ;\ + march . libsys.a + +libsys_o.a: libsys.a ../../../lib/i86/tail_em + mkdir X; cd X; aal x ../libsys.a; aal x ../../../../lib/i86/tail_em; aal rv ../libsys_o.a *.o + rm -rf X + +clean: + rm -f *.o libsys_o.a libsys.a + +opr : + make pr | opr + +pr: + @pr `pwd`/head_em.s + @arch pv libsys.a | pr -h `pwd`/libsys.a + @pr `pwd`/end.s diff --git a/mach/minix/libsys/brksize.s b/mach/minix/libsys/brksize.s new file mode 100644 index 000000000..b03720c49 --- /dev/null +++ b/mach/minix/libsys/brksize.s @@ -0,0 +1,4 @@ +.define _brksize +.globl endbss, _brksize +.data +_brksize: .word endbss diff --git a/mach/minix/libsys/catchsig.s b/mach/minix/libsys/catchsig.s new file mode 100644 index 000000000..eb027ae3b --- /dev/null +++ b/mach/minix/libsys/catchsig.s @@ -0,0 +1,40 @@ +.define _begsig +.globl _begsig +.globl _vectab, _M +mtype = 2 | M+mtype = &M.m_type +_begsig: + push ax | after interrupt, save all regs + push bx + push cx + push dx + push si + push di + push bp + push ds + push es + mov bx,sp + mov bx,18(bx) | bx = signal number + mov ax,bx | ax = signal number + dec bx | vectab[0] is for sig 1 + add bx,bx | pointers are two bytes on 8088 + mov bx,_vectab(bx) | bx = address of routine to call + push _M+mtype | push status of last system call + push ax | func called with signal number as arg + call (bx) +back: + pop ax | get signal number off stack + pop _M+mtype | restore status of previous system call + pop es | signal handling finished + pop ds + pop bp + pop di + pop si + pop dx + pop cx + pop bx + pop ax + pop dummy | remove signal number from stack + iret + +.data +dummy: .word 0 diff --git a/mach/minix/libsys/compmodule b/mach/minix/libsys/compmodule new file mode 100755 index 000000000..b622ec57f --- /dev/null +++ b/mach/minix/libsys/compmodule @@ -0,0 +1,4 @@ +if minix -c -L -LIB $1 1>&2 +then echo `basename $1 $2`.o +else exit 1 +fi diff --git a/mach/minix/libsys/end.s b/mach/minix/libsys/end.s new file mode 100644 index 000000000..fcc993c40 --- /dev/null +++ b/mach/minix/libsys/end.s @@ -0,0 +1,10 @@ +.define endtext, enddata, endbss, _end, _edata +.globl endtext, enddata, endbss, _end, _edata +.text +endtext: +.data +enddata: +_edata: +.bss +endbss: +_end: diff --git a/mach/minix/libsys/head_em.s b/mach/minix/libsys/head_em.s new file mode 100644 index 000000000..31daf229b --- /dev/null +++ b/mach/minix/libsys/head_em.s @@ -0,0 +1,52 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss + +.define begtext,begdata,begbss +.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 +begtext: + mov bx,sp + mov cx,(bx) + add bx,2 + mov ax,cx + inc ax + shl ax,1 + add ax,bx + push ax + push bx + push cx + xor bp,bp + call _m_a_i_n + call _exit +.sect .data +begdata: +hol0: + .data2 0,0 + .data2 0,0 +argv: + .data2 3f +envp: + .data2 0 +3: + .asciz "PROGRAM" +.reghp: + .data2 endbss +.limhp: + .data2 endbss +.ignmask: + .data2 0 +.trppc: + .data2 0 + + .sect .bss +begbss: diff --git a/mach/minix/libsys/sendrec.s b/mach/minix/libsys/sendrec.s new file mode 100644 index 000000000..41478b3ba --- /dev/null +++ b/mach/minix/libsys/sendrec.s @@ -0,0 +1,32 @@ +.define _send, _receive, _sendrec +.globl _send, _receive, _sendrec +| See ../h/com.h for C definitions +SEND = 1 +RECEIVE = 2 +BOTH = 3 +SYSVEC = 32 + +|*========================================================================* +| send and receive * +|*========================================================================* +| send(), receive(), sendrec() all save bp, but destroy ax, bx, and cx. + +_send: mov cx,*SEND | send(dest, ptr) + jmp L0 + +_receive: + mov cx,*RECEIVE | receive(src, ptr) + jmp L0 + +_sendrec: + mov cx,*BOTH | sendrec(srcdest, ptr) + jmp L0 + + L0: push bp | save bp + mov bp,sp | can't index off sp + mov ax,4(bp) | ax = dest-src + mov bx,6(bp) | bx = message pointer + int SYSVEC | trap to the kernel + pop bp | restore bp + ret | return +