├── .circleci └── config.yml ├── .gitignore ├── Caldera-license.pdf ├── LICENSE ├── Makefile ├── README.md ├── bin ├── 1 ├── calendar ├── diff3 ├── false ├── lint ├── lookbib ├── lorder ├── man ├── nohup ├── pcc ├── plot ├── spell ├── struct └── true ├── etc ├── group ├── passwd ├── rc └── ttys ├── statement_regarding_Unix_3-7-17.pdf ├── tools ├── buildfs ├── cinit.lds ├── mkaout.py ├── mkfs.py ├── patterns.mk ├── tools.mk ├── v7-rpi.etc.rc ├── v7-rpi.proto └── v7-rpi.ttys └── usr ├── include ├── a.out.h ├── ar.h ├── assert.h ├── core.h ├── ctype.h ├── dk.h ├── dumprestor.h ├── errno.h ├── grp.h ├── ident.h ├── math.h ├── mp.h ├── olddump.h ├── pack.h ├── pwd.h ├── saio.h ├── setjmp.h ├── sgtty.h ├── signal.h ├── stdarg.h ├── stdio.h ├── stdlib.h ├── string.h ├── symbol.h ├── sys.s ├── sys │ ├── Makefile │ ├── acct.h │ ├── buf.h │ ├── conf.h │ ├── dir.h │ ├── fblk.h │ ├── file.h │ ├── filsys.h │ ├── ino.h │ ├── inode.h │ ├── param.h │ ├── proc.h │ ├── reg.h │ ├── stat.h │ ├── text.h │ ├── timeb.h │ ├── times.h │ ├── tty.h │ ├── types.h │ └── user.h ├── time.h ├── tp_defs.h ├── utmp.h ├── varargs.h └── whoami.h ├── lib ├── cign ├── crontab ├── eign ├── llib-lc ├── llib-lm ├── llib-port ├── units └── yaccpar ├── src ├── .clang-format ├── Makefile ├── cmd │ ├── .gitignore │ ├── Makefile │ ├── ac.c │ ├── accton.c │ ├── adb │ │ ├── access.c │ │ ├── command.c │ │ ├── defs.h │ │ ├── dummy.c │ │ ├── expr.c │ │ ├── findfn.c │ │ ├── format.c │ │ ├── input.c │ │ ├── mac.h │ │ ├── machine.h │ │ ├── main.c │ │ ├── makefile │ │ ├── message.c │ │ ├── mode.h │ │ ├── opset.c │ │ ├── output.c │ │ ├── pcs.c │ │ ├── print.c │ │ ├── runpcs.c │ │ ├── setup.c │ │ └── sym.c │ ├── ar.c │ ├── arcv.c │ ├── as │ │ ├── as11.s │ │ ├── as12.s │ │ ├── as13.s │ │ ├── as14.s │ │ ├── as15.s │ │ ├── as16.s │ │ ├── as17.s │ │ ├── as18.s │ │ ├── as19.s │ │ ├── as21.s │ │ ├── as22.s │ │ ├── as23.s │ │ ├── as24.s │ │ ├── as25.s │ │ ├── as26.s │ │ ├── as27.s │ │ ├── as28.s │ │ ├── as29.s │ │ └── makefile │ ├── at.c │ ├── atrun.c │ ├── awk │ │ ├── awk.def │ │ ├── awk.g.y │ │ ├── awk.lx.l │ │ ├── b.c │ │ ├── lib.c │ │ ├── main.c │ │ ├── makefile │ │ ├── parse.c │ │ ├── proc.c │ │ ├── run.c │ │ ├── token.c │ │ ├── tokenscript │ │ └── tran.c │ ├── bas │ │ ├── bas.s │ │ └── makefile │ ├── basename.c │ ├── bc.y │ ├── c │ │ ├── c0.h │ │ ├── c00.c │ │ ├── c01.c │ │ ├── c02.c │ │ ├── c03.c │ │ ├── c04.c │ │ ├── c05.c │ │ ├── c1.h │ │ ├── c10.c │ │ ├── c11.c │ │ ├── c12.c │ │ ├── c13.c │ │ ├── c2.h │ │ ├── c20.c │ │ ├── c21.c │ │ ├── cvopt.c │ │ ├── makefile │ │ └── table.s │ ├── cal.c │ ├── calendar.c │ ├── cat.c │ ├── cb.c │ ├── cc.c │ ├── checkeq.c │ ├── chgrp.c │ ├── chmod.c │ ├── chown.c │ ├── clri.c │ ├── cmake │ ├── cmp.c │ ├── col.c │ ├── comm.c │ ├── cp.c │ ├── cpp │ │ ├── README │ │ ├── cpp.c │ │ ├── cpy.y │ │ ├── makefile │ │ └── yylex.c │ ├── cron.c │ ├── crypt.c │ ├── cu.c │ ├── date.c │ ├── dc │ │ ├── Makefile │ │ ├── dc.c │ │ ├── dc.h │ │ └── makefile.v7 │ ├── dcheck.c │ ├── dd.c │ ├── deroff.c │ ├── df.c │ ├── diff.c │ ├── diff3.c │ ├── diffh.c │ ├── dmesg.c │ ├── du.c │ ├── dump.c │ ├── dumpdir.c │ ├── echo.c │ ├── ed.c │ ├── egrep.y │ ├── eqn │ │ ├── diacrit.c │ │ ├── e.h │ │ ├── e.y │ │ ├── eqnbox.c │ │ ├── font.c │ │ ├── fromto.c │ │ ├── funny.c │ │ ├── glob.c │ │ ├── integral.c │ │ ├── io.c │ │ ├── lex.c │ │ ├── lookup.c │ │ ├── makefile │ │ ├── mark.c │ │ ├── matrix.c │ │ ├── move.c │ │ ├── over.c │ │ ├── paren.c │ │ ├── pile.c │ │ ├── shift.c │ │ ├── size.c │ │ ├── sqrt.c │ │ └── text.c │ ├── expr.y │ ├── f77 │ │ ├── data.c │ │ ├── defines │ │ ├── defs │ │ ├── dmrdefs │ │ ├── drivedefs │ │ ├── driver.c │ │ ├── equiv.c │ │ ├── error.c │ │ ├── exec.c │ │ ├── expr.c │ │ ├── fio.h │ │ ├── ftypes │ │ ├── gram.dcl │ │ ├── gram.exec │ │ ├── gram.expr │ │ ├── gram.head │ │ ├── gram.io │ │ ├── init.c │ │ ├── intr.c │ │ ├── io.c │ │ ├── lex.c │ │ ├── locdefs │ │ ├── main.c │ │ ├── makefile │ │ ├── malloc.c │ │ ├── misc.c │ │ ├── pdp11.c │ │ ├── pdp11defs │ │ ├── pdp11x.c │ │ ├── proc.c │ │ ├── put.c │ │ ├── putdmr.c │ │ ├── putscj.c │ │ ├── scjdefs │ │ ├── tokdefs │ │ └── tokens │ ├── factor.s │ ├── fgrep.c │ ├── file.c │ ├── find.c │ ├── getty.c │ ├── graph.c │ ├── grep.c │ ├── icheck.c │ ├── in │ ├── init.c │ ├── iostat.c │ ├── join.c │ ├── kill.c │ ├── ld.c │ ├── learn │ │ ├── README │ │ ├── copy.c │ │ ├── dounit.c │ │ ├── lcount.c │ │ ├── learn.c │ │ ├── list.c │ │ ├── lrndef │ │ ├── lrnref │ │ ├── makefile │ │ ├── makpipe.c │ │ ├── maktee.c │ │ ├── mem.c │ │ ├── mysys.c │ │ ├── selsub.c │ │ ├── selunit.c │ │ ├── start.c │ │ ├── tee.c │ │ ├── whatnow.c │ │ └── wrapup.c │ ├── lex │ │ ├── Makefile │ │ ├── Makefile-native │ │ ├── header.c │ │ ├── ldefs.c │ │ ├── lib │ │ │ ├── Makefile │ │ │ ├── allprint.c │ │ │ ├── main.c │ │ │ ├── reject.c │ │ │ ├── yyless.c │ │ │ └── yywrap.c │ │ ├── lmain.c │ │ ├── makefile.v7 │ │ ├── once.c │ │ ├── parser.y │ │ ├── sub1.c │ │ └── sub2.c │ ├── lint │ │ ├── READ_ME │ │ ├── SHELL │ │ ├── lint.c │ │ ├── lmanifest │ │ ├── lpass2.c │ │ ├── macdefs │ │ └── makefile │ ├── ln.c │ ├── login.c │ ├── look.c │ ├── lpr │ │ ├── chrtab.c │ │ ├── daemon.c │ │ ├── daemon0.c │ │ ├── lpd.c │ │ ├── lpr.c │ │ ├── makefile │ │ └── spool.c │ ├── ls.c │ ├── m4 │ │ ├── m4.c │ │ ├── m4y.y │ │ └── makefile │ ├── mail.c │ ├── make │ │ ├── defs │ │ ├── doname.c │ │ ├── dosys.c │ │ ├── files.c │ │ ├── gram.y │ │ ├── ident.c │ │ ├── main.c │ │ ├── makefile │ │ └── misc.c │ ├── makeall │ ├── makekey.c │ ├── mesg.c │ ├── mip │ │ ├── INDEX │ │ ├── allo.c │ │ ├── cgram.y │ │ ├── comm1.c │ │ ├── common │ │ ├── convert │ │ ├── fallo.c │ │ ├── fcomm2.c │ │ ├── fconvert │ │ ├── flocal2.c │ │ ├── fmatch.c │ │ ├── forder.c │ │ ├── fort.c │ │ ├── freader.c │ │ ├── ftable.c │ │ ├── g │ │ ├── makefile │ │ ├── manifest │ │ ├── match.c │ │ ├── mfile1 │ │ ├── mfile2 │ │ ├── optim.c │ │ ├── pftn.c │ │ ├── reader.c │ │ ├── scan.c │ │ ├── trees.c │ │ └── xdefs.c │ ├── mkdir.c │ ├── mkfs.c │ ├── mknod.c │ ├── mount.c │ ├── mv.c │ ├── ncheck.c │ ├── neqn │ │ ├── diacrit.c │ │ ├── e.h │ │ ├── e.y │ │ ├── eqnbox.c │ │ ├── font.c │ │ ├── fromto.c │ │ ├── funny.c │ │ ├── glob.c │ │ ├── integral.c │ │ ├── io.c │ │ ├── lex.c │ │ ├── lookup.c │ │ ├── makefile │ │ ├── mark.c │ │ ├── matrix.c │ │ ├── move.c │ │ ├── over.c │ │ ├── paren.c │ │ ├── pile.c │ │ ├── shift.c │ │ ├── size.c │ │ ├── sqrt.c │ │ └── text.c │ ├── newgrp.c │ ├── nice.c │ ├── nm.c │ ├── od.c │ ├── osh.c │ ├── passwd.c │ ├── pcc │ │ ├── INDEX │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── mac2defs │ │ ├── macdefs │ │ ├── makefile │ │ ├── order.c │ │ └── table.c │ ├── plot │ │ ├── chrtab.c │ │ ├── driver.c │ │ ├── makefile │ │ └── vplot.c │ ├── pr.c │ ├── prep.h │ ├── prep │ │ ├── makefile │ │ ├── prep.h │ │ ├── prep0.c │ │ ├── prep1.c │ │ └── prep2.c │ ├── primes.s │ ├── prof.c │ ├── ps.c │ ├── pstat.c │ ├── ptx.c │ ├── pwd.c │ ├── quot.c │ ├── random.c │ ├── ranlib.c │ ├── ratfor │ │ ├── makefile │ │ ├── r.g │ │ ├── r.h │ │ ├── r0.c │ │ ├── r1.c │ │ ├── r2.c │ │ ├── rio.c │ │ ├── rlex.c │ │ └── rlook.c │ ├── refer │ │ ├── deliv1.c │ │ ├── deliv2.c │ │ ├── flagger.c │ │ ├── glue1.c │ │ ├── glue2.c │ │ ├── glue3.c │ │ ├── glue4.c │ │ ├── glue5.c │ │ ├── hunt1.c │ │ ├── hunt2.c │ │ ├── hunt3.c │ │ ├── hunt5.c │ │ ├── hunt6.c │ │ ├── hunt7.c │ │ ├── hunt8.c │ │ ├── hunt9.c │ │ ├── inv1.c │ │ ├── inv2.c │ │ ├── inv3.c │ │ ├── inv5.c │ │ ├── inv6.c │ │ ├── kaiser.c │ │ ├── makefile │ │ ├── mkey1.c │ │ ├── mkey2.c │ │ ├── mkey3.c │ │ ├── refer..c │ │ ├── refer0.c │ │ ├── refer1.c │ │ ├── refer2.c │ │ ├── refer3.c │ │ ├── refer4.c │ │ ├── refer5.c │ │ ├── refer6.c │ │ ├── refer7.c │ │ ├── refer8.c │ │ ├── shell.c │ │ ├── test │ │ ├── thash.c │ │ ├── types.c │ │ ├── what..c │ │ ├── what1.c │ │ ├── what2.c │ │ ├── what3.c │ │ └── what4.c │ ├── restor.c │ ├── rev.c │ ├── rm.c │ ├── rmdir.c │ ├── roff │ │ ├── makefile │ │ ├── roff1.s │ │ ├── roff2.s │ │ ├── roff3.s │ │ ├── roff4.s │ │ ├── roff5.s │ │ ├── roff7.s │ │ └── roff8.s │ ├── sa.c │ ├── sed │ │ ├── Makefile │ │ ├── makefile.v7 │ │ ├── sed.h │ │ ├── sed0.c │ │ └── sed1.c │ ├── sh │ │ ├── Makefile │ │ ├── args.c │ │ ├── blok.c │ │ ├── brkincr.h │ │ ├── builtin.c │ │ ├── cmd.c │ │ ├── ctype.c │ │ ├── ctype.h │ │ ├── defs.h │ │ ├── dup.h │ │ ├── error.c │ │ ├── expand.c │ │ ├── fault.c │ │ ├── io.c │ │ ├── mac.h │ │ ├── macro.c │ │ ├── main.c │ │ ├── makefile.v7 │ │ ├── mode.h │ │ ├── msg.c │ │ ├── name.c │ │ ├── name.h │ │ ├── print.c │ │ ├── service.c │ │ ├── setbrk.c │ │ ├── stak.c │ │ ├── stak.h │ │ ├── string.c │ │ ├── sym.h │ │ ├── timeout.h │ │ ├── word.c │ │ └── xec.c │ ├── size.c │ ├── sleep.c │ ├── sort.c │ ├── sp.c │ ├── spell │ │ ├── american │ │ ├── british │ │ ├── local │ │ ├── makefile │ │ ├── spell.c │ │ ├── spell.h │ │ ├── spellin.c │ │ ├── spellout.c │ │ └── stop │ ├── spline.c │ ├── split.c │ ├── standalone │ │ ├── M.s │ │ ├── SYS.c │ │ ├── boot.c │ │ ├── cat.c │ │ ├── cc+ld-stand │ │ ├── conf.c │ │ ├── contents │ │ ├── cpgroup │ │ ├── hp.c │ │ ├── ht.c │ │ ├── makefile │ │ ├── maketape.c │ │ ├── mtboot.s │ │ ├── prf.c │ │ ├── rk.c │ │ ├── rkcontents │ │ ├── rktapedir │ │ ├── rp.c │ │ ├── saio.h │ │ ├── srt0.s │ │ ├── tapedir │ │ └── tm.c │ ├── strip.c │ ├── struct │ │ ├── 0.alloc.c │ │ ├── 0.args.c │ │ ├── 0.def.c │ │ ├── 0.extr.c │ │ ├── 0.graph.c │ │ ├── 0.list.c │ │ ├── 0.parts.c │ │ ├── 0.string.c │ │ ├── 1.defs.h │ │ ├── 1.finish.c │ │ ├── 1.form.c │ │ ├── 1.fort.c │ │ ├── 1.hash.c │ │ ├── 1.incl.h │ │ ├── 1.init.c │ │ ├── 1.line.c │ │ ├── 1.main.c │ │ ├── 1.node.c │ │ ├── 1.recog.c │ │ ├── 1.tables.c │ │ ├── 2.def.h │ │ ├── 2.dfs.c │ │ ├── 2.dom.c │ │ ├── 2.head.c │ │ ├── 2.inarc.c │ │ ├── 2.main.c │ │ ├── 2.test.c │ │ ├── 2.tree.c │ │ ├── 3.branch.c │ │ ├── 3.def.h │ │ ├── 3.flow.c │ │ ├── 3.loop.c │ │ ├── 3.main.c │ │ ├── 3.reach.c │ │ ├── 3.test.c │ │ ├── 3.then.c │ │ ├── 4.brace.c │ │ ├── 4.def.h │ │ ├── 4.form.c │ │ ├── 4.main.c │ │ ├── 4.out.c │ │ ├── b.h │ │ ├── bdef.c │ │ ├── beauty.y │ │ ├── def.h │ │ ├── lextab.l │ │ ├── main.c │ │ ├── makefile │ │ └── tree.c │ ├── stty.c │ ├── su.c │ ├── sum.c │ ├── sync.c │ ├── tabs.c │ ├── tail.c │ ├── tar │ │ ├── makefile │ │ └── tar.c │ ├── tbl │ │ ├── makefile │ │ ├── t..c │ │ ├── t0.c │ │ ├── t1.c │ │ ├── t2.c │ │ ├── t3.c │ │ ├── t4.c │ │ ├── t5.c │ │ ├── t6.c │ │ ├── t7.c │ │ ├── t8.c │ │ ├── t9.c │ │ ├── tb.c │ │ ├── tc.c │ │ ├── te.c │ │ ├── tf.c │ │ ├── tg.c │ │ ├── ti.c │ │ ├── tm.c │ │ ├── ts.c │ │ ├── tt.c │ │ ├── tu.c │ │ └── tv.c │ ├── tc.c │ ├── tee.c │ ├── test.c │ ├── time.c │ ├── tk.c │ ├── touch.c │ ├── tp │ │ ├── makefile │ │ ├── tp.h │ │ ├── tp0.c │ │ ├── tp1.c │ │ ├── tp2.c │ │ └── tp3.c │ ├── tr.c │ ├── troff │ │ ├── README │ │ ├── d.h │ │ ├── font │ │ │ ├── chars.c │ │ │ ├── ftB.c │ │ │ ├── ftBC.c │ │ │ ├── ftC.c │ │ │ ├── ftCE.c │ │ │ ├── ftCI.c │ │ │ ├── ftCK.c │ │ │ ├── ftCS.c │ │ │ ├── ftCW.c │ │ │ ├── ftG.c │ │ │ ├── ftGI.c │ │ │ ├── ftGM.c │ │ │ ├── ftGR.c │ │ │ ├── ftI.c │ │ │ ├── ftL.c │ │ │ ├── ftLI.c │ │ │ ├── ftPA.c │ │ │ ├── ftPB.c │ │ │ ├── ftPI.c │ │ │ ├── ftR.c │ │ │ ├── ftS.c │ │ │ ├── ftSB.c │ │ │ ├── ftSI.c │ │ │ ├── ftSM.c │ │ │ ├── ftUD.c │ │ │ ├── ftXM.c │ │ │ ├── linkrc │ │ │ ├── makefile │ │ │ ├── mkfont.c │ │ │ └── mkfont1.c │ │ ├── hytab.c │ │ ├── makefile │ │ ├── n1.c │ │ ├── n10.c │ │ ├── n2.c │ │ ├── n3.c │ │ ├── n4.c │ │ ├── n5.c │ │ ├── n6.c │ │ ├── n7.c │ │ ├── n8.c │ │ ├── n9.c │ │ ├── ni.c │ │ ├── nii.c │ │ ├── nmake │ │ ├── ntab.c │ │ ├── s.h │ │ ├── suftab.c │ │ ├── t10.c │ │ ├── t6.c │ │ ├── tab3.c │ │ ├── tdef.h │ │ ├── term │ │ │ ├── code.300 │ │ │ ├── makefile │ │ │ ├── tab300-12.c │ │ │ ├── tab300.c │ │ │ ├── tab300s-12.c │ │ │ ├── tab300s.c │ │ │ ├── tab37.c │ │ │ ├── tab450-12-8.c │ │ │ ├── tab450-12.c │ │ │ ├── tab450.c │ │ │ ├── tab832.c │ │ │ ├── taba1.c │ │ │ ├── tablp.c │ │ │ └── tabtn300.c │ │ ├── textscript │ │ ├── tmake │ │ ├── tw.h │ │ └── v.h │ ├── tsort.c │ ├── tty.c │ ├── umount.c │ ├── uniq.c │ ├── units.c │ ├── update.c │ ├── uucp │ │ ├── anlwrk.c │ │ ├── chkpth.c │ │ ├── cico.c │ │ ├── cntrl.c │ │ ├── conn.c │ │ ├── cpmv.c │ │ ├── expfile.c │ │ ├── gename.c │ │ ├── getargs.c │ │ ├── getprm.c │ │ ├── getpwinfo.c │ │ ├── gio.c │ │ ├── gnamef.c │ │ ├── gnsys.c │ │ ├── gnxseq.c │ │ ├── gwd.c │ │ ├── imsg.c │ │ ├── index.c │ │ ├── ioctl.c │ │ ├── lastpart.c │ │ ├── logent.c │ │ ├── makefile │ │ ├── pk0.c │ │ ├── pk1.c │ │ ├── pkon.c │ │ ├── prefix.c │ │ ├── sdmail.c │ │ ├── shio.c │ │ ├── sysacct.c │ │ ├── systat.c │ │ ├── ulockf.c │ │ ├── uuclean.c │ │ ├── uucp.c │ │ ├── uucp.h │ │ ├── uucpdefs.h │ │ ├── uulog.c │ │ ├── uurecover.c │ │ ├── uux.c │ │ ├── uuxqt.c │ │ ├── versys.c │ │ └── xqt.c │ ├── vpr.c │ ├── wall.c │ ├── wc.c │ ├── who.c │ ├── write.c │ ├── xsend │ │ ├── enroll.c │ │ ├── lib.c │ │ ├── makefile │ │ ├── xget.c │ │ ├── xmail.h │ │ └── xsend.c │ ├── yacc │ │ ├── Makefile │ │ ├── Makefile-native │ │ ├── dextern │ │ ├── files │ │ ├── makefile.v7 │ │ ├── y1.c │ │ ├── y2.c │ │ ├── y3.c │ │ └── y4.c │ └── yes.c ├── games │ ├── arithmetic.c │ ├── backgammon.c │ ├── chess │ │ ├── README │ │ ├── agen.c │ │ ├── att.s │ │ ├── bgen.s │ │ ├── bheur.c │ │ ├── bmove.s │ │ ├── book.c │ │ ├── bplay.c │ │ ├── ctrl.s │ │ ├── data.c │ │ ├── init.c │ │ ├── io.c │ │ ├── makefile │ │ ├── mater.c │ │ ├── old.h │ │ ├── pio.c │ │ ├── play.c │ │ ├── qsort.s │ │ ├── savres.c │ │ ├── setup.c │ │ ├── stat.c │ │ ├── stdin.c │ │ ├── wgen.s │ │ ├── wheur.c │ │ ├── wmove.s │ │ └── wplay.c │ ├── fish.c │ ├── fortune.c │ ├── hangman.c │ ├── quiz.c │ └── wump.c ├── libF77 │ ├── Makefile │ ├── abort_.c │ ├── c_abs.c │ ├── c_cos.c │ ├── c_div.c │ ├── c_exp.c │ ├── c_log.c │ ├── c_sin.c │ ├── c_sqrt.c │ ├── cabs.c │ ├── compall │ ├── complex │ ├── d_abs.c │ ├── d_acos.c │ ├── d_asin.c │ ├── d_atan.c │ ├── d_atn2.c │ ├── d_cnjg.c │ ├── d_cos.c │ ├── d_cosh.c │ ├── d_dim.c │ ├── d_exp.c │ ├── d_imag.c │ ├── d_int.c │ ├── d_lg10.c │ ├── d_log.c │ ├── d_mod.c │ ├── d_nint.c │ ├── d_prod.c │ ├── d_sign.c │ ├── d_sin.c │ ├── d_sinh.c │ ├── d_sqrt.c │ ├── d_tan.c │ ├── d_tanh.c │ ├── getarg_.c │ ├── h_abs.c │ ├── h_dim.c │ ├── h_dnnt.c │ ├── h_indx.c │ ├── h_len.c │ ├── h_mod.c │ ├── h_nint.c │ ├── h_sign.c │ ├── hl_ge.c │ ├── hl_gt.c │ ├── hl_le.c │ ├── hl_lt.c │ ├── i_abs.c │ ├── i_dim.c │ ├── i_dnnt.c │ ├── i_indx.c │ ├── i_len.c │ ├── i_mod.c │ ├── i_nint.c │ ├── i_sign.c │ ├── iargc_.c │ ├── l_ge.c │ ├── l_gt.c │ ├── l_le.c │ ├── l_lt.c │ ├── main.c │ ├── mklib │ ├── pow_ci.c │ ├── pow_dd.c │ ├── pow_di.c │ ├── pow_hh.c │ ├── pow_ii.c │ ├── pow_ri.c │ ├── pow_zi.c │ ├── pow_zz.c │ ├── r_abs.c │ ├── r_acos.c │ ├── r_asin.c │ ├── r_atan.c │ ├── r_atn2.c │ ├── r_cnjg.c │ ├── r_cos.c │ ├── r_cosh.c │ ├── r_dim.c │ ├── r_exp.c │ ├── r_imag.c │ ├── r_int.c │ ├── r_lg10.c │ ├── r_log.c │ ├── r_mod.c │ ├── r_nint.c │ ├── r_sign.c │ ├── r_sin.c │ ├── r_sinh.c │ ├── r_sqrt.c │ ├── r_tan.c │ ├── r_tanh.c │ ├── s_cat.c │ ├── s_cmp.c │ ├── s_copy.c │ ├── s_paus.c │ ├── s_rnge.c │ ├── s_stop.c │ ├── signal_.c │ ├── z_abs.c │ ├── z_cos.c │ ├── z_div.c │ ├── z_exp.c │ ├── z_log.c │ ├── z_sin.c │ └── z_sqrt.c ├── libI77 │ ├── backspace.c │ ├── close.c │ ├── compall │ ├── dballoc.c │ ├── dfe.c │ ├── due.c │ ├── endfile.c │ ├── err.c │ ├── fio.h │ ├── fmt.c │ ├── fmt.h │ ├── fmtlib.c │ ├── iio.c │ ├── inquire.c │ ├── lib.c │ ├── lio.c │ ├── lio.h │ ├── lread.c │ ├── mklib │ ├── open.c │ ├── rdfmt.c │ ├── rewind.c │ ├── rsfe.c │ ├── sfe.c │ ├── sue.c │ ├── uio.c │ ├── util.c │ ├── wrtfmt.c │ └── wsfe.c ├── libc │ ├── Makefile │ ├── compall │ ├── crt │ │ ├── aldiv.s │ │ ├── almul.s │ │ ├── alrem.s │ │ ├── armv6k │ │ │ ├── __aeabi_idiv0.c │ │ │ ├── aeabi_idivmod.S │ │ │ ├── aeabi_uidivmod.S │ │ │ ├── aeabi_uldivmod.S │ │ │ ├── cerror.s │ │ │ ├── divmodsi4.S │ │ │ ├── divsi3.S │ │ │ ├── int_endianness.h │ │ │ ├── int_lib.h │ │ │ ├── int_types.h │ │ │ ├── int_util.h │ │ │ ├── rtassembly.h │ │ │ ├── udivmoddi4.c │ │ │ ├── udivmodsi4.S │ │ │ └── udivsi3.S │ │ ├── cerror.s │ │ ├── csv.s │ │ ├── ldiv.s │ │ ├── lmul.s │ │ ├── lrem.s │ │ └── mcount.s │ ├── csu │ │ ├── armv6k │ │ │ └── crt0.s │ │ ├── crt0.s │ │ ├── fcrt0.s │ │ ├── fmcrt0.s │ │ └── mcrt0.s │ ├── gen │ │ ├── abort.s │ │ ├── abs.c │ │ ├── armv6k │ │ │ ├── abort.c │ │ │ ├── cuexit.s │ │ │ ├── l3.c │ │ │ ├── ldexp.c │ │ │ ├── memcpy.c │ │ │ └── setjmp.s │ │ ├── atof.c │ │ ├── atoi.c │ │ ├── atol.c │ │ ├── calloc.c │ │ ├── crypt.c │ │ ├── ctime.c │ │ ├── ctype_.c │ │ ├── cuexit.s │ │ ├── ecvt.c │ │ ├── errlst.c │ │ ├── execvp.c │ │ ├── fakcu.s │ │ ├── fakfp.s │ │ ├── frexp11.s │ │ ├── getenv.c │ │ ├── getlogin.c │ │ ├── index.c │ │ ├── isatty.c │ │ ├── l3.c │ │ ├── ldexp11.s │ │ ├── ldfps.s │ │ ├── malloc.c │ │ ├── mktemp.c │ │ ├── modf11.s │ │ ├── mon.c │ │ ├── nlist.c │ │ ├── perror.c │ │ ├── pkon.c │ │ ├── qsort.c │ │ ├── rand.c │ │ ├── rindex.c │ │ ├── setjmp.s │ │ ├── sleep.c │ │ ├── strcat.c │ │ ├── strcmp.c │ │ ├── strcpy.c │ │ ├── strlen.c │ │ ├── strncat.c │ │ ├── strncmp.c │ │ ├── strncpy.c │ │ ├── stty.c │ │ ├── swab.c │ │ ├── tell.c │ │ ├── timezone.c │ │ ├── ttyname.c │ │ └── ttyslot.c │ ├── mklib │ ├── stdio │ │ ├── armv6k │ │ │ ├── doprnt.c │ │ │ ├── fprintf.c │ │ │ ├── printf.c │ │ │ └── sprintf.c │ │ ├── clrerr.c │ │ ├── data.c │ │ ├── doprnt.s │ │ ├── doscan.c │ │ ├── endopen.c │ │ ├── fdopen.c │ │ ├── ffltpr.s │ │ ├── fgetc.c │ │ ├── fgets.c │ │ ├── filbuf.c │ │ ├── findiop.c │ │ ├── flsbuf.c │ │ ├── fltpr.s │ │ ├── fopen.c │ │ ├── fprintf.c │ │ ├── fputc.c │ │ ├── fputs.c │ │ ├── freopen.c │ │ ├── fseek.c │ │ ├── ftell.c │ │ ├── gcvt.c │ │ ├── getchar.c │ │ ├── getgrent.c │ │ ├── getgrgid.c │ │ ├── getgrnam.c │ │ ├── getpass.c │ │ ├── getpw.c │ │ ├── getpwent.c │ │ ├── getpwnam.c │ │ ├── getpwuid.c │ │ ├── gets.c │ │ ├── getw.c │ │ ├── popen.c │ │ ├── printf.c │ │ ├── putchar.c │ │ ├── puts.c │ │ ├── putw.c │ │ ├── rdwr.c │ │ ├── rew.c │ │ ├── scanf.c │ │ ├── setbuf.c │ │ ├── sprintf.c │ │ ├── strout.c │ │ ├── system.c │ │ └── ungetc.c │ ├── sys │ │ ├── access.s │ │ ├── acct.s │ │ ├── alarm.s │ │ ├── armv6k │ │ │ ├── access.s │ │ │ ├── acct.s │ │ │ ├── alarm.s │ │ │ ├── chdir.s │ │ │ ├── chmod.s │ │ │ ├── chown.s │ │ │ ├── chroot.s │ │ │ ├── close.s │ │ │ ├── creat.s │ │ │ ├── dup.s │ │ │ ├── execl.s │ │ │ ├── execle.s │ │ │ ├── execv.s │ │ │ ├── execve.s │ │ │ ├── exit.s │ │ │ ├── fork.s │ │ │ ├── fstat.s │ │ │ ├── getgid.s │ │ │ ├── getpid.s │ │ │ ├── getuid.s │ │ │ ├── ioctl.s │ │ │ ├── kill.s │ │ │ ├── link.s │ │ │ ├── lock.s │ │ │ ├── lseek.s │ │ │ ├── mknod.s │ │ │ ├── mount.s │ │ │ ├── nice.s │ │ │ ├── open.s │ │ │ ├── pause.s │ │ │ ├── phys.s │ │ │ ├── pipe.s │ │ │ ├── profil.s │ │ │ ├── ptrace.s │ │ │ ├── read.s │ │ │ ├── sbrk.s │ │ │ ├── setgid.s │ │ │ ├── setuid.s │ │ │ ├── signal.s │ │ │ ├── stat.s │ │ │ ├── stime.s │ │ │ ├── sync.s │ │ │ ├── time.s │ │ │ ├── times.s │ │ │ ├── umask.s │ │ │ ├── umount.s │ │ │ ├── unlink.s │ │ │ ├── utime.s │ │ │ ├── wait.s │ │ │ └── write.s │ │ ├── chdir.s │ │ ├── chmod.s │ │ ├── chown.s │ │ ├── chroot.s │ │ ├── close.s │ │ ├── creat.s │ │ ├── dup.s │ │ ├── execl.s │ │ ├── execle.s │ │ ├── execv.s │ │ ├── execve.s │ │ ├── exit.s │ │ ├── fork.s │ │ ├── fstat.s │ │ ├── getgid.s │ │ ├── getpid.s │ │ ├── getuid.s │ │ ├── ioctl.s │ │ ├── kill.s │ │ ├── link.s │ │ ├── lock.s │ │ ├── lseek.s │ │ ├── mknod.s │ │ ├── mount.s │ │ ├── mpxcall.s │ │ ├── nice.s │ │ ├── open.s │ │ ├── pause.s │ │ ├── phys.s │ │ ├── pipe.s │ │ ├── profil.s │ │ ├── ptrace.s │ │ ├── read.s │ │ ├── sbrk.s │ │ ├── setgid.s │ │ ├── setuid.s │ │ ├── signal.s │ │ ├── stat.s │ │ ├── stime.s │ │ ├── sync.s │ │ ├── time.s │ │ ├── times.s │ │ ├── umask.s │ │ ├── umount.s │ │ ├── unlink.s │ │ ├── utime.s │ │ ├── wait.s │ │ └── write.s │ └── v6 │ │ ├── access.c │ │ ├── chown.c │ │ ├── execl.c │ │ ├── ftime.c │ │ ├── gtty.c │ │ ├── lseek.c │ │ ├── stat.c │ │ ├── syscall.s │ │ └── time.s ├── libdbm │ ├── compall │ ├── dbm.c │ ├── dbm.h │ └── mklib ├── libfpsim │ ├── compall │ ├── fp1.s │ ├── fp2.s │ ├── fp3.s │ ├── fpx.s │ └── mklib ├── libm │ ├── asin.c │ ├── atan.c │ ├── compall │ ├── exp.c │ ├── fabs.c │ ├── floor.c │ ├── hypot.c │ ├── j0.c │ ├── j1.c │ ├── jn.c │ ├── log.c │ ├── mklib │ ├── pow.c │ ├── sin.c │ ├── sinh.c │ ├── sqrt.c │ ├── tan.c │ └── tanh.c ├── libmp │ ├── Makefile │ ├── compall │ ├── gcd.c │ ├── madd.c │ ├── mdiv.c │ ├── mklib │ ├── mout.c │ ├── msqrt.c │ ├── mult.c │ ├── pow.c │ └── util.c └── libplot │ ├── con.h │ └── makefile └── sys ├── 40 ├── README ├── m40.s └── param.h ├── .clang-format ├── .vscode ├── c_cpp_properties.json ├── settings.json └── tasks.json ├── Makefile ├── bcm283x ├── arm1176jzfs.h ├── arm1176jzfs.s ├── bcm283x_machdep.c ├── bcm283x_machdep.h ├── conf │ └── bcm283x_conf.c ├── dev │ ├── arasan_sd.c │ ├── arasan_sd_regs.h │ ├── bcm283x_gpio.c │ ├── bcm283x_gpio.h │ ├── bcm283x_io.c │ ├── bcm283x_io.h │ ├── bcm283x_irq.c │ ├── bcm283x_irq.h │ ├── bcm283x_mbox.c │ ├── bcm283x_mbox.h │ ├── bcm283x_pl011.c │ ├── bcm283x_pl011.h │ ├── bcm283x_systimer.c │ ├── bcm283x_systimer.h │ ├── bcm283x_systimer_regs.h │ ├── sd_cmd.h │ ├── sd_io.c │ ├── sd_io.h │ └── sdx.c ├── exception.s ├── gdb-commands-debug-sh.txt ├── gdb-commands-lowlevel-startup.txt ├── gdb-commands.txt ├── kstddef.h ├── mkstartcode ├── page_tables.c ├── page_tables.h ├── pi1unix.lds ├── rt │ ├── aeabi_idivmod.S │ ├── aeabi_uidivmod.S │ ├── aeabi_uldivmod.S │ ├── divmodsi4.S │ ├── divsi3.S │ ├── int_endianness.h │ ├── int_lib.h │ ├── int_types.h │ ├── int_util.h │ ├── rtassembly.h │ ├── udivmoddi4.c │ ├── udivmodsi4.S │ └── udivsi3.S ├── startcode.lds ├── startcode.s ├── startup.s ├── trap.h ├── trap_dabt.s ├── trap_exit.s ├── trap_irq.s ├── trap_pabt.s ├── trap_swi.s ├── trap_und.s ├── traps.c ├── udot.c ├── undefined.c ├── undefined.h ├── vfp.c ├── vfp.h └── vfp_asm.s ├── conf ├── c.c ├── hphtconf ├── hptmconf ├── l.s ├── makefile ├── mch.s ├── mch0.s ├── mkconf.c ├── rkhtconf ├── rktmconf ├── rp1conf ├── rphtconf ├── rptmconf └── tconf ├── dev ├── mem.c └── sys.c ├── h ├── acct.h ├── alloc.h ├── bio.h ├── buf.h ├── callo.h ├── clock.h ├── conf.h ├── dir.h ├── fblk.h ├── file.h ├── filsys.h ├── fio.h ├── iget.h ├── ino.h ├── inode.h ├── machdep.h ├── malloc.h ├── map.h ├── mount.h ├── nami.h ├── param.h ├── partab.h ├── pipe.h ├── prf.h ├── prim.h ├── proc.h ├── rdwri.h ├── reg.h ├── seg.h ├── sig.h ├── slp.h ├── stat.h ├── subr.h ├── sys1.h ├── systm.h ├── text.h ├── timeb.h ├── tty.h ├── types.h ├── ureg.h └── user.h └── sys ├── acct.c ├── alloc.c ├── bio.c ├── clock.c ├── fio.c ├── iget.c ├── machdep.c ├── main.c ├── malloc.c ├── nami.c ├── partab.c ├── pipe.c ├── prf.c ├── prim.c ├── rdwri.c ├── sig.c ├── slp.c ├── subr.c ├── sys1.c ├── sys2.c ├── sys3.c ├── sys4.c ├── sysent.c ├── text.c ├── trap.c ├── tty.c └── ureg.c /Caldera-license.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r1mikey/research-unix-v7/8cf6645a513d0b7f0dc38e52d5184bf6249e95b9/Caldera-license.pdf -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = usr/include/sys \ 2 | usr/src \ 3 | usr/sys 4 | 5 | all: 6 | @for __SD in $(SUBDIRS); do $(MAKE) -C $${__SD} all; done 7 | 8 | clean: 9 | @for __SD in $(SUBDIRS); do $(MAKE) -C $${__SD} clean; done 10 | 11 | tools/abc.fs: all 12 | (sync && cd tools && ./buildfs && sync) 13 | 14 | fsimg: tools/abc.fs 15 | 16 | tools/sd.img: tools/abc.fs 17 | dd if=tools/abc.fs of=tools/sd.img bs=512 seek=96256 conv=notrunc 18 | sync 19 | 20 | sdimg: tools/sd.img 21 | 22 | run: tools/sd.img 23 | $(MAKE) -C usr/sys run 24 | -------------------------------------------------------------------------------- /bin/1: -------------------------------------------------------------------------------- 1 | case $# in 2 | 3 | 0) 4 | if random -e 1.1 5 | then 6 | echo one bell system - it works 7 | elif random -e 1.1 8 | then 9 | /usr/games/fortune 10 | else 1;1;1;1;1;1;1;1;1;1 11 | fi 12 | ;; 13 | 14 | *) 15 | echo one $* - it works 16 | 17 | esac 18 | -------------------------------------------------------------------------------- /bin/calendar: -------------------------------------------------------------------------------- 1 | PATH=/bin:/usr/bin 2 | tmp=/tmp/cal$$ 3 | trap "rm $tmp; exit" 0 1 2 13 15 4 | /usr/lib/calendar >$tmp 5 | case $1 in 6 | -) 7 | sed ' 8 | s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ 9 | ' /etc/passwd \ 10 | | while read x 11 | do 12 | eval $x 13 | if test -r $y/calendar; then 14 | egrep -f $tmp $y/calendar 2>/dev/null | mail $z 15 | fi 16 | done;; 17 | *) 18 | egrep -f $tmp calendar 19 | esac 20 | -------------------------------------------------------------------------------- /bin/diff3: -------------------------------------------------------------------------------- 1 | e= 2 | case $1 in 3 | -*) 4 | e=$1 5 | shift;; 6 | esac 7 | if test $# = 3 -a -f $1 -a -f $2 -a -f $3 8 | then 9 | : 10 | else 11 | echo usage: diff3 file1 file2 file3 1>&2 12 | exit 13 | fi 14 | trap "rm -f /tmp/d3[ab]$$" 0 1 2 13 15 15 | diff $1 $3 >/tmp/d3a$$ 16 | diff $2 $3 >/tmp/d3b$$ 17 | /usr/lib/diff3 $e /tmp/d3[ab]$$ $1 $2 $3 18 | -------------------------------------------------------------------------------- /bin/false: -------------------------------------------------------------------------------- 1 | exit 1 2 | -------------------------------------------------------------------------------- /bin/lint: -------------------------------------------------------------------------------- 1 | L=/usr/lib/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix 2 | LL=/usr/lib 3 | trap "rm -f $T; exit" 1 2 15 4 | for A in $* 5 | do 6 | case $A in 7 | -*n*) P= ;; 8 | -*p*) P=port ;; 9 | esac 10 | case $A in 11 | -l*) (/lib/cpp $O $LL/llib$A | ${L}1 -v$X-L$A >>$T)2>&1 ;; 12 | -[IDOU]*) O="$O $A" ;; 13 | -X) LL=/usr/scj/lint L=/usr/scj/lint/lpass ;; 14 | -*) X="$X$A" ;; 15 | *) (/lib/cpp $O $A | ${L}1 $X-L$A >>$T)2>&1 16 | esac 17 | done 18 | case $P in 19 | unix) (/lib/cpp $O $LL/llib-lc | ${L}1 -v$X-L-lc >>$T)2>&1 ;; 20 | port) (/lib/cpp $O $LL/llib-port | ${L}1 -v$X-L-lc >>$T)2>&1 ;; 21 | esac 22 | sort -u $T | ${L}2 $X 23 | rm -f $T 24 | -------------------------------------------------------------------------------- /bin/lookbib: -------------------------------------------------------------------------------- 1 | A= 2 | case $1 in 3 | -p) A="$1 $2" 4 | shift; shift;; 5 | -*) A=$1 6 | shift;; 7 | esac 8 | case $1 in 9 | -p) A="$A $1 $2" 10 | shift; shift;; 11 | -*) A="$A $1" 12 | shift;; 13 | esac 14 | if test $1x = x 15 | then /usr/lib/refer/mkey -s 16 | else echo $* | /usr/lib/refer/mkey -s 17 | fi | /usr/lib/refer/hunt $A /usr/dict/papers/Ind 18 | -------------------------------------------------------------------------------- /bin/lorder: -------------------------------------------------------------------------------- 1 | trap "rm -f $$sym?ef; exit" 0 1 2 13 15 2 | case $# in 3 | 0) echo usage: lorder file ... 4 | exit ;; 5 | 1) case $1 in 6 | *.o) set $1 $1 7 | esac 8 | esac 9 | nm -g $* | sed ' 10 | /^$/d 11 | /:$/{ 12 | /\.o:/!d 13 | s/:// 14 | h 15 | s/.*/& &/ 16 | p 17 | d 18 | } 19 | /[TD] /{ 20 | s/.* // 21 | G 22 | s/\n/ / 23 | w '$$symdef' 24 | d 25 | } 26 | s/.* // 27 | G 28 | s/\n/ / 29 | w '$$symref' 30 | d 31 | ' 32 | sort $$symdef -o $$symdef 33 | sort $$symref -o $$symref 34 | join $$symref $$symdef | sed 's/[^ ]* *//' 35 | -------------------------------------------------------------------------------- /bin/nohup: -------------------------------------------------------------------------------- 1 | trap "" 1 15 2 | if test -t 2>&1 ; then 3 | echo "Sending output to 'nohup.out'" 4 | exec nice -5 $* >>nohup.out 2>&1 5 | else 6 | exec nice -5 $* 2>&1 7 | fi 8 | -------------------------------------------------------------------------------- /bin/plot: -------------------------------------------------------------------------------- 1 | PATH=/bin:/usr/bin 2 | case $1 in 3 | -T*) t=$1 4 | shift ;; 5 | *) t=-T$TERM 6 | esac 7 | case $t in 8 | -T450) exec t450 $*;; 9 | -T300) exec t300 $*;; 10 | -T300S|-T300s) exec t300s $*;; 11 | -Tver) exec vplot $*;; 12 | -Ttek|-T4014|-T) exec tek $* ;; 13 | *) echo plot: terminal type $t not known 1>&2; exit 1 14 | esac 15 | -------------------------------------------------------------------------------- /bin/spell: -------------------------------------------------------------------------------- 1 | : B flags, D dictionary, F files, H history, S stop, V data for -v 2 | H=${H-/usr/dict/spellhist} 3 | T=/tmp/spell.$$ 4 | V=/dev/null 5 | F= B= 6 | trap "rm -f $T*; exit" 0 1 2 13 15 7 | for A in $* 8 | do 9 | case $A in 10 | -v) B="$B -v" 11 | V=${T}a ;; 12 | -a) ;; 13 | -b) D=${D-/usr/dict/hlistb} 14 | B="$B -b" ;; 15 | *) F="$F $A" 16 | esac 17 | done 18 | deroff -w $F |\ 19 | sort -u |\ 20 | /usr/lib/spell ${S-/usr/dict/hstop} $T |\ 21 | /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\ 22 | sort -u +0f +0 - $T |\ 23 | tee -a $H 24 | who am i >>$H 2>/dev/null 25 | case $V in 26 | /dev/null) exit 27 | esac 28 | sed '/^\./d' $V | sort -u +1f +0 29 | -------------------------------------------------------------------------------- /bin/struct: -------------------------------------------------------------------------------- 1 | trap "rm -f /tmp/struct*$$" 0 1 2 3 13 15 2 | files=no 3 | for i 4 | do 5 | case $i in 6 | -*) ;; 7 | *) files=yes 8 | esac 9 | done 10 | 11 | case $files in 12 | yes) 13 | /usr/lib/struct/structure $* >/tmp/struct$$ 14 | ;; 15 | no) 16 | cat >/tmp/structin$$ 17 | /usr/lib/struct/structure /tmp/structin$$ $* >/tmp/struct$$ 18 | esac && 19 | /usr/lib/struct/beautify/dev/console 5 | rm /etc/mtab 6 | cat /dev/null >/etc/utmp 7 | /etc/mount /dev/rp3 /usr 8 | rm -f /usr/spool/lpd/lock 9 | : /etc/accton /usr/adm/acct 10 | rm -f /usr/tmp/* 11 | rm -f /tmp/* 12 | /etc/update 13 | date >/dev/console 14 | /etc/cron 15 | -------------------------------------------------------------------------------- /etc/ttys: -------------------------------------------------------------------------------- 1 | 14console 2 | 00tty00 3 | 00tty01 4 | 00tty02 5 | 00tty03 6 | 00tty04 7 | 00tty05 8 | 00tty06 9 | 00tty07 10 | 00tty08 11 | 00tty09 12 | 00tty10 13 | 00tty11 14 | 00tty12 15 | 00tty13 16 | 00tty14 17 | 00tty15 18 | 00tty16 19 | 00tty17 20 | 00tty18 21 | 00tty19 22 | 00tty20 23 | 00tty21 24 | 00tty22 25 | 00tty23 26 | 00tty24 27 | 00tty25 28 | 00tty26 29 | 00tty27 30 | 00tty28 31 | 00tty29 32 | 00tty30 33 | 00tty31 34 | -------------------------------------------------------------------------------- /statement_regarding_Unix_3-7-17.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r1mikey/research-unix-v7/8cf6645a513d0b7f0dc38e52d5184bf6249e95b9/statement_regarding_Unix_3-7-17.pdf -------------------------------------------------------------------------------- /tools/buildfs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cat /dev/null > tmp.v7.etc.ddate 4 | ./mkfs.py v7-rpi.proto abc.fs 5 | rm -f tmp.v7.etc.ddate 6 | 7 | # ./mkfs.py && sync && dd if=abc.fs of=sd.img bs=512 seek=96256 conv=notrunc && sync 8 | -------------------------------------------------------------------------------- /tools/cinit.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm") 2 | ENTRY(_start) 3 | 4 | SECTIONS 5 | { 6 | .text . : AT (0) { 7 | _stext = .; 8 | crt0.o(.text) 9 | *(.text) 10 | *(.text*) 11 | *(.glue_7) 12 | *(.glue_7t) 13 | _etext = .; 14 | } 15 | 16 | .data BLOCK(0x1000) : { 17 | _sdata = .; 18 | *(.rodata) 19 | *(.rodata*) 20 | *(.data) 21 | *(.data*) 22 | _edata = .; 23 | } 24 | 25 | .bss : { 26 | __bss_start = .; 27 | *(.bss) 28 | *(.bss*) 29 | *(COMMON) 30 | __bss_end = .; 31 | _ebss = .; 32 | } 33 | 34 | _end = .; 35 | } 36 | -------------------------------------------------------------------------------- /tools/patterns.mk: -------------------------------------------------------------------------------- 1 | %.elf: %.o 2 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) 3 | 4 | %.bin: %.elf 5 | $(OBJCOPY) -O binary --only-section=.text --only-section=.data $^ $@ 6 | 7 | %.aout: %.bin %.elf 8 | $(MKAOUT) $* $(shell $(SIZE) $(word 2, $^) | tail -1 | awk '{ printf "%d %d %d", $$1, $$2, $$3; }') 9 | 10 | clean: 11 | $(RM) *.aout *.elf *.bin *.o *.a *.lst *.native $(GENERATED_SOURCES) 12 | @for __SD in $(SUBDIRS); do $(MAKE) -C $${__SD} clean; done 13 | -------------------------------------------------------------------------------- /tools/v7-rpi.etc.rc: -------------------------------------------------------------------------------- 1 | PATH=/bin:/usr/bin 2 | echo "Restricted rights: Use, duplication, or disclosure 3 | is subject to restrictions stated in your contract with 4 | Western Electric Company, Inc." >/dev/console 5 | rm /etc/mtab 6 | cat /dev/null >/etc/utmp 7 | ##x /etc/mount /dev/rp3 /usr 8 | rm -f /usr/spool/lpd/lock 9 | : /etc/accton /usr/adm/acct 10 | rm -f /usr/tmp/* 11 | rm -f /tmp/* 12 | /etc/update 13 | date >/dev/console 14 | /etc/cron 15 | -------------------------------------------------------------------------------- /tools/v7-rpi.ttys: -------------------------------------------------------------------------------- 1 | 1pconsole 2 | 00tty00 3 | 00tty01 4 | 00tty02 5 | 00tty03 6 | 00tty04 7 | 00tty05 8 | 00tty06 9 | 00tty07 10 | 00tty08 11 | 00tty09 12 | 00tty10 13 | 00tty11 14 | 00tty12 15 | 00tty13 16 | 00tty14 17 | 00tty15 18 | 00tty16 19 | 00tty17 20 | 00tty18 21 | 00tty19 22 | 00tty20 23 | 00tty21 24 | 00tty22 25 | 00tty23 26 | 00tty24 27 | 00tty25 28 | 00tty26 29 | 00tty27 30 | 00tty28 31 | 00tty29 32 | 00tty30 33 | 00tty31 34 | -------------------------------------------------------------------------------- /usr/include/ar.h: -------------------------------------------------------------------------------- 1 | #define ARMAG 0177545 2 | struct ar_hdr { 3 | char ar_name[14]; 4 | long ar_date; 5 | char ar_uid; 6 | char ar_gid; 7 | short ar_mode; 8 | long ar_size; 9 | }; 10 | -------------------------------------------------------------------------------- /usr/include/assert.h: -------------------------------------------------------------------------------- 1 | # ifndef NDEBUG 2 | # define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} 3 | # define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} 4 | # else 5 | # define _assert(ex) ; 6 | # define assert(ex) ; 7 | # endif 8 | -------------------------------------------------------------------------------- /usr/include/core.h: -------------------------------------------------------------------------------- 1 | /* machine dependent stuff for core files */ 2 | #define TXTRNDSIZ 4196L 3 | #define stacktop(siz) (0x60000000L) 4 | #define stackbas(siz) (0x60000000L-siz) 5 | -------------------------------------------------------------------------------- /usr/include/dumprestor.h: -------------------------------------------------------------------------------- 1 | #define NTREC 20 2 | #define MLEN 16 3 | #define MSIZ 4096 4 | 5 | #define TS_TAPE 1 6 | #define TS_INODE 2 7 | #define TS_BITS 3 8 | #define TS_ADDR 4 9 | #define TS_END 5 10 | #define TS_CLRI 6 11 | #define MAGIC (int)60011 12 | #define CHECKSUM (int)84446 13 | struct spcl 14 | { 15 | short c_type; 16 | time_t c_date; 17 | time_t c_ddate; 18 | short c_volume; 19 | daddr_t c_tapea; 20 | ino_t c_inumber; 21 | short c_magic; 22 | short c_checksum; 23 | struct dinode c_dinode; 24 | short c_count; 25 | char c_addr[BSIZE]; 26 | } spcl; 27 | 28 | struct idates 29 | { 30 | char id_name[16]; 31 | char id_incno; 32 | time_t id_ddate; 33 | }; 34 | -------------------------------------------------------------------------------- /usr/include/grp.h: -------------------------------------------------------------------------------- 1 | struct group { /* see getgrent(3) */ 2 | char *gr_name; 3 | char *gr_passwd; 4 | short gr_gid; 5 | char **gr_mem; 6 | }; 7 | -------------------------------------------------------------------------------- /usr/include/ident.h: -------------------------------------------------------------------------------- 1 | char myname[] = "research 11/70"; 2 | -------------------------------------------------------------------------------- /usr/include/math.h: -------------------------------------------------------------------------------- 1 | extern double fabs(), floor(), ceil(), fmod(), ldexp(); 2 | extern double sqrt(), hypot(), atof(); 3 | extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); 4 | extern double exp(), log(), log10(), pow(); 5 | extern double sinh(), cosh(), tanh(); 6 | extern double gamma(); 7 | extern double j0(), j1(), jn(), y0(), y1(), yn(); 8 | 9 | #define HUGE 1.701411733192644270e38 10 | #define LOGHUGE 39 11 | -------------------------------------------------------------------------------- /usr/include/mp.h: -------------------------------------------------------------------------------- 1 | #define MINT struct mint 2 | MINT 3 | { short len; 4 | short *val; 5 | }; 6 | #define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} 7 | #ifndef DBG 8 | #define shfree(u) free((char *)u) 9 | #else 10 | #include "stdio.h" 11 | #define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} 12 | extern int dbg; 13 | #endif 14 | struct half 15 | { short high; 16 | short low; 17 | }; 18 | extern MINT *itom(); 19 | extern short *xalloc(); 20 | 21 | #ifdef lint 22 | extern xv_oid; 23 | #define VOID xv_oid = 24 | #else 25 | #define VOID 26 | #endif 27 | -------------------------------------------------------------------------------- /usr/include/pwd.h: -------------------------------------------------------------------------------- 1 | struct passwd { /* see getpwent(3) */ 2 | char *pw_name; 3 | char *pw_passwd; 4 | short pw_uid; 5 | short pw_gid; 6 | short pw_quota; 7 | char *pw_comment; 8 | char *pw_gecos; 9 | char *pw_dir; 10 | char *pw_shell; 11 | }; 12 | -------------------------------------------------------------------------------- /usr/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_INCLUDE_SETJMP_H_20201218 2 | #define __V7_INCLUDE_SETJMP_H_20201218 3 | 4 | typedef struct jmp_buf_t { unsigned int regs[11]; } jmp_buf[1]; 5 | 6 | extern int setjmp(jmp_buf b); 7 | extern void longjmp(jmp_buf b, int r); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /usr/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_STDARG_H_20201218_H 2 | #define __V7_STDARG_H_20201218_H 3 | 4 | #define va_start(v,l) __builtin_va_start(v,l) 5 | #define va_end(v) __builtin_va_end(v) 6 | #define va_arg(v,l) __builtin_va_arg(v,l) 7 | #define va_copy(d,s) __builtin_va_copy(d,s) 8 | #define __va_copy(d,s) __builtin_va_copy(d,s) 9 | 10 | typedef __builtin_va_list va_list; 11 | #if 0 12 | # define va_dcl int va_alist; 13 | # define va_start(list) list = (char *) &va_alist 14 | # define va_end(list) 15 | # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /usr/include/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef _V7_STDLIB_H_20201219_H 2 | #define _V7_STDLIB_H_20201219_H 3 | 4 | extern void exit(int status); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /usr/include/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _V7_STRING_H_20201218_H 2 | #define _V7_STRING_H_20201218_H 3 | 4 | extern int strcmp(const char *s1, const char *s2); 5 | extern int strlen(const char *s); 6 | extern char * strcpy(char *dst, const char *src); 7 | extern char * strncpy(char *dst, const char *src, unsigned int len); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /usr/include/symbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Structure of a symbol table entry 3 | */ 4 | 5 | struct symbol { 6 | char sy_name[8]; 7 | unsigned short sy_type; 8 | unsigned short sy_pad; 9 | unsigned int sy_value; 10 | }; 11 | -------------------------------------------------------------------------------- /usr/include/sys/Makefile: -------------------------------------------------------------------------------- 1 | HFILES = acct.h \ 2 | buf.h \ 3 | conf.h \ 4 | dir.h \ 5 | fblk.h \ 6 | file.h \ 7 | filsys.h \ 8 | ino.h \ 9 | inode.h \ 10 | param.h \ 11 | proc.h \ 12 | reg.h \ 13 | stat.h \ 14 | text.h \ 15 | timeb.h \ 16 | tty.h \ 17 | types.h \ 18 | user.h 19 | 20 | all: $(HFILES) 21 | 22 | ../../sys/h/%.h: ; 23 | 24 | %.h: ../../sys/h/%.h 25 | @echo "COPYSYS $@" 26 | @cp -pr "$<" "$@" 27 | 28 | clean: ; 29 | -------------------------------------------------------------------------------- /usr/include/sys/dir.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_DIR_H 2 | #define __V7_SYS_DIR_H 3 | 4 | #include "types.h" 5 | 6 | #ifndef DIRSIZ 7 | #define DIRSIZ 14 8 | #endif 9 | 10 | struct direct 11 | { 12 | ino_t d_ino; 13 | char d_name[DIRSIZ]; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /usr/include/sys/fblk.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_FBLK_H 2 | #define __V7_SYS_FBLK_H 3 | 4 | #include "param.h" 5 | #include "types.h" 6 | 7 | struct fblk 8 | { 9 | __s16 df_nfree; 10 | daddr_t df_free[NICFREE]; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /usr/include/sys/file.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_FILE_H 2 | #define __V7_SYS_FILE_H 3 | 4 | #include "types.h" 5 | 6 | /* 7 | * One file structure is allocated 8 | * for each open/creat/pipe call. 9 | * Main use is to hold the read/write 10 | * pointer associated with each open 11 | * file. 12 | */ 13 | struct file 14 | { 15 | char f_flag; 16 | char f_count; /* reference count */ 17 | struct inode *f_inode; /* pointer to inode structure */ 18 | off_t f_offset; /* read/write character pointer */ 19 | }; 20 | 21 | #ifdef KERNEL 22 | extern struct file file[]; /* The file table itself */ 23 | #endif 24 | 25 | /* flags */ 26 | #define FREAD 01 27 | #define FWRITE 02 28 | #define FPIPE 04 29 | #define FKERNEL 040 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /usr/include/sys/reg.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_REG_H 2 | #define __V7_SYS_REG_H 3 | 4 | /* 5 | * Location of the users' stored 6 | * registers relative to R0. 7 | * Usage is u.u_ar0[XX]. 8 | */ 9 | #define R0 (0) 10 | #define R1 (1) 11 | #define R2 (2) 12 | #define R3 (3) 13 | #define R4 (4) 14 | #define R5 (5) 15 | #define R6 (6) 16 | #define R7 (7) 17 | #define R8 (8) 18 | #define R9 (9) 19 | #define R10 (10) 20 | #define R11 (11) 21 | #define R12 (12) 22 | #define R13 (13) 23 | #define R14 (14) 24 | #define R15 (15) 25 | #define FP (11) 26 | #define SP (13) 27 | #define LR (14) 28 | #define PC (15) 29 | #define RPS (16) 30 | 31 | #define TBIT 020 /* PS trace bit */ 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /usr/include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_TIMEB_H 2 | #define __V7_SYS_TIMEB_H 3 | 4 | #include "types.h" 5 | 6 | /* 7 | * Structure returned by ftime system call 8 | */ 9 | struct timeb { 10 | time_t time; 11 | __u16 millitm; 12 | __s16 timezone; 13 | __s16 dstflag; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /usr/include/sys/times.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_SYS_TIMES_H 2 | #define __V7_SYS_TIMES_H 3 | 4 | #include "types.h" 5 | 6 | /* 7 | * Structure returned by times() 8 | */ 9 | struct tms { 10 | time_t tms_utime; /* user time */ 11 | time_t tms_stime; /* system time */ 12 | time_t tms_cutime; /* user time, children */ 13 | time_t tms_cstime; /* system time, children */ 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /usr/include/time.h: -------------------------------------------------------------------------------- 1 | struct tm { /* see ctime(3) */ 2 | int tm_sec; 3 | int tm_min; 4 | int tm_hour; 5 | int tm_mday; 6 | int tm_mon; 7 | int tm_year; 8 | int tm_wday; 9 | int tm_yday; 10 | int tm_isdst; 11 | }; 12 | -------------------------------------------------------------------------------- /usr/include/tp_defs.h: -------------------------------------------------------------------------------- 1 | char mt[] = "/dev/mt0"; 2 | char tc[] = "/dev/tapx"; 3 | int flags = flu; 4 | char mheader[] = "/usr/mdec/mboot"; 5 | char theader[] = "/usr/mdec/tboot"; 6 | -------------------------------------------------------------------------------- /usr/include/utmp.h: -------------------------------------------------------------------------------- 1 | struct utmp { 2 | char ut_line[8]; /* tty name */ 3 | char ut_name[8]; /* user id */ 4 | long ut_time; /* time on */ 5 | }; 6 | -------------------------------------------------------------------------------- /usr/include/varargs.h: -------------------------------------------------------------------------------- 1 | #ifndef __V7_VARARGS_H_20201218_H 2 | #define __V7_VARARGS_H_20201218_H 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /usr/include/whoami.h: -------------------------------------------------------------------------------- 1 | #define sysname "where I am" 2 | -------------------------------------------------------------------------------- /usr/lib/cign: -------------------------------------------------------------------------------- 1 | auto 4 2 | break 5 3 | case 5 4 | char 4 5 | continue 5 6 | default 5 7 | do 5 8 | double 4 9 | else 5 10 | extern 2 11 | float 4 12 | for 5 13 | goto 5 14 | if 5 15 | int 4 16 | long 4 17 | register 4 18 | return 5 19 | static 4 20 | struct 3 21 | switch 5 22 | while 5 23 | -------------------------------------------------------------------------------- /usr/lib/crontab: -------------------------------------------------------------------------------- 1 | 0,10,20,30,40,50 * * * * /etc/dmesg - >>/usr/adm/messages 2 | 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/lib/atrun 3 | 20 1 * * * /usr/bin/calendar - 4 | -------------------------------------------------------------------------------- /usr/src/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = libc \ 2 | libmp \ 3 | cmd 4 | 5 | all: 6 | @for __SD in $(SUBDIRS); do $(MAKE) -C $${__SD} all; done 7 | 8 | clean: 9 | @for __SD in $(SUBDIRS); do $(MAKE) -C $${__SD} clean; done 10 | -------------------------------------------------------------------------------- /usr/src/cmd/.gitignore: -------------------------------------------------------------------------------- 1 | bc.c 2 | egrep.c 3 | expr.c 4 | yacc/yacc.native 5 | -------------------------------------------------------------------------------- /usr/src/cmd/accton.c: -------------------------------------------------------------------------------- 1 | main(argc, argv) 2 | char **argv; 3 | { 4 | extern errno; 5 | if (argc > 1) 6 | acct(argv[1]); 7 | else 8 | acct((char *)0); 9 | if (errno) { 10 | perror("accton"); 11 | exit(1); 12 | } 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/cmd/adb/dummy.c: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * 4 | * UNIX debugger - small version 5 | * 6 | */ 7 | 8 | subpcs(modif) 9 | { 10 | prints("sub processes not supported\n"); 11 | } 12 | 13 | delbp() 14 | {;} 15 | 16 | endpcs() 17 | {;} 18 | -------------------------------------------------------------------------------- /usr/src/cmd/adb/machine.h: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX/INTERDATA debugger 4 | */ 5 | 6 | /* unix parameters */ 7 | #define DBNAME "adb\n" 8 | #define LPRMODE "%Q" 9 | #define OFFMODE "+%o" 10 | #define TXTRNDSIZ 8192L 11 | 12 | TYPE unsigned TXTHDR[8]; 13 | TYPE unsigned SYMV; 14 | 15 | /* symbol table in a.out file */ 16 | struct symtab { 17 | char symc[8]; 18 | int symf; 19 | SYMV symv; 20 | }; 21 | #define SYMTABSIZ (sizeof (struct symtab)) 22 | 23 | #define SYMCHK 047 24 | #define SYMTYPE(symflg) (( symflg>=041 || (symflg>=02 && symflg<=04))\ 25 | ? ((symflg&07)>=3 ? DSYM : (symflg&07))\ 26 | : NSYM\ 27 | ) 28 | -------------------------------------------------------------------------------- /usr/src/cmd/adb/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -i -O 2 | 3 | all: adb 4 | 5 | cmp: adb 6 | cmp adb /bin/adb 7 | rm adb *.o 8 | 9 | cp: adb 10 | cp adb /bin/adb 11 | rm adb *.o 12 | 13 | adb: access.o command.o expr.o findfn.o 14 | adb: format.o input.o opset.o main.o 15 | adb: message.o output.o pcs.o print.o 16 | adb: runpcs.o setup.o sym.o 17 | adb:; cc -o adb -i *.o 18 | 19 | 20 | access.o: defs.h 21 | command.o: defs.h 22 | expr.o: defs.h 23 | findrtn.o: defs.h 24 | format.o: defs.h 25 | input.o: defs.h 26 | main.o: defs.h 27 | message.o: mac.h mode.h 28 | output.o: defs.h 29 | pcs.o: defs.h 30 | print.o: defs.h 31 | runpcs.o: defs.h 32 | setup.o: defs.h 33 | sym.o: defs.h 34 | -------------------------------------------------------------------------------- /usr/src/cmd/as/as25.s: -------------------------------------------------------------------------------- 1 | / 2 | / 3 | 4 | / as25 is empty 5 | -------------------------------------------------------------------------------- /usr/src/cmd/as/makefile: -------------------------------------------------------------------------------- 1 | all: as as2 2 | 3 | cmp: as as2 4 | cmp as /bin/as 5 | cmp as2 /lib/as2 6 | rm as as2 a.out 7 | 8 | cp: as as2 9 | cp as /bin/as 10 | cp as2 /lib/as2 11 | rm as as2 a.out 12 | 13 | as: 14 | as /usr/include/sys.s as1?.s 15 | ld -n -s a.out -o as 16 | 17 | as2: 18 | as /usr/include/sys.s as2?.s 19 | ld -n -s a.out -o as2 20 | -------------------------------------------------------------------------------- /usr/src/cmd/awk/tokenscript: -------------------------------------------------------------------------------- 1 | e y.tab.h 2 | 1,$s/# *define *// 3 | 1,$s/^/"/ 4 | 1,$s/ /", / 5 | 1,$s/$/,/ 6 | w temp 7 | e token.c 8 | /= *{$/+1,/^};$/-1d 9 | -r temp 10 | w token.c 11 | q 12 | -------------------------------------------------------------------------------- /usr/src/cmd/bas/makefile: -------------------------------------------------------------------------------- 1 | bas cp cmp: 2 | @echo Sorry, the bas source will not compile 3 | @echo the object because it calls for old-style 4 | @echo library routines. 5 | @echo It\'s here just in case you want to play. 6 | -------------------------------------------------------------------------------- /usr/src/cmd/basename.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | 3 | main(argc, argv) 4 | char **argv; 5 | { 6 | register char *p1, *p2, *p3; 7 | 8 | if (argc < 2) { 9 | putchar('\n'); 10 | exit(1); 11 | } 12 | p1 = argv[1]; 13 | p2 = p1; 14 | while (*p1) { 15 | if (*p1++ == '/') 16 | p2 = p1; 17 | } 18 | if (argc>2) { 19 | for(p3=argv[2]; *p3; p3++) 20 | ; 21 | while(p1>p2 && p3>argv[2]) 22 | if(*--p3 != *--p1) 23 | goto output; 24 | *p1 = '\0'; 25 | } 26 | output: 27 | puts(p2, stdout); 28 | exit(0); 29 | } 30 | -------------------------------------------------------------------------------- /usr/src/cmd/cpp/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O -n -s 2 | 3 | all: cpp 4 | 5 | cp: cpp 6 | cp cpp /lib 7 | rm *.o cpp 8 | 9 | cmp: cpp 10 | cmp cpp /lib/cpp 11 | rm *.o cpp 12 | 13 | cpp: cpp.o cpy.o 14 | cc $(CFLAGS) cpp.o cpy.o -o cpp 15 | cpp.o: cpp.c 16 | cc $(CFLAGS) -c -Dunix=1 -Dpdp11=1 cpp.c 17 | cpy.o: cpy.y yylex.c 18 | -------------------------------------------------------------------------------- /usr/src/cmd/dc/Makefile: -------------------------------------------------------------------------------- 1 | all: dc.aout 2 | 3 | SUBDIR_LEVEL := ../../../.. 4 | include $(SUBDIR_LEVEL)/tools/tools.mk 5 | include $(SUBDIR_LEVEL)/tools/patterns.mk 6 | -------------------------------------------------------------------------------- /usr/src/cmd/dc/makefile.v7: -------------------------------------------------------------------------------- 1 | all: dc 2 | 3 | cmp: dc 4 | cmp dc /bin/dc 5 | rm dc 6 | 7 | cp: dc 8 | cp dc /bin/dc 9 | rm dc 10 | 11 | dc: dc.c dc.h 12 | cc -n -s -O dc.c -o dc 13 | -------------------------------------------------------------------------------- /usr/src/cmd/echo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | main(argc, argv) 4 | int argc; 5 | char *argv[]; 6 | { 7 | register int i, nflg; 8 | 9 | nflg = 0; 10 | if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n') { 11 | nflg++; 12 | argc--; 13 | argv++; 14 | } 15 | for(i=1; i 2 | char *direct = "/usr/lib/learn"; /* CHANGE THIS ON YOUR SYSTEM */ 3 | int more; 4 | char *level; 5 | int speed; 6 | char *sname; 7 | char *todo; 8 | FILE *incopy = NULL; 9 | int didok; 10 | int sequence = 1; 11 | int comfile = -1; 12 | int status; 13 | int wrong; 14 | char *pwline; 15 | char *dir; 16 | FILE *scrin; 17 | int logging = 1; /* set to 0 to turn off logging */ 18 | int ask; 19 | -------------------------------------------------------------------------------- /usr/src/cmd/learn/makpipe.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | 3 | makpipe() 4 | { 5 | int f[2]; 6 | 7 | pipe(f); 8 | if (fork()==0) { 9 | close(f[1]); 10 | close(0); 11 | dup(f[0]); 12 | close(f[0]); 13 | execl ("/bin/sh", "sh", "-i", 0); 14 | execl ("/usr/bin/sh", "sh", "-i", 0); 15 | write(2,"Exec error\n",11); 16 | } 17 | close(f[0]); 18 | sleep(2); /* so shell won't eat up too much input */ 19 | return(f[1]); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/cmd/learn/tee.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int f, c; 4 | 5 | f = creat(".ocopy", 0666); 6 | while (read(0, &c, 1) == 1) { 7 | write (1, &c, 1); 8 | put(c, f); 9 | } 10 | fl(f); 11 | close(f); 12 | } 13 | 14 | static char ln[512]; 15 | char *p = ln; 16 | put(c, f) 17 | { 18 | *p++ = c; 19 | if (c == '\n') { 20 | fl(f); 21 | p=ln; 22 | } 23 | } 24 | fl(f) 25 | { 26 | register char *s; 27 | 28 | s = ln; 29 | while (*s == '$' && *(s+1) == ' ') 30 | s += 2; 31 | write(f, s, p-s); 32 | } 33 | -------------------------------------------------------------------------------- /usr/src/cmd/learn/whatnow.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "lrnref" 3 | 4 | whatnow() 5 | { 6 | if (todo == 0) { 7 | more=0; 8 | return; 9 | } 10 | if (didok) { 11 | strcpy(level,todo); 12 | if (speed<=9) speed++; 13 | } 14 | else { 15 | speed -= 4; 16 | /* the 4 above means that 4 right, one wrong leave 17 | you with the same speed. */ 18 | if (speed <0) speed=0; 19 | } 20 | if (wrong) { 21 | speed -= 2; 22 | if (speed <0 ) speed = 0; 23 | } 24 | if (didok && more) { 25 | printf("\nGood. Lesson %s (%d)\n\n",level, speed); 26 | fflush(stdout); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = lib 2 | OBJECTS = lmain.o \ 3 | y.tab.o \ 4 | sub1.o \ 5 | sub2.o \ 6 | header.o 7 | 8 | all: lex.aout 9 | @$(MAKE) -C lib all 10 | 11 | y.tab.c: parser.y 12 | $(YACC) $^ 13 | 14 | lex.elf: $(OBJECTS) 15 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) 16 | 17 | ../yacc/yacc.native: ../yacc/y1.c ../yacc/y2.c ../yacc/y3.c ../yacc/y4.c ../yacc/dextern ../yacc/files ../yacc/Makefile-native 18 | $(MAKE) -C ../yacc -f Makefile-native 19 | 20 | GENERATED_SOURCES = y.tab.c 21 | 22 | SUBDIR_LEVEL := ../../../.. 23 | include $(SUBDIR_LEVEL)/tools/tools.mk 24 | include $(SUBDIR_LEVEL)/tools/patterns.mk 25 | 26 | CPPFLAGS += -Dunix 27 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/Makefile-native: -------------------------------------------------------------------------------- 1 | CPPFLAGS = -Dunix 2 | CFLAGS=-O 3 | 4 | OBJECTS = lmain.o \ 5 | y.tab.o \ 6 | sub1.o \ 7 | sub2.o \ 8 | header.o 9 | 10 | all: lex.native 11 | 12 | lex.native: $(OBJECTS) 13 | cc $(CPPFLAGS) $(CFLAGS) -o lex.native $(OBJECTS) 14 | rm -f *.o y.tab.c 15 | 16 | y.tab.c: parser.y ../yacc/yacc.native 17 | ../yacc/yacc.native parser.y 18 | 19 | ../yacc/yacc.native: ../yacc/y1.c ../yacc/y2.c ../yacc/y3.c ../yacc/y4.c ../yacc/dextern ../yacc/files 20 | $(MAKE) -C ../yacc -f Makefile-native 21 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJECTS = allprint.o \ 2 | main.o \ 3 | reject.o \ 4 | yyless.o \ 5 | yywrap.o 6 | 7 | TARGET = libln.a 8 | 9 | all: $(TARGET) 10 | 11 | $(TARGET): $(OBJECTS) 12 | $(AR) rcu $@ $^ 13 | $(RANLIB) $@ 14 | 15 | SUBDIR_LEVEL := ../../../../.. 16 | include $(SUBDIR_LEVEL)/tools/tools.mk 17 | include $(SUBDIR_LEVEL)/tools/patterns.mk 18 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/lib/allprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern FILE *yyout; 4 | 5 | void 6 | allprint(char c) 7 | { 8 | switch (c) { 9 | case '\n': 10 | fprintf(yyout, "\\n"); 11 | break; 12 | case '\t': 13 | fprintf(yyout, "\\t"); 14 | break; 15 | case '\b': 16 | fprintf(yyout, "\\b"); 17 | break; 18 | case ' ': 19 | fprintf(yyout, "\\\bb"); 20 | break; 21 | default: 22 | if (!printable(c)) 23 | fprintf(yyout, "\\%-3o", c); 24 | else 25 | putc(c, yyout); 26 | break; 27 | } 28 | return; 29 | } 30 | 31 | void 32 | sprint(char *s) 33 | { 34 | while (*s) 35 | allprint(*s++); 36 | return; 37 | } 38 | 39 | int 40 | printable(int c) 41 | { 42 | return (040 < c && c < 0177); 43 | } 44 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/lib/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int yylex(void); 4 | 5 | int 6 | main(int argc, char *argv[]) 7 | { 8 | yylex(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/lib/yyless.c: -------------------------------------------------------------------------------- 1 | 2 | extern char yytext[]; 3 | extern int yyleng; 4 | extern int yyprevious; 5 | 6 | void 7 | yyless(int x) 8 | { 9 | char *lastch, *ptr; 10 | lastch = yytext + yyleng; 11 | if (x >= 0 && x <= yyleng) 12 | ptr = x + yytext; 13 | else 14 | ptr = (char *)x; 15 | while (lastch > ptr) 16 | yyunput(*--lastch); 17 | *lastch = 0; 18 | if (ptr > yytext) 19 | yyprevious = *--lastch; 20 | yyleng = ptr - yytext; 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/cmd/lex/lib/yywrap.c: -------------------------------------------------------------------------------- 1 | int 2 | yywrap(void) 3 | { 4 | return 1; 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/cmd/lint/READ_ME: -------------------------------------------------------------------------------- 1 | Most of lint's source files are shared with the portable 2 | compiler: they are found in /usr/src/cmd/mip. 3 | The files here are only those which are unique to lint. 4 | -------------------------------------------------------------------------------- /usr/src/cmd/lint/SHELL: -------------------------------------------------------------------------------- 1 | L=/usr/lib/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix 2 | LL=/usr/lib 3 | trap "rm -f $T; exit" 1 2 15 4 | for A in $* 5 | do 6 | case $A in 7 | -*n*) P= ;; 8 | -*p*) P=port ;; 9 | esac 10 | case $A in 11 | -l*) (/lib/cpp $O $LL/llib$A | ${L}1 -v$X-L$A >>$T)2>&1 ;; 12 | -[IDOU]*) O="$O $A" ;; 13 | -X) LL=/usr/src/lint L=/usr/src/lint/lpass ;; 14 | -*) X="$X$A" ;; 15 | *) (/lib/cpp $O $A | ${L}1 $X-L$A >>$T)2>&1 16 | esac 17 | done 18 | case $P in 19 | unix) (/lib/cpp $O $LL/llib-lc | ${L}1 -v$X-L-lc >>$T)2>&1 ;; 20 | port) (/lib/cpp $O $LL/llib-port | ${L}1 -v$X-L-lc >>$T)2>&1 ;; 21 | esac 22 | sort -u $T | ${L}2 $X 23 | rm -f $T 24 | -------------------------------------------------------------------------------- /usr/src/cmd/lint/lmanifest: -------------------------------------------------------------------------------- 1 | /* the key: 2 | LDI defined and initialized: storage set aside 3 | LIB defined on a library 4 | LDC defined as a common region on UNIX 5 | LDX defined by an extern: if ! pflag, same as LDI 6 | LRV function returns a value 7 | LUV function used in a value context 8 | LUE function used in effects context 9 | LUM mentioned somewhere other than at the declaration 10 | */ 11 | # define LDI 01 12 | # define LIB 02 13 | # define LDC 04 14 | # define LDX 010 15 | # define LRV 020 16 | # define LUV 040 17 | # define LUE 0100 18 | # define LUM 0200 19 | -------------------------------------------------------------------------------- /usr/src/cmd/lpr/makefile: -------------------------------------------------------------------------------- 1 | lpr: lpr.c spool.c 2 | cc -n -s -O lpr.c -o lpr 3 | 4 | lpd: lpd.c daemon.c daemon0.c 5 | cc -n -s -O lpd.c -o lpd 6 | 7 | install: 8 | cp lpr /bin/lpr 9 | cp lpd /usr/lib/lpd 10 | rm lpr 11 | rm lpd 12 | echo make sure /etc/rc contains 13 | echo rm /usr/spool/lpd/lock; /usr/lib/lpd 14 | mkdir /usr/spool 15 | mkdir /usr/spool/lpd 16 | -------------------------------------------------------------------------------- /usr/src/cmd/m4/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -n -O -s 2 | 3 | m4: m4.o m4y.o 4 | cc -n -s -o m4 m4.o m4y.o 5 | 6 | all: m4 7 | 8 | cmp: m4 9 | cmp m4 /bin/m4 10 | rm m4 *.o 11 | 12 | cp: m4 13 | cp m4 /bin/m4 14 | rm m4 *.o 15 | -------------------------------------------------------------------------------- /usr/src/cmd/makekey.c: -------------------------------------------------------------------------------- 1 | /* 2 | * You send it 10 bytes. 3 | * It sends you 13 bytes. 4 | * The transformation is expensive to perform 5 | * (a significant part of a second). 6 | */ 7 | 8 | char *crypt(); 9 | 10 | main() 11 | { 12 | char key[8]; 13 | char salt[2]; 14 | 15 | _cleanup(); 16 | read(0, key, 8); 17 | read(0, salt, 2); 18 | write(1, crypt(key, salt), 13); 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/INDEX: -------------------------------------------------------------------------------- 1 | This directory contains the machine independent parts of the 2 | portable C compiler. For more explanation of how these files 3 | are used, see the "Tour through the Portable C Compiler" 4 | in Volume 2 of the UNIX(TM) documentation. 5 | 6 | The makefile in this directory is useful when makeing a compiler; 7 | create a directory, copy the makefile into it, write the 8 | machine dependent files, and you are off and running. The file g 9 | is a useful aid for finding out when things are used. 10 | 11 | The pcc command (see the pcc source) uses this makefile and 12 | the files in this directory. Lint also uses the files. 13 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/comm1.c: -------------------------------------------------------------------------------- 1 | # include "mfile1" 2 | 3 | # include "common" 4 | 5 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/fallo.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "allo.c" 3 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/fcomm2.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "mfile2" 3 | # include "common" 4 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/flocal2.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "local2.c" 3 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/fmatch.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "match.c" 3 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/forder.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "order.c" 3 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/freader.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # define NOMAIN 3 | # include "reader.c" 4 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/ftable.c: -------------------------------------------------------------------------------- 1 | # define FORT 2 | # include "table.c" 3 | -------------------------------------------------------------------------------- /usr/src/cmd/mip/g: -------------------------------------------------------------------------------- 1 | grep -n "$1" macdefs code.c local.c mac2defs local2.c order.c table.c 2 | cd /usr/src/cmd/mip;grep -n "$1" manifest mfile1 cgram.y comm1.c scan.c xdefs.c pftn.c trees.c mfile2 reader.c allo.c match.c common optim.c 3 | -------------------------------------------------------------------------------- /usr/src/cmd/neqn/eqnbox.c: -------------------------------------------------------------------------------- 1 | # include "e.h" 2 | 3 | eqnbox(p1, p2, lu) { 4 | int b, h; 5 | char *sh; 6 | 7 | yyval = p1; 8 | b = max(ebase[p1], ebase[p2]); 9 | eht[yyval] = h = b + max(eht[p1]-ebase[p1], 10 | eht[p2]-ebase[p2]); 11 | ebase[yyval] = b; 12 | if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", 13 | yyval, p1, p2, b, h); 14 | if (rfont[p1] == ITAL && lfont[p2] == ROM) 15 | sh = "\\|"; 16 | else 17 | sh = ""; 18 | if (lu) { 19 | printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh); 20 | printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1); 21 | } 22 | printf(".as %d \"%s\\*(%d\n", yyval, sh, p2); 23 | rfont[p1] = rfont[p2]; 24 | ofree(p2); 25 | } 26 | -------------------------------------------------------------------------------- /usr/src/cmd/neqn/funny.c: -------------------------------------------------------------------------------- 1 | # include "e.h" 2 | # include "e.def" 3 | 4 | funny(n) int n; { 5 | char *f; 6 | 7 | yyval = oalloc(); 8 | switch(n) { 9 | case SUM: 10 | f = "\\(*S"; break; 11 | case UNION: 12 | f = "\\(cu"; break; 13 | case INTER: /* intersection */ 14 | f = "\\(ca"; break; 15 | case PROD: 16 | f = "\\(*P"; break; 17 | default: 18 | error(FATAL, "funny type %d in funny", n); 19 | } 20 | printf(".ds %d %s\n", yyval, f); 21 | eht[yyval] = VERT(2); 22 | ebase[yyval] = 0; 23 | if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n", 24 | yyval, f, eht[yyval], ebase[yyval]); 25 | lfont[yyval] = rfont[yyval] = ROM; 26 | } 27 | -------------------------------------------------------------------------------- /usr/src/cmd/neqn/mark.c: -------------------------------------------------------------------------------- 1 | #include "e.h" 2 | 3 | mark(p1) int p1; { 4 | markline = 1; 5 | printf(".ds %d \\k(97\\*(%d\n", p1, p1); 6 | yyval = p1; 7 | if(dbg)printf(".\tmark %d\n", p1); 8 | } 9 | 10 | lineup(p1) { 11 | markline = 1; 12 | if (p1 == 0) { 13 | yyval = oalloc(); 14 | printf(".ds %d \\h'|\\n(97u'\n", yyval); 15 | } 16 | if(dbg)printf(".\tlineup %d\n", p1); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/cmd/neqn/move.c: -------------------------------------------------------------------------------- 1 | # include "e.h" 2 | # include "e.def" 3 | 4 | move(dir, amt, p) int dir, amt, p; { 5 | int a; 6 | 7 | yyval = p; 8 | a = VERT( (amt+49)/50 ); /* nearest number of half-lines */ 9 | printf(".ds %d ", yyval); 10 | if( dir == FWD || dir == BACK ) /* fwd, back */ 11 | printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p); 12 | else if (dir == UP) 13 | printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a); 14 | else if (dir == DOWN) 15 | printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a); 16 | if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n", 17 | p, dir, a, eht[yyval], ebase[yyval]); 18 | } 19 | -------------------------------------------------------------------------------- /usr/src/cmd/neqn/sqrt.c: -------------------------------------------------------------------------------- 1 | # include "e.h" 2 | 3 | sqrt(p2) int p2; { 4 | yyval = p2; 5 | nrwid(p2, ps, p2); 6 | printf(".ds %d \\v'%du'\\e\\L'%du'\\l'\\n(%du'", 7 | p2, ebase[p2], -eht[p2], p2); 8 | printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", eht[p2]-ebase[p2], p2, p2); 9 | eht[p2] += VERT(1); 10 | if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 11 | p2, p2, ebase[p2], eht[p2]); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/cmd/nice.c: -------------------------------------------------------------------------------- 1 | /* nice */ 2 | 3 | #include 4 | 5 | main(argc, argv) 6 | int argc; 7 | char *argv[]; 8 | { 9 | int nicarg = 10; 10 | extern errno; 11 | extern char *sys_errlist[]; 12 | 13 | if(argc > 1 && argv[1][0] == '-') { 14 | nicarg = atoi(&argv[1][1]); 15 | argc--; 16 | argv++; 17 | } 18 | if(argc < 2) { 19 | fputs("usage: nice [ -n ] command\n", stderr); 20 | exit(1); 21 | } 22 | nice(nicarg); 23 | execvp(argv[1], &argv[1]); 24 | fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]); 25 | exit(1); 26 | } 27 | -------------------------------------------------------------------------------- /usr/src/cmd/pcc/INDEX: -------------------------------------------------------------------------------- 1 | This directory contains the machine-dependent files for the 2 | pcc compiler, which is a PDP-11 C compiler based on the portable 3 | C compiler. The machine-independent files are obtained 4 | from directory /usr/src/cmd/mip. 5 | -------------------------------------------------------------------------------- /usr/src/cmd/prep/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -n -O 2 | 3 | all: prep 4 | : 5 | 6 | cp: all 7 | cp prep /bin 8 | rm prep *.o 9 | 10 | cmp: all 11 | cmp prep /bin/prep 12 | rm prep *.o 13 | 14 | prep: prep0.o prep1.o prep2.o; cc -s -o prep -n *.o 15 | 16 | prep0.o: prep0.c prep.h 17 | prep1.o: prep1.c prep.h 18 | prep2.o: prep2.c 19 | -------------------------------------------------------------------------------- /usr/src/cmd/prep/prep2.c: -------------------------------------------------------------------------------- 1 | int optr; 2 | 3 | char obuf[512]; 4 | 5 | int nflush; 6 | 7 | put(string,n) 8 | char *string; 9 | { 10 | int i; 11 | char *o; 12 | 13 | /*printf("%c %d\n",*string,n);/*DEBUG*/ 14 | 15 | string--; 16 | 17 | if((i = optr + n - 512) >= 0) { 18 | n -= i; 19 | o = &obuf[optr] -1; 20 | while(--n >= 0) 21 | *++o = *++string; 22 | optr = 512; 23 | flsh(); 24 | n = i; 25 | } 26 | 27 | o = &obuf[optr] - 1; 28 | optr += n; 29 | 30 | while(--n >= 0) { 31 | *++o = *++string; 32 | } 33 | return(0); 34 | } 35 | 36 | flsh() 37 | { 38 | 39 | if(optr <= 0) return(optr); 40 | 41 | nflush++; 42 | if(write(1,obuf,optr) != optr) 43 | return(-1); 44 | optr = 0; 45 | return(0); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /usr/src/cmd/random.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define MAXINT 32768. 3 | float fract = 2; 4 | double atof(); 5 | char rflag,eflag,c; 6 | char ibuf[BUFSIZ],obuf[BUFSIZ],line[BUFSIZ]; 7 | main(argc,argv) char **argv; 8 | { 9 | long tvec; 10 | int i; 11 | for(i=1;i 1) 9 | { 10 | igap /= 2; 11 | imax = n-igap; 12 | do 13 | { 14 | iex=0; 15 | for(i=0; i0); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /usr/src/cmd/refer/types.c: -------------------------------------------------------------------------------- 1 | # if LONG 2 | # define ptr long 3 | # define uptr long 4 | # define getp getl 5 | # define putp putl 6 | # define MONE -1L 7 | extern long getl(); 8 | # else 9 | # define ptr int 10 | # define uptr unsigned 11 | # define getp getw 12 | # define putp putw 13 | # define MONE -1 14 | # endif 15 | -------------------------------------------------------------------------------- /usr/src/cmd/refer/what..c: -------------------------------------------------------------------------------- 1 | # include "stdio.h" 2 | # include "ctype.h" 3 | # include "sys/types.h" 4 | # include "sys/stat.h" 5 | # include "assert.h" 6 | # define NFILES 100 7 | # define NAMES 2000 8 | extern exch(), comp(); 9 | struct filans { 10 | char *nm; 11 | long fdate; 12 | long size; 13 | int uid; 14 | }; 15 | extern struct filans files[NFILES]; 16 | extern char fnames[NAMES]; 17 | # define NFEED 5 18 | -------------------------------------------------------------------------------- /usr/src/cmd/roff/makefile: -------------------------------------------------------------------------------- 1 | all: roff 2 | 3 | cp: roff 4 | cp roff /bin 5 | rm roff roff.o 6 | 7 | cmp: roff 8 | cmp roff /bin/roff 9 | rm roff roff.o 10 | 11 | roff: *.s 12 | as -o roff.o /usr/include/sys.s *.s 13 | ld -s roff.o -lc -o roff 14 | -------------------------------------------------------------------------------- /usr/src/cmd/sed/Makefile: -------------------------------------------------------------------------------- 1 | OBJECTS = sed0.o \ 2 | sed1.o 3 | 4 | all: sed.aout 5 | 6 | sed.elf: $(OBJECTS) 7 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) 8 | 9 | SUBDIR_LEVEL := ../../../.. 10 | include $(SUBDIR_LEVEL)/tools/tools.mk 11 | include $(SUBDIR_LEVEL)/tools/patterns.mk 12 | -------------------------------------------------------------------------------- /usr/src/cmd/sed/makefile.v7: -------------------------------------------------------------------------------- 1 | CFLAGS = -n -O 2 | 3 | all: sed 4 | : 5 | 6 | cp: all 7 | cp sed /bin 8 | rm sed *.o 9 | 10 | cmp: all 11 | cmp sed /bin/sed 12 | rm sed *.o 13 | 14 | sed: sed0.o sed1.o; cc -s -o sed -n *.o 15 | 16 | sed0.o: sed0.c sed.h 17 | sed1.o: sed1.c sed.h 18 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/brkincr.h: -------------------------------------------------------------------------------- 1 | #define BRKINCR 01000 2 | #define BRKMAX 04000 3 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/builtin.c: -------------------------------------------------------------------------------- 1 | int 2 | builtin(int argn, unsigned char **com) 3 | { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/dup.h: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX shell 4 | * 5 | * S. R. Bourne 6 | * Bell Telephone Laboratories 7 | * 8 | */ 9 | 10 | #define DUPFLG 0100 11 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/mac.h: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX shell 4 | * 5 | * S. R. Bourne 6 | * Bell Telephone Laboratories 7 | * 8 | */ 9 | 10 | #define TRUE (-1) 11 | #define FALSE 0 12 | #define LOBYTE 0377 13 | #define STRIP 0177 14 | #define QUOTE 0200 15 | 16 | #define EOF 0 17 | #define NL '\n' 18 | #define SP ' ' 19 | #define LQ '`' 20 | #define RQ '\'' 21 | #define MINUS '-' 22 | #define COLON ':' 23 | 24 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) 25 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/name.h: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX shell 4 | * 5 | * S. R. Bourne 6 | * Bell Telephone Laboratories 7 | * 8 | */ 9 | 10 | #define N_RDONLY 0100000 11 | #define N_EXPORT 0040000 12 | #define N_ENVNAM 0020000 13 | #define N_ENVPOS 0007777 14 | 15 | #define N_DEFAULT 0 16 | 17 | struct namnod 18 | { 19 | struct namnod *namlft; 20 | struct namnod *namrgt; 21 | unsigned char *namid; 22 | unsigned char *namval; 23 | unsigned char *namenv; 24 | int namflg; 25 | }; 26 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/setbrk.c: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX shell 4 | * 5 | * S. R. Bourne 6 | * Bell Telephone Laboratories 7 | * 8 | */ 9 | 10 | #include "defs.h" 11 | 12 | unsigned char * 13 | setbrk(int incr) 14 | { 15 | unsigned char *a = sbrk(incr); 16 | if (a != (unsigned char *)-1) { 17 | brkend = a + incr; 18 | } 19 | return a; 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/cmd/sh/timeout.h: -------------------------------------------------------------------------------- 1 | # 2 | /* 3 | * UNIX shell 4 | * 5 | * S. R. Bourne 6 | * Bell Telephone Laboratories 7 | * 8 | */ 9 | 10 | #define TIMEOUT 0 11 | -------------------------------------------------------------------------------- /usr/src/cmd/sleep.c: -------------------------------------------------------------------------------- 1 | main(argc, argv) 2 | char **argv; 3 | { 4 | int c, n; 5 | char *s; 6 | 7 | n = 0; 8 | if(argc < 2) { 9 | printf("arg count\n"); 10 | exit(0); 11 | } 12 | s = argv[1]; 13 | while(c = *s++) { 14 | if(c<'0' || c>'9') { 15 | printf("bad character\n"); 16 | exit(0); 17 | } 18 | n = n*10 + c - '0'; 19 | } 20 | sleep(n); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/cmd/spell/local: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r1mikey/research-unix-v7/8cf6645a513d0b7f0dc38e52d5184bf6249e95b9/usr/src/cmd/spell/local -------------------------------------------------------------------------------- /usr/src/cmd/standalone/cat.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int c, i; 4 | char buf[50]; 5 | 6 | do { 7 | printf("File: "); 8 | gets(buf); 9 | i = open(buf, 0); 10 | } while (i <= 0); 11 | 12 | while ((c = getc(i)) > 0) 13 | putchar(c); 14 | exit(0); 15 | } 16 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/cc+ld-stand: -------------------------------------------------------------------------------- 1 | cc -c -O -DSTANDALONE ../$1.c 2 | ld -s -o $1 srt0.o $1.o -lsa -lc 3 | rm $1.o 4 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/contents: -------------------------------------------------------------------------------- 1 | File 1: 2 | 2 copies of magtape bootstrap (2 blocks total) 3 | The standalone bootstrap 4 | File 2: 5 | A file to console copy program 6 | File 3: 7 | This file 8 | File 4: 9 | The program mkfs 10 | File 5: 11 | The program restor 12 | File 6: 13 | A dump of rp0 14 | File 7: 15 | A dump of rp3 16 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/cpgroup: -------------------------------------------------------------------------------- 1 | /etc/mkfs /dev/rrk2 4000 2 | /etc/mount /dev/rk2 /x 3 | dir=$1 4 | shift 5 | cd /x 6 | (cd $dir; tar cf - $*) | tar xf - 7 | cd / 8 | /etc/umount /dev/rk2 9 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/rkcontents: -------------------------------------------------------------------------------- 1 | File 1: 2 | 2 copies of magtape bootstrap (2 blocks total) 3 | The standalone bootstrap 4 | File 2: 5 | A file to console copy program 6 | File 3: 7 | This file 8 | File 4: 9 | The program mkfs 10 | File 5: 11 | The program restor 12 | File 6: 13 | A dump of rk0 14 | File 7: 15 | A dump of all commands that live in subdirectories 16 | of /usr/src/cmd 17 | File 8: 18 | A dump of the rest of /usr/src/cmd 19 | File 9: 20 | A dump of the rest of /usr/src 21 | File 10: 22 | A dump of /usr excepting src, doc, man, dict, and sys. 23 | File 11: 24 | A dump of /usr/doc 25 | File 12: 26 | A dump of /usr/man, /usr/dict, and /usr/sys. 27 | /usr/sys/ is the system source. 28 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/rktapedir: -------------------------------------------------------------------------------- 1 | mtboot 1 2 | mtboot 1 3 | boot 1 4 | * 1 5 | cat 1 6 | * 1 7 | rkcontents 1 8 | * 1 9 | mkfs 1 10 | * 1 11 | restor 1 12 | -------------------------------------------------------------------------------- /usr/src/cmd/standalone/tapedir: -------------------------------------------------------------------------------- 1 | mtboot 1 2 | mtboot 1 3 | boot 1 4 | * 1 5 | cat 1 6 | * 1 7 | contents 1 8 | * 1 9 | mkfs 1 10 | * 1 11 | restor 1 12 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/0.def.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "def.h" 3 | 4 | int routnum; 5 | FILE *debfd; 6 | LOGICAL routerr; 7 | int nodenum, accessnum; 8 | int **graph; 9 | int progtype; 10 | VERT stopvert, retvert; 11 | VERT START; 12 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/1.main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "def.h" 3 | int endbuf; 4 | 5 | mkgraph() 6 | { 7 | if (!parse()) 8 | return(FALSE); 9 | hash_check(); 10 | hash_free(); 11 | fingraph(); 12 | return(TRUE); 13 | } 14 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/2.def.h: -------------------------------------------------------------------------------- 1 | extern int accessnum; /* number of nodes accessible from START */ 2 | extern VERT *after; /* node numbers associated with after numbers of depth first search */ 3 | extern int *ntobef; /* before numbers associated with nodes */ 4 | extern int *ntoaft; /* after numbers associated with nodes */ 5 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/3.def.h: -------------------------------------------------------------------------------- 1 | #define RECURSE(p,v,r) { for (r = 0; r < CHILDNUM(v); ++r) if (DEFINED(LCHILD(v,r))) p(LCHILD(v,r)); if (DEFINED(RSIB(v))) p(RSIB(v)); } 2 | 3 | #define IFTHEN(v) ( NTYPE(v) == IFVX && !DEFINED(LCHILD(v,ELSE))) 4 | 5 | #define BRK(v) FATH(v) /* lexical successor of v, for ITERVX only */ 6 | #define LABEL(v) REACH(v) 7 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/3.test.c: -------------------------------------------------------------------------------- 1 | #include 2 | # 3 | /* for testing only */ 4 | #include "def.h" 5 | 6 | testreach() 7 | { 8 | VERT v; 9 | for (v = 0; v < nodenum; ++v) 10 | fprintf(stderr,"REACH(%d) = %d\n",v,REACH(v)); 11 | } 12 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/4.def.h: -------------------------------------------------------------------------------- 1 | #define YESTAB TRUE 2 | #define NOTAB FALSE 3 | #define TABOVER(n) tabover(n,outfd) 4 | #define OUTSTR(x) fprintf(outfd,"%s",x) 5 | #define OUTNUM(x) fprintf(outfd,"%d",x) 6 | 7 | 8 | extern LOGICAL *brace; 9 | #define YESBRACE(v,i) { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = TRUE; } 10 | #define NOBRACE(v,i) { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = FALSE; } 11 | #define HASBRACE(v,i) ((DEFINED(LCHILD(v,i))) ? brace[LCHILD(v,i)] : TRUE) 12 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/4.main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "def.h" 3 | #include "4.def.h" 4 | 5 | LOGICAL *brace; 6 | output() 7 | { 8 | VERT w; 9 | int i; 10 | brace = challoc(nodenum * sizeof(*brace)); 11 | for (i = 0; i < nodenum; ++i) 12 | brace[i] = FALSE; 13 | if (progress) fprintf(stderr,"ndbrace:\n"); 14 | for (w = START; DEFINED(w); w = RSIB(w)) 15 | ndbrace(w); 16 | if (progress) fprintf(stderr,"outrat:\n"); 17 | for (w = START; DEFINED(w); w = RSIB(w)) 18 | outrat(w,0,YESTAB); 19 | OUTSTR("END\n"); 20 | chfree(brace,nodenum * sizeof(*brace)); 21 | brace = 0; 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/b.h: -------------------------------------------------------------------------------- 1 | extern int xxindent, xxval, newflag, xxmaxchars, xxbpertab; 2 | extern int xxlineno; /* # of lines already output */ 3 | #define xxtop 100 /* max size of xxstack */ 4 | extern int xxstind, xxstack[xxtop], xxlablast, xxt; 5 | struct node 6 | {int op; 7 | char *lit; 8 | struct node *left; 9 | struct node *right; 10 | }; 11 | -------------------------------------------------------------------------------- /usr/src/cmd/struct/bdef.c: -------------------------------------------------------------------------------- 1 | #define xxtop 100 /* max size of xxstack */ 2 | int xxindent, xxval, newflag, xxmaxchars, xxbpertab; 3 | int xxlineno; /* # of lines already output */ 4 | int xxstind, xxstack[xxtop], xxlablast, xxt; 5 | -------------------------------------------------------------------------------- /usr/src/cmd/sync.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | _cleanup(); 4 | sync(); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/cmd/tbl/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O -n -s 2 | all: tbl 3 | : 4 | 5 | cp: tbl 6 | cp tbl /bin/tbl 7 | rm tbl *.o 8 | 9 | cmp: tbl 10 | cmp tbl /bin/tbl 11 | rm tbl *.o 12 | 13 | tbl: t0.o t1.o t2.o t3.o t4.o t5.o t6.o t7.o t8.o t9.o tb.o tc.o te.o tf.o tg.o ti.o tm.o ts.o tt.o tu.o tv.o 14 | cc -i -s -O t?.o -o tbl 15 | t0.o t1.o t2.o t3.o t4.o t5.o t6.o t7.o t8.o t9.o tb.o tc.o te.o tf.o tg.o ti.o tm.o ts.o tt.o tu.o tv.o: t..c 16 | -------------------------------------------------------------------------------- /usr/src/cmd/tbl/t2.c: -------------------------------------------------------------------------------- 1 | /* t2.c: subroutine sequencing for one table */ 2 | # include "t..c" 3 | tableput() 4 | { 5 | saveline(); 6 | savefill(); 7 | ifdivert(); 8 | cleanfc(); 9 | getcomm(); 10 | getspec(); 11 | gettbl(); 12 | getstop(); 13 | checkuse(); 14 | choochar(); 15 | maktab(); 16 | runout(); 17 | release(); 18 | rstofill(); 19 | endoff(); 20 | restline(); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/cmd/tp/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-n -s -O 2 | 3 | all: tp 4 | rm *.o 5 | 6 | cp: tp 7 | cp tp /bin/tp 8 | rm *.o tp 9 | 10 | cmp: tp 11 | cmp tp /bin/tp 12 | rm *.o tp 13 | 14 | tp: tp0.o tp1.o tp2.o tp3.o 15 | cc $(CFLAGS) tp0.o tp1.o tp2.o tp3.o -o tp 16 | 17 | tp0.c tp1.c tp2.c tp3.c: tp.h 18 | -------------------------------------------------------------------------------- /usr/src/cmd/tp/tp0.c: -------------------------------------------------------------------------------- 1 | #include "tp.h" 2 | #include 3 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/README: -------------------------------------------------------------------------------- 1 | The version of [nt]roff in this directory 2 | is changed somewhat from the version you 3 | may be used to. 4 | 5 | 1. fonts are in /usr/lib/font/ftXX, 6 | where XX is the name of the font (e.g., HI). 7 | Source is in ./font/ftXX.c. 8 | 9 | 2. macro files like -ms are searched for in 10 | /usr/lib/tmac/tmac.xxx. 11 | Your /usr/lib/tmac may have to be changed. 12 | The .so request has been modified to make it a 13 | fatal error to try .so non-existent-file; 14 | this should head off people who are explcitly 15 | including /usr/lib/tmac.s, etc. 16 | 17 | 3. terminal driving tables for nroff are 18 | in /usr/lib/term/tabxxx instead of /usr/lib/term/xxx. 19 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/d.h: -------------------------------------------------------------------------------- 1 | struct d {filep op; int dnl,dimac,ditrap,ditf,alss,blss,nls,mkline, 2 | maxl,hnl,curd;} d[NDI], *dip; 3 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/font/chars.c: -------------------------------------------------------------------------------- 1 | extern char codetab[]; 2 | extern int chtab[]; 3 | 4 | main(){ 5 | register i,j,k; 6 | 7 | for(i=040; i<(256); i++){ 8 | j = codetab[i-040] & 0377; 9 | if(j & 0200)for(k=0; chtab[k] != 0; k += 2){ 10 | if(chtab[k+1] == i){ 11 | printf("%o \\(%c%c\n", 12 | j, 13 | chtab[k] & 0377, 14 | chtab[k]>>8 & 0377); 15 | break; 16 | }else if(i < 0177){ 17 | printf("%o %c\n",j,i & 0177); 18 | break; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/font/linkrc: -------------------------------------------------------------------------------- 1 | cd /usr/lib/font 2 | rm ftH ftHI ftHM ftFD ftCI 3 | ln ftG ftH 4 | ln ftGI ftHI 5 | ln ftGM ftHM 6 | ln ftUD ftFD 7 | ln ftCK ftCI 8 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/font/makefile: -------------------------------------------------------------------------------- 1 | cp: all 2 | for i in *.o; do cp $$i /usr/lib/font/`basename $$i .o`; done 3 | rm *.o 4 | 5 | cmp: all 6 | for i in *.o; do cmp $$i /usr/lib/font/`basename $$i .o`; done 7 | rm *.o 8 | 9 | .c.o: 10 | cc -c $<; strip $@ 11 | 12 | all: ftB.o ftBC.o ftC.o ftCE.o ftCI.o ftCK.o ftCS.o ftCW.o ftG.o ftGI.o ftGM.o ftGR.o 13 | all: ftI.o ftL.o ftLI.o ftPA.o ftPB.o ftPI.o ftR.o ftS.o ftSB.o ftSI.o ftSM.o ftUD.o ftXM.o 14 | 15 | mkfont:mkfont.c mkfont1.c -o mkfont 16 | cc -n -s mkfont.c 17 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/makefile: -------------------------------------------------------------------------------- 1 | all: nroff troff 2 | 3 | nroff: 4 | make -f nmake 5 | rm *.o 6 | 7 | troff: 8 | make -f tmake 9 | rm *.o 10 | 11 | cp: all 12 | cp nroff troff /bin 13 | rm nroff troff 14 | 15 | cmp: all 16 | cmp nroff /bin/nroff 17 | cmp troff /bin/troff 18 | rm nroff troff 19 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/s.h: -------------------------------------------------------------------------------- 1 | struct s { 2 | int nargs; 3 | struct s *pframe; 4 | filep pip; 5 | int pnchar; 6 | int prchar; 7 | int ppendt; 8 | int *pap; 9 | int *pcp; 10 | int pch0; 11 | int pch; 12 | }; 13 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/term/makefile: -------------------------------------------------------------------------------- 1 | cp: all 2 | for i in *.o; do cp $$i /usr/lib/term/`basename $$i .o`; done 3 | rm *.o 4 | 5 | cmp: all 6 | for i in *.o; do cmp $$i /usr/lib/term/`basename $$i .o`; done 7 | rm *.o 8 | 9 | all: tab300-12.o tab300.o tab300s-12.o tab300s.o 10 | all: tab37.o tab450-12-8.o tab450-12.o tab450.o tab832.o taba1.o tablp.o tabtn300.o 11 | : 12 | 13 | .c.o: 14 | cc -c $<; strip $@ 15 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/textscript: -------------------------------------------------------------------------------- 1 | g/\.data/d 2 | 0a 3 | .text 4 | . 5 | w 6 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/tw.h: -------------------------------------------------------------------------------- 1 | /* typewriter driving table structure*/ 2 | struct { 3 | int bset; 4 | int breset; 5 | int Hor; 6 | int Vert; 7 | int Newline; 8 | int Char; 9 | int Em; 10 | int Halfline; 11 | int Adj; 12 | char *twinit; 13 | char *twrest; 14 | char *twnl; 15 | char *hlr; 16 | char *hlf; 17 | char *flr; 18 | char *bdon; 19 | char *bdoff; 20 | char *ploton; 21 | char *plotoff; 22 | char *up; 23 | char *down; 24 | char *right; 25 | char *left; 26 | char *codetab[256-32]; 27 | char *zzz; 28 | } t; 29 | -------------------------------------------------------------------------------- /usr/src/cmd/troff/v.h: -------------------------------------------------------------------------------- 1 | struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd; 2 | int vxx[NN-NNAMES];} v ; 3 | -------------------------------------------------------------------------------- /usr/src/cmd/tty.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Type tty name 3 | */ 4 | 5 | char *ttyname(); 6 | 7 | main(argc, argv) 8 | char **argv; 9 | { 10 | register char *p; 11 | 12 | p = ttyname(0); 13 | if(argc==2 && !strcmp(argv[1], "-s")) 14 | ; 15 | else 16 | printf("%s\n", (p? p: "not a tty")); 17 | exit(p? 0: 1); 18 | } 19 | -------------------------------------------------------------------------------- /usr/src/cmd/update.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Update the file system every 30 seconds. 3 | * For cache benefit, open certain system directories. 4 | */ 5 | 6 | #include 7 | 8 | char *fillst[] = { 9 | "/bin", 10 | "/usr", 11 | "/usr/bin", 12 | 0, 13 | }; 14 | 15 | main() 16 | { 17 | char **f; 18 | 19 | if(fork()) 20 | exit(0); 21 | close(0); 22 | close(1); 23 | close(2); 24 | for(f = fillst; *f; f++) 25 | open(*f, 0); 26 | dosync(); 27 | for(;;) 28 | pause(); 29 | } 30 | 31 | dosync() 32 | { 33 | sync(); 34 | signal(SIGALRM, dosync); 35 | alarm(30); 36 | } 37 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/gwd.c: -------------------------------------------------------------------------------- 1 | #include "uucp.h" 2 | 3 | /******* 4 | * gwd(wkdir) get working directory 5 | * 6 | * return codes 0 | FAIL 7 | */ 8 | 9 | gwd(wkdir) 10 | char *wkdir; 11 | { 12 | FILE *fp; 13 | extern FILE *popen(), *pclose(); 14 | char *c; 15 | 16 | if ((fp = popen("pwd", "r")) == NULL) 17 | return(FAIL); 18 | if (fgets(wkdir, 100, fp) == NULL) { 19 | pclose(fp); 20 | return(FAIL); 21 | } 22 | if (*(c = wkdir + strlen(wkdir) - 1) == '\n') 23 | *c = '\0'; 24 | pclose(fp); 25 | return(0); 26 | } 27 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/index.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | /******* 5 | * char * 6 | * index(str, c) return pointer to character c 7 | * char c, *str; 8 | * 9 | * return codes: 10 | * NULL - character not found 11 | * pointer - pointer to character 12 | */ 13 | 14 | char * 15 | index(str, c) 16 | char c, *str; 17 | { 18 | for (; *str != '\0'; str++) { 19 | if (*str == c) 20 | return(str); 21 | } 22 | 23 | return(NULL); 24 | } 25 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/ioctl.c: -------------------------------------------------------------------------------- 1 | #include "uucp.h" 2 | #include 3 | 4 | /******* 5 | * ioctl(fn, com, ttbuf) for machines without ioctl 6 | * int fn, com; 7 | * struct sgttyb *ttbuf; 8 | * 9 | * return codes - same as stty and gtty 10 | */ 11 | 12 | ioctl(fn, com, ttbuf) 13 | int fn, com; 14 | struct sgttyb *ttbuf; 15 | { 16 | struct sgttyb tb; 17 | 18 | switch (com) { 19 | case TIOCHPCL: 20 | gtty(fn, &tb); 21 | tb.sg_flags |= 1; 22 | return(stty(fn, &tb)); 23 | case TIOCGETP: 24 | return(gtty(fn, ttbuf)); 25 | case TIOCSETP: 26 | return(stty(fn, ttbuf)); 27 | case TIOCEXCL: 28 | default: 29 | return(-1); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/lastpart.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******* 4 | * char * 5 | * lastpart(file) find last part of file name 6 | * char *file; 7 | * 8 | * return - pointer to last part 9 | */ 10 | 11 | char * 12 | lastpart(file) 13 | char *file; 14 | { 15 | char *c; 16 | 17 | c = file + strlen(file); 18 | while (c >= file) 19 | if (*(--c) == '/') 20 | break; 21 | return(++c); 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/pkon.c: -------------------------------------------------------------------------------- 1 | pkon() { } 2 | pkoff() { } 3 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/prefix.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******* 4 | * prefix(s1, s2) check s2 for prefix s1 5 | * char *s1, *s2; 6 | * 7 | * return 0 - != 8 | * return 1 - == 9 | */ 10 | 11 | prefix(s1, s2) 12 | char *s1, *s2; 13 | { 14 | char c; 15 | 16 | while ((c = *s1++) == *s2++) 17 | if (c == '\0') 18 | return(1); 19 | return(c == '\0'); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/sysacct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | /******* 5 | * sysacct(bytes, time) output accounting info 6 | * time_t time; 7 | * long bytes; 8 | */ 9 | 10 | sysacct(bytes, time) 11 | time_t time; 12 | long bytes; 13 | { 14 | return; 15 | } 16 | -------------------------------------------------------------------------------- /usr/src/cmd/uucp/uucpdefs.h: -------------------------------------------------------------------------------- 1 | char *Thisdir = THISDIR; 2 | char *Spool = SPOOL; 3 | char *Myname = MYNAME; 4 | int Debug = 0; 5 | int Pkdebug = 0; 6 | 7 | char *Sysfiles[] = { 8 | SYSFILE, 9 | SYSFILECR, 10 | NULL 11 | }; 12 | char *Devfile = DEVFILE; 13 | char *Dialfile = DIALFILE; 14 | int Packflg = 0; 15 | int Pkdrvon = 0; 16 | int Bspeed = 150; 17 | -------------------------------------------------------------------------------- /usr/src/cmd/xsend/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -n -O -s 2 | 3 | cp: all 4 | cp xsend xget enroll /bin 5 | rm *.o xsend xget enroll 6 | 7 | cmp: all 8 | cmp xsend /bin/xsend 9 | cmp xget /bin/xget 10 | cmp enroll /bin/enroll 11 | rm *.o xsend xget enroll 12 | 13 | all: enroll xsend xget 14 | enroll: enroll.o lib.o 15 | cc -n -s enroll.o lib.o -lmp -o enroll 16 | xget: xget.o lib.o 17 | cc -n -s xget.o lib.o -lmp -o xget 18 | xsend: xsend.o lib.o 19 | cc -n -s xsend.o lib.o -lmp -o xsend 20 | enroll.o xget.o xsend.o lib.o: xmail.h 21 | list: 22 | @pr -2 -w124 m.h xmail.h enroll.c xsend.c xget.c lib.c makefile 23 | -------------------------------------------------------------------------------- /usr/src/cmd/xsend/xmail.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | extern MINT *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15; 4 | extern char buf[256]; 5 | #ifdef debug 6 | #define nin(x, y) m_in(x, 8, y) 7 | #define nout(x, y) m_out(x, 8, y) 8 | #endif 9 | -------------------------------------------------------------------------------- /usr/src/cmd/yacc/Makefile: -------------------------------------------------------------------------------- 1 | OBJECTS = y1.o \ 2 | y2.o \ 3 | y3.o \ 4 | y4.o 5 | 6 | all: yacc.aout 7 | 8 | yacc.elf: $(OBJECTS) 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) 10 | 11 | SUBDIR_LEVEL := ../../../.. 12 | include $(SUBDIR_LEVEL)/tools/tools.mk 13 | include $(SUBDIR_LEVEL)/tools/patterns.mk 14 | -------------------------------------------------------------------------------- /usr/src/cmd/yacc/Makefile-native: -------------------------------------------------------------------------------- 1 | CPPFLAGS = -DPARSER="\"$(CURDIR)/../../../lib/yaccpar\"" 2 | CFLAGS=-O 3 | all: yacc.native 4 | 5 | yacc.native: y1.o y2.o y3.o y4.o 6 | cc -o yacc.native y?.o 7 | rm -f *.o 8 | 9 | y1.o y2.o y3.o y4.o: dextern files 10 | -------------------------------------------------------------------------------- /usr/src/cmd/yacc/files: -------------------------------------------------------------------------------- 1 | /* this file has the location of the parser, and the size of the progam desired */ 2 | /* It may also contain definitions to override various defaults: for example, */ 3 | /* WORD32 tells yacc that there are at least 32 bits per int */ 4 | /* on some systems, notably IBM, the names for the output files and tempfiles must */ 5 | /* also be changed */ 6 | 7 | /* location of the parser text file */ 8 | #if !defined(PARSER) 9 | # define PARSER "/usr/lib/yaccpar" 10 | #endif 11 | 12 | /* basic size of the Yacc implementation */ 13 | # define MEDIUM 14 | 15 | # define WORD32 16 | -------------------------------------------------------------------------------- /usr/src/cmd/yacc/makefile.v7: -------------------------------------------------------------------------------- 1 | CFLAGS=-O 2 | all: yacc 3 | : 4 | 5 | cmp: all 6 | cmp yacc /bin/yacc 7 | rm yacc *.o 8 | 9 | cp: all 10 | cp yacc /bin/yacc 11 | rm yacc *.o 12 | 13 | yacc: y1.o y2.o y3.o y4.o 14 | cc -i -s -o yacc y?.o 15 | 16 | y1.o y2.o y3.o y4.o: dextern files 17 | -------------------------------------------------------------------------------- /usr/src/cmd/yes.c: -------------------------------------------------------------------------------- 1 | main(argc, argv) 2 | char **argv; 3 | { 4 | for (;;) 5 | printf("%s\n", argc>1? argv[1]: "y"); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/games/chess/README: -------------------------------------------------------------------------------- 1 | This program is not the one 2 | that won the U. S. championship. 3 | -------------------------------------------------------------------------------- /usr/src/games/fortune.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char line[500]; 4 | char bline[500]; 5 | 6 | main() 7 | { 8 | double p; 9 | register char * l; 10 | long t; 11 | FILE *f; 12 | 13 | f = fopen("/usr/games/lib/fortunes", "r"); 14 | if (f == NULL) { 15 | printf("Memory fault -- core dumped\n"); 16 | exit(1); 17 | } 18 | time(&t); 19 | srand(getpid() + (int)((t>>16) + t)); 20 | p = 1.; 21 | for(;;) { 22 | l = fgets(line, 500, f); 23 | if(l == NULL) 24 | break; 25 | if(rand() < 32768./p) 26 | strcpy(bline, line); 27 | p += 1.; 28 | } 29 | fputs(bline, stdout); 30 | return(0); 31 | } 32 | -------------------------------------------------------------------------------- /usr/src/libF77/abort_.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | abort_() 4 | { 5 | fprintf(stderr, "Fortran abort routine called\n"); 6 | _cleanup(); 7 | abort(); 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libF77/c_abs.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | float c_abs(z) 4 | complex *z; 5 | { 6 | double cabs(); 7 | 8 | return( cabs( z->real, z->imag ) ); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libF77/c_cos.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | c_cos(r, z) 4 | complex *r, *z; 5 | { 6 | double sin(), cos(), sinh(), cosh(); 7 | 8 | r->real = cos(z->real) * cosh(z->imag); 9 | r->imag = - sin(z->real) * sinh(z->imag); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/c_exp.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | c_exp(r, z) 4 | complex *r, *z; 5 | { 6 | double expx; 7 | double exp(), cos(), sin(); 8 | 9 | expx = exp(z->real); 10 | r->real = expx * cos(z->imag); 11 | r->imag = expx * sin(z->imag); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/libF77/c_log.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | c_log(r, z) 4 | complex *r, *z; 5 | { 6 | double log(), cabs(), atan2(); 7 | 8 | r->imag = atan2(z->imag, z->real); 9 | r->real = log( cabs(z->real, z->imag) ); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/c_sin.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | c_sin(r, z) 4 | complex *r, *z; 5 | { 6 | double sin(), cos(), sinh(), cosh(); 7 | 8 | r->real = sin(z->real) * cosh(z->imag); 9 | r->imag = cos(z->real) * sinh(z->imag); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/c_sqrt.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | c_sqrt(r, z) 4 | complex *r, *z; 5 | { 6 | double mag, sqrt(), cabs(); 7 | 8 | if( (mag = cabs(z->real, z->imag)) == 0.) 9 | r->real = r->imag = 0.; 10 | else if(z->real > 0) 11 | { 12 | r->real = sqrt(0.5 * (mag + z->real) ); 13 | r->imag = z->imag / r->real / 2; 14 | } 15 | else 16 | { 17 | r->imag = sqrt(0.5 * (mag - z->real) ); 18 | if(z->imag < 0) 19 | r->imag = - r->imag; 20 | r->real = z->imag / r->imag /2; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/libF77/cabs.c: -------------------------------------------------------------------------------- 1 | double cabs(real, imag) 2 | double real, imag; 3 | { 4 | double temp, sqrt(); 5 | 6 | if(real < 0) 7 | real = -real; 8 | if(imag < 0) 9 | imag = -imag; 10 | if(imag > real){ 11 | temp = real; 12 | real = imag; 13 | imag = temp; 14 | } 15 | if((real+imag) == real) 16 | return(real); 17 | 18 | temp = imag/real; 19 | temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ 20 | return(temp); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libF77/compall: -------------------------------------------------------------------------------- 1 | cc -c -O [a-l]*.c 2 | cc -c -O [m-z]*.c 3 | -------------------------------------------------------------------------------- /usr/src/libF77/complex: -------------------------------------------------------------------------------- 1 | typedef struct { float real, imag; } complex; 2 | typedef struct { double dreal, dimag; } dcomplex; 3 | -------------------------------------------------------------------------------- /usr/src/libF77/d_abs.c: -------------------------------------------------------------------------------- 1 | double d_abs(x) 2 | double *x; 3 | { 4 | if(*x >= 0) 5 | return(*x); 6 | return(- *x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/d_acos.c: -------------------------------------------------------------------------------- 1 | double d_acos(x) 2 | double *x; 3 | { 4 | double acos(); 5 | return( acos(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_asin.c: -------------------------------------------------------------------------------- 1 | double d_asin(x) 2 | double *x; 3 | { 4 | double asin(); 5 | return( asin(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_atan.c: -------------------------------------------------------------------------------- 1 | double d_atan(x) 2 | double *x; 3 | { 4 | double atan(); 5 | return( atan(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_atn2.c: -------------------------------------------------------------------------------- 1 | double d_atn2(x,y) 2 | double *x, *y; 3 | { 4 | double atan2(); 5 | return( atan2(*x,*y) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_cnjg.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | d_cnjg(r, z) 4 | dcomplex *r, *z; 5 | { 6 | r->dreal = z->dreal; 7 | r->dimag = - z->dimag; 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libF77/d_cos.c: -------------------------------------------------------------------------------- 1 | double d_cos(x) 2 | double *x; 3 | { 4 | double cos(); 5 | return( cos(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_cosh.c: -------------------------------------------------------------------------------- 1 | double d_cosh(x) 2 | double *x; 3 | { 4 | double cosh(); 5 | return( cosh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_dim.c: -------------------------------------------------------------------------------- 1 | double d_dim(a,b) 2 | double *a, *b; 3 | { 4 | return( *a > *b ? *a - *b : 0); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/d_exp.c: -------------------------------------------------------------------------------- 1 | double d_exp(x) 2 | double *x; 3 | { 4 | double exp(); 5 | return( exp(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_imag.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | double d_imag(z) 4 | dcomplex *z; 5 | { 6 | return(z->dimag); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/d_int.c: -------------------------------------------------------------------------------- 1 | double d_int(x) 2 | double *x; 3 | { 4 | return( (long int) (*x) ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/d_lg10.c: -------------------------------------------------------------------------------- 1 | #define log10e 0.43429448190325182765 2 | 3 | double d_lg10(x) 4 | double *x; 5 | { 6 | double log(); 7 | 8 | return( log10e * log(*x) ); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libF77/d_log.c: -------------------------------------------------------------------------------- 1 | double d_log(x) 2 | double *x; 3 | { 4 | double log(); 5 | return( log(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_mod.c: -------------------------------------------------------------------------------- 1 | double d_mod(x,y) 2 | double *x, *y; 3 | { 4 | return(*x - (*y) * ( (long int) (*x / *y)) ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/d_nint.c: -------------------------------------------------------------------------------- 1 | double d_nint(x) 2 | double *x; 3 | { 4 | return( (*x)>=0 ? 5 | (long int) (*x + .5) : (long int) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_prod.c: -------------------------------------------------------------------------------- 1 | double d_prod(x,y) 2 | float *x, *y; 3 | { 4 | return( (*x) * (*y) ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/d_sign.c: -------------------------------------------------------------------------------- 1 | double d_sign(a,b) 2 | double *a, *b; 3 | { 4 | double x; 5 | x = (*a >= 0 ? *a : - *a); 6 | return( *b >= 0 ? x : -x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/d_sin.c: -------------------------------------------------------------------------------- 1 | double d_sin(x) 2 | double *x; 3 | { 4 | double sin(); 5 | return( sin(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_sinh.c: -------------------------------------------------------------------------------- 1 | double d_sinh(x) 2 | double *x; 3 | { 4 | double sinh(); 5 | return( sinh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_sqrt.c: -------------------------------------------------------------------------------- 1 | double d_sqrt(x) 2 | double *x; 3 | { 4 | double sqrt(); 5 | return( sqrt(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_tan.c: -------------------------------------------------------------------------------- 1 | double d_tan(x) 2 | double *x; 3 | { 4 | double tan(); 5 | return( tan(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/d_tanh.c: -------------------------------------------------------------------------------- 1 | double d_tanh(x) 2 | double *x; 3 | { 4 | double tanh(); 5 | return( tanh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/getarg_.c: -------------------------------------------------------------------------------- 1 | /* 2 | * subroutine getarg(k, c) 3 | * returns the kth unix command argument in fortran character 4 | * variable argument c 5 | */ 6 | 7 | getarg_(n, s, ls) 8 | long int *n; 9 | char *s; 10 | long int ls; 11 | { 12 | extern int xargc; 13 | extern char **xargv; 14 | char *t; 15 | int i; 16 | 17 | if(*n>0 && *n= 0) 5 | return(*x); 6 | return(- *x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/h_dim.c: -------------------------------------------------------------------------------- 1 | short h_dim(a,b) 2 | short *a, *b; 3 | { 4 | return( *a > *b ? *a - *b : 0); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/h_dnnt.c: -------------------------------------------------------------------------------- 1 | short h_dnnt(x) 2 | double *x; 3 | { 4 | return( (*x)>=0 ? 5 | (short) (*x + .5) : (short) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/h_indx.c: -------------------------------------------------------------------------------- 1 | short h_indx(a, b, la, lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | int i, n; 6 | char *s, *t, *bend; 7 | 8 | n = la - lb + 1; 9 | bend = b + lb; 10 | 11 | for(i = 0 ; i < n ; ++i) 12 | { 13 | s = a + i; 14 | t = b; 15 | while(t < bend) 16 | if(*s++ != *t++) 17 | goto no; 18 | return(i+1); 19 | no: ; 20 | } 21 | return(0); 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/libF77/h_len.c: -------------------------------------------------------------------------------- 1 | short h_len(s, n) 2 | char *s; 3 | long int n; 4 | { 5 | return(n); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/h_mod.c: -------------------------------------------------------------------------------- 1 | short h_mod(a,b) 2 | short *a, *b; 3 | { 4 | return( *a % *b); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/h_nint.c: -------------------------------------------------------------------------------- 1 | short h_nint(x) 2 | float *x; 3 | { 4 | return( (*x)>=0 ? 5 | (short) (*x + .5) : (short) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/h_sign.c: -------------------------------------------------------------------------------- 1 | short h_sign(a,b) 2 | short *a, *b; 3 | { 4 | short x; 5 | x = (*a >= 0 ? *a : - *a); 6 | return( *b >= 0 ? x : -x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/hl_ge.c: -------------------------------------------------------------------------------- 1 | short l_ge(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) >= 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/hl_gt.c: -------------------------------------------------------------------------------- 1 | short l_gt(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) > 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/hl_le.c: -------------------------------------------------------------------------------- 1 | short l_le(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) <= 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/hl_lt.c: -------------------------------------------------------------------------------- 1 | short l_lt(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) < 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/i_abs.c: -------------------------------------------------------------------------------- 1 | long int i_abs(x) 2 | long int *x; 3 | { 4 | if(*x >= 0) 5 | return(*x); 6 | return(- *x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/i_dim.c: -------------------------------------------------------------------------------- 1 | long int i_dim(a,b) 2 | long int *a, *b; 3 | { 4 | return( *a > *b ? *a - *b : 0); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/i_dnnt.c: -------------------------------------------------------------------------------- 1 | long int i_dnnt(x) 2 | double *x; 3 | { 4 | return( (*x)>=0 ? 5 | (long int) (*x + .5) : (long int) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/i_indx.c: -------------------------------------------------------------------------------- 1 | long int i_indx(a, b, la, lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | long int i, n; 6 | char *s, *t, *bend; 7 | 8 | n = la - lb + 1; 9 | bend = b + lb; 10 | 11 | for(i = 0 ; i < n ; ++i) 12 | { 13 | s = a + i; 14 | t = b; 15 | while(t < bend) 16 | if(*s++ != *t++) 17 | goto no; 18 | return(i+1); 19 | no: ; 20 | } 21 | return(0); 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/libF77/i_len.c: -------------------------------------------------------------------------------- 1 | long int i_len(s, n) 2 | char *s; 3 | long int n; 4 | { 5 | return(n); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/i_mod.c: -------------------------------------------------------------------------------- 1 | long int i_mod(a,b) 2 | long int *a, *b; 3 | { 4 | return( *a % *b); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/i_nint.c: -------------------------------------------------------------------------------- 1 | long int i_nint(x) 2 | float *x; 3 | { 4 | return( (*x)>=0 ? 5 | (long int) (*x + .5) : (long int) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/i_sign.c: -------------------------------------------------------------------------------- 1 | long int i_sign(a,b) 2 | long int *a, *b; 3 | { 4 | long int x; 5 | x = (*a >= 0 ? *a : - *a); 6 | return( *b >= 0 ? x : -x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/iargc_.c: -------------------------------------------------------------------------------- 1 | long int iargc_() 2 | { 3 | extern int xargc; 4 | return ( xargc - 1 ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/l_ge.c: -------------------------------------------------------------------------------- 1 | long int l_ge(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) >= 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/l_gt.c: -------------------------------------------------------------------------------- 1 | long int l_gt(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) > 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/l_le.c: -------------------------------------------------------------------------------- 1 | long int l_le(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) <= 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/l_lt.c: -------------------------------------------------------------------------------- 1 | long int l_lt(a,b,la,lb) 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | return(s_cmp(a,b,la,lb) < 0); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_ci.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | pow_ci(p, a, b) /* p = a**b */ 4 | complex *p, *a; 5 | long int *b; 6 | { 7 | dcomplex p1, a1; 8 | 9 | a1.dreal = a->real; 10 | a1.dimag = a->imag; 11 | 12 | pow_zi(&p1, &a1, b); 13 | 14 | p->real = p1.dreal; 15 | p->imag = p1.dimag; 16 | } 17 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_dd.c: -------------------------------------------------------------------------------- 1 | double pow_dd(ap, bp) 2 | double *ap, *bp; 3 | { 4 | double pow(); 5 | 6 | return(pow(*ap, *bp) ); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_di.c: -------------------------------------------------------------------------------- 1 | double pow_di(ap, bp) 2 | double *ap; 3 | long int *bp; 4 | { 5 | double pow, x; 6 | long int n; 7 | 8 | pow = 1; 9 | x = *ap; 10 | n = *bp; 11 | 12 | if(n != 0) 13 | { 14 | if(n < 0) 15 | { 16 | if(x == 0) 17 | { 18 | return(pow); 19 | } 20 | n = -n; 21 | x = 1/x; 22 | } 23 | for( ; ; ) 24 | { 25 | if(n & 01) 26 | pow *= x; 27 | if(n >>= 1) 28 | x *= x; 29 | else 30 | break; 31 | } 32 | } 33 | return(pow); 34 | } 35 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_hh.c: -------------------------------------------------------------------------------- 1 | short pow_hh(ap, bp) 2 | short *ap, *bp; 3 | { 4 | short pow, x, n; 5 | 6 | pow = 1; 7 | x = *ap; 8 | n = *bp; 9 | 10 | if(n < 0) 11 | { } 12 | else if(n > 0) 13 | for( ; ; ) 14 | { 15 | if(n & 01) 16 | pow *= x; 17 | if(n >>= 1) 18 | x *= x; 19 | else 20 | break; 21 | } 22 | return(pow); 23 | } 24 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_ii.c: -------------------------------------------------------------------------------- 1 | long int pow_ii(ap, bp) 2 | long int *ap, *bp; 3 | { 4 | long int pow, x, n; 5 | 6 | pow = 1; 7 | x = *ap; 8 | n = *bp; 9 | 10 | if(n < 0) 11 | { } 12 | else if(n > 0) 13 | for( ; ; ) 14 | { 15 | if(n & 01) 16 | pow *= x; 17 | if(n >>= 1) 18 | x *= x; 19 | else 20 | break; 21 | } 22 | return(pow); 23 | } 24 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_ri.c: -------------------------------------------------------------------------------- 1 | float pow_ri(ap, bp) 2 | float *ap; 3 | long int *bp; 4 | { 5 | double pow, x; 6 | long int n; 7 | 8 | pow = 1; 9 | x = *ap; 10 | n = *bp; 11 | 12 | if(n != 0) 13 | { 14 | if(n < 0) 15 | { 16 | if(x == 0) 17 | { 18 | return(pow); 19 | } 20 | n = -n; 21 | x = 1/x; 22 | } 23 | for( ; ; ) 24 | { 25 | if(n & 01) 26 | pow *= x; 27 | if(n >>= 1) 28 | x *= x; 29 | else 30 | break; 31 | } 32 | } 33 | return(pow); 34 | } 35 | -------------------------------------------------------------------------------- /usr/src/libF77/pow_zz.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | pow_zz(r,a,b) 4 | dcomplex *r, *a, *b; 5 | { 6 | double logr, logi, x, y; 7 | double log(), exp(), cos(), sin(), atan2(), cabs(); 8 | 9 | logr = log( cabs(a->dreal, a->dimag) ); 10 | logi = atan2(a->dimag, a->dreal); 11 | 12 | x = exp( logr * b->dreal - logi * b->dimag ); 13 | y = logr * b->dimag + logi * b->dreal; 14 | 15 | r->dreal = x * cos(y); 16 | r->dimag = x * sin(y); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/libF77/r_abs.c: -------------------------------------------------------------------------------- 1 | double r_abs(x) 2 | float *x; 3 | { 4 | if(*x >= 0) 5 | return(*x); 6 | return(- *x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/r_acos.c: -------------------------------------------------------------------------------- 1 | double r_acos(x) 2 | float *x; 3 | { 4 | double acos(); 5 | return( acos(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_asin.c: -------------------------------------------------------------------------------- 1 | double r_asin(x) 2 | float *x; 3 | { 4 | double asin(); 5 | return( asin(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_atan.c: -------------------------------------------------------------------------------- 1 | double r_atan(x) 2 | float *x; 3 | { 4 | double atan(); 5 | return( atan(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_atn2.c: -------------------------------------------------------------------------------- 1 | double r_atn2(x,y) 2 | float *x, *y; 3 | { 4 | double atan2(); 5 | return( atan2(*x,*y) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_cnjg.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | r_cnjg(r, z) 4 | complex *r, *z; 5 | { 6 | r->real = z->real; 7 | r->imag = - z->imag; 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libF77/r_cos.c: -------------------------------------------------------------------------------- 1 | double r_cos(x) 2 | float *x; 3 | { 4 | double cos(); 5 | return( cos(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_cosh.c: -------------------------------------------------------------------------------- 1 | double r_cosh(x) 2 | float *x; 3 | { 4 | double cosh(); 5 | return( cosh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_dim.c: -------------------------------------------------------------------------------- 1 | double r_dim(a,b) 2 | float *a, *b; 3 | { 4 | return( *a > *b ? *a - *b : 0); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/r_exp.c: -------------------------------------------------------------------------------- 1 | double r_exp(x) 2 | float *x; 3 | { 4 | double exp(); 5 | return( exp(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_imag.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | double r_imag(z) 4 | complex *z; 5 | { 6 | return(z->imag); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/r_int.c: -------------------------------------------------------------------------------- 1 | double r_int(x) 2 | float *x; 3 | { 4 | return( (long int) (*x) ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/r_lg10.c: -------------------------------------------------------------------------------- 1 | #define log10e 0.43429448190325182765 2 | 3 | double r_lg10(x) 4 | float *x; 5 | { 6 | double log(); 7 | 8 | return( log10e * log(*x) ); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libF77/r_log.c: -------------------------------------------------------------------------------- 1 | double r_log(x) 2 | float *x; 3 | { 4 | double log(); 5 | return( log(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_mod.c: -------------------------------------------------------------------------------- 1 | double r_mod(x,y) 2 | float *x, *y; 3 | { 4 | return(*x - (*y) * ( (long int) (*x / *y)) ); 5 | } 6 | -------------------------------------------------------------------------------- /usr/src/libF77/r_nint.c: -------------------------------------------------------------------------------- 1 | double r_nint(x) 2 | float *x; 3 | { 4 | return( (*x)>=0 ? 5 | (long int) (*x + .5) : (long int) (*x - .5) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_sign.c: -------------------------------------------------------------------------------- 1 | double r_sign(a,b) 2 | float *a, *b; 3 | { 4 | float x; 5 | x = (*a >= 0 ? *a : - *a); 6 | return( *b >= 0 ? x : -x); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libF77/r_sin.c: -------------------------------------------------------------------------------- 1 | double r_sin(x) 2 | float *x; 3 | { 4 | double sin(); 5 | return( sin(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_sinh.c: -------------------------------------------------------------------------------- 1 | double r_sinh(x) 2 | float *x; 3 | { 4 | double sinh(); 5 | return( sinh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_sqrt.c: -------------------------------------------------------------------------------- 1 | double r_sqrt(x) 2 | float *x; 3 | { 4 | double sqrt(); 5 | return( sqrt(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_tan.c: -------------------------------------------------------------------------------- 1 | double r_tan(x) 2 | float *x; 3 | { 4 | double tan(); 5 | return( tan(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/r_tanh.c: -------------------------------------------------------------------------------- 1 | double r_tanh(x) 2 | float *x; 3 | { 4 | double tanh(); 5 | return( tanh(*x) ); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libF77/s_cat.c: -------------------------------------------------------------------------------- 1 | s_cat(lp, rpp, rnp, np, ll) 2 | char *lp, *rpp[]; 3 | long int rnp[], *np, ll; 4 | { 5 | int i, n, nc; 6 | char *rp; 7 | 8 | n = *np; 9 | for(i = 0 ; i < n ; ++i) 10 | { 11 | nc = ll; 12 | if(rnp[i] < nc) 13 | nc = rnp[i]; 14 | ll -= nc; 15 | rp = rpp[i]; 16 | while(--nc >= 0) 17 | *lp++ = *rp++; 18 | } 19 | while(--ll >= 0) 20 | *lp++ = ' '; 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libF77/s_cmp.c: -------------------------------------------------------------------------------- 1 | int s_cmp(a, b, la, lb) /* compare two strings */ 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | char *aend, *bend; 6 | aend = a + la; 7 | 8 | if(la <= lb) 9 | { 10 | while(a < aend) 11 | if(*a != *b) 12 | return( *a - *b ); 13 | else 14 | { ++a; ++b; } 15 | 16 | } 17 | 18 | else 19 | { 20 | bend = b + lb; 21 | while(b < bend) 22 | if(*a == *b) 23 | { ++a; ++b; } 24 | else 25 | return( *a - *b ); 26 | while(a < aend) 27 | if(*a != ' ') 28 | return(*a - ' '); 29 | else ++a; 30 | } 31 | return(0); 32 | } 33 | -------------------------------------------------------------------------------- /usr/src/libF77/s_copy.c: -------------------------------------------------------------------------------- 1 | s_copy(a, b, la, lb) /* assign strings: a = b */ 2 | char *a, *b; 3 | long int la, lb; 4 | { 5 | char *aend, *bend; 6 | 7 | aend = a + la; 8 | 9 | if(la <= lb) 10 | while(a < aend) 11 | *a++ = *b++; 12 | 13 | else 14 | { 15 | bend = b + lb; 16 | while(b < bend) 17 | *a++ = *b++; 18 | while(a < aend) 19 | *a++ = ' '; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libF77/s_rnge.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* called when a subscript is out of range */ 4 | 5 | s_rnge(varn, offset, procn, line) 6 | char *varn, *procn; 7 | long int offset; 8 | int line; 9 | { 10 | register int i; 11 | 12 | fprintf(stderr, "Subscript out of range on file line %d, procedure ", line); 13 | for(i = 0 ; i < 8 && *procn!='_' ; ++i) 14 | putc(*procn++, stderr); 15 | fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); 16 | for(i = 0 ; i < 6 && *varn!=' ' ; ++i) 17 | putc(*varn++, stderr); 18 | fprintf(stderr, ".\n"); 19 | _cleanup(); 20 | abort(); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libF77/s_stop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | s_stop(s, n) 4 | char *s; 5 | long int n; 6 | { 7 | int i; 8 | 9 | if(n > 0) 10 | { 11 | fprintf(stderr, "STOP "); 12 | for(i = 0; idreal, z->dimag ) ); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libF77/z_cos.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | z_cos(r, z) 4 | dcomplex *r, *z; 5 | { 6 | double sin(), cos(), sinh(), cosh(); 7 | 8 | r->dreal = cos(z->dreal) * cosh(z->dimag); 9 | r->dimag = - sin(z->dreal) * sinh(z->dimag); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/z_exp.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | z_exp(r, z) 4 | dcomplex *r, *z; 5 | { 6 | double expx; 7 | double exp(), cos(), sin(); 8 | 9 | expx = exp(z->dreal); 10 | r->dreal = expx * cos(z->dimag); 11 | r->dimag = expx * sin(z->dimag); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/libF77/z_log.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | z_log(r, z) 4 | dcomplex *r, *z; 5 | { 6 | double log(), cabs(), atan2(); 7 | 8 | r->dimag = atan2(z->dimag, z->dreal); 9 | r->dreal = log( cabs( z->dreal, z->dimag ) ); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/z_sin.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | z_sin(r, z) 4 | dcomplex *r, *z; 5 | { 6 | double sin(), cos(), sinh(), cosh(); 7 | 8 | r->dreal = sin(z->dreal) * cosh(z->dimag); 9 | r->dimag = cos(z->dreal) * sinh(z->dimag); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libF77/z_sqrt.c: -------------------------------------------------------------------------------- 1 | #include "complex" 2 | 3 | z_sqrt(r, z) 4 | dcomplex *r, *z; 5 | { 6 | double mag, sqrt(), cabs(); 7 | 8 | if( (mag = cabs(z->dreal, z->dimag)) == 0.) 9 | r->dreal = r->dimag = 0.; 10 | else if(z->dreal > 0) 11 | { 12 | r->dreal = sqrt(0.5 * (mag + z->dreal) ); 13 | r->dimag = z->dimag / r->dreal / 2; 14 | } 15 | else 16 | { 17 | r->dimag = sqrt(0.5 * (mag - z->dreal) ); 18 | if(z->dimag < 0) 19 | z->dimag = - z->dimag; 20 | r->dreal = z->dimag / r->dimag / 2; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/libI77/compall: -------------------------------------------------------------------------------- 1 | cc -c -O *.c 2 | -------------------------------------------------------------------------------- /usr/src/libI77/fmtlib.c: -------------------------------------------------------------------------------- 1 | #define MAXINTLENGTH 12 2 | char *icvt(value,ndigit,sign, base) long value; int *ndigit,*sign; 3 | register int base; 4 | { static char buf[MAXINTLENGTH+1]; 5 | register int i; 6 | if(value>0) *sign=0; 7 | else if(value<0) 8 | { value = -value; 9 | *sign= 1; 10 | } 11 | else 12 | { *sign=0; 13 | *ndigit=1; 14 | buf[MAXINTLENGTH]='0'; 15 | return(&buf[MAXINTLENGTH]); 16 | } 17 | for(i=MAXINTLENGTH-1;value>0;i--) 18 | { *(buf+i)=(int)(value%base)+'0'; 19 | value /= base; 20 | } 21 | *ndigit=MAXINTLENGTH-1-i; 22 | return(&buf[i+1]); 23 | } 24 | -------------------------------------------------------------------------------- /usr/src/libI77/lib.c: -------------------------------------------------------------------------------- 1 | #include "fio.h" 2 | setcilist(x,u,fmt,rec,xerr,end) cilist *x; 3 | char *fmt; 4 | { 5 | x->ciunit=u; 6 | x->cifmt=fmt; 7 | x->cirec=rec; 8 | x->cierr=xerr; 9 | x->ciend=end; 10 | } 11 | setolist(x,xunit,fname,sta,fm,rl,blnk,oerr) olist *x; 12 | char *fname,*sta,*fm,*blnk; 13 | { 14 | x->oerr=oerr; 15 | x->ounit=xunit; 16 | x->ofnm=fname; 17 | x->ofnmlen=strlen(fname); 18 | x->osta=sta; 19 | x->ofm=fm; 20 | x->orl=rl; 21 | x->oblnk=blnk; 22 | } 23 | stcllist(x,xunit,stat,cerr) cllist *x; char *stat; 24 | { 25 | x->cerr=cerr; 26 | x->cunit=xunit; 27 | x->csta=stat; 28 | } 29 | setalist(x,xunit,aerr) alist *x; 30 | { 31 | x->aunit=xunit; 32 | x->aerr=aerr; 33 | } 34 | -------------------------------------------------------------------------------- /usr/src/libI77/mklib: -------------------------------------------------------------------------------- 1 | ar rc libI77.a \ 2 | backspace.o \ 3 | dfe.o \ 4 | due.o \ 5 | iio.o \ 6 | inquire.o \ 7 | lib.o \ 8 | rewind.o \ 9 | rsfe.o \ 10 | rdfmt.o \ 11 | sue.o \ 12 | uio.o \ 13 | wsfe.o \ 14 | sfe.o \ 15 | fmt.o \ 16 | lio.o \ 17 | lread.o \ 18 | open.o \ 19 | close.o \ 20 | util.o \ 21 | endfile.o \ 22 | wrtfmt.o \ 23 | err.o \ 24 | fmtlib.o \ 25 | dballoc.o 26 | -------------------------------------------------------------------------------- /usr/src/libI77/rewind.c: -------------------------------------------------------------------------------- 1 | #include "fio.h" 2 | f_rew(a) alist *a; 3 | { 4 | unit *b; 5 | if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"rewind"); 6 | b = &units[a->aunit]; 7 | if(b->ufd == NULL) return(0); 8 | if(!b->useek) err(a->aerr,106,"rewind") 9 | if(b->uwrt) 10 | { nowreading(b); 11 | t_runc(b); 12 | } 13 | rewind(b->ufd); 14 | b->uend=0; 15 | return(0); 16 | } 17 | -------------------------------------------------------------------------------- /usr/src/libI77/sfe.c: -------------------------------------------------------------------------------- 1 | /* sequential formatted external common routines*/ 2 | #include "fio.h" 3 | extern char *fmtbuf; 4 | e_rsfe() 5 | { int n; 6 | n=en_fio(); 7 | fmtbuf=NULL; 8 | return(n); 9 | } 10 | c_sfe(a,flag) cilist *a; /* check */ 11 | { unit *p; 12 | if(a->ciunit >= MXUNIT || a->ciunit<0) 13 | err(a->cierr,101,"startio"); 14 | p = &units[a->ciunit]; 15 | if(p->ufd==NULL && fk_open(flag,SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe") 16 | if(!p->ufmt) err(a->cierr,102,"sfe") 17 | return(0); 18 | } 19 | e_wsfe() 20 | { return(e_rsfe()); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libc/crt/almul.s: -------------------------------------------------------------------------------- 1 | / 2 | / 32-bit multiplication routine for fixed pt hardware. 3 | / Implements *= operator 4 | / Credit to an unknown author who slipped it under the door. 5 | .globl almul 6 | .globl csv, cret 7 | 8 | almul: 9 | jsr r5,csv 10 | mov 4(r5),r4 11 | mov 2(r4),r2 12 | sxt r1 13 | sub (r4),r1 14 | mov 8.(r5),r0 15 | sxt r3 16 | sub 6.(r5),r3 17 | mul r0,r1 18 | mul r2,r3 19 | add r1,r3 20 | mul r2,r0 21 | sub r3,r0 22 | mov r0,(r4)+ 23 | mov r1,(r4) 24 | jmp cret 25 | -------------------------------------------------------------------------------- /usr/src/libc/crt/armv6k/__aeabi_idiv0.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | void __aeabi_idiv0(void) 4 | { 5 | abort(); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libc/crt/armv6k/cerror.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .arm 3 | .section .text 4 | 5 | .extern errno 6 | 7 | .global cerror 8 | .type cerror,%function 9 | cerror: 10 | ldr r2, =errno @ load up the address of errno 11 | str r0, [r2] @ save the errno 12 | mov r0, #-1 @ set the return to -1 13 | bx lr 14 | .size cerror, . - cerror 15 | -------------------------------------------------------------------------------- /usr/src/libc/crt/cerror.s: -------------------------------------------------------------------------------- 1 | / C return sequence which 2 | / sets errno, returns -1. 3 | 4 | .globl cerror 5 | .comm _errno,2 6 | 7 | cerror: 8 | mov r0,_errno 9 | mov $-1,r0 10 | mov r5,sp 11 | mov (sp)+,r5 12 | rts pc 13 | -------------------------------------------------------------------------------- /usr/src/libc/crt/csv.s: -------------------------------------------------------------------------------- 1 | / C register save and restore -- version 7/75 2 | 3 | .globl csv 4 | .globl cret 5 | 6 | csv: 7 | mov r5,r0 8 | mov sp,r5 9 | mov r4,-(sp) 10 | mov r3,-(sp) 11 | mov r2,-(sp) 12 | jsr pc,(r0) / jsr part is sub $2,sp 13 | 14 | cret: 15 | mov r5,r2 16 | mov -(r2),r4 17 | mov -(r2),r3 18 | mov -(r2),r2 19 | mov r5,sp 20 | mov (sp)+,r5 21 | rts pc 22 | -------------------------------------------------------------------------------- /usr/src/libc/crt/lmul.s: -------------------------------------------------------------------------------- 1 | / 2 | / 32-bit multiplication routine for fixed pt hardware. 3 | / Implements * operator 4 | / Credit to an unknown author who slipped it under the door. 5 | .globl lmul 6 | .globl csv, cret 7 | 8 | lmul: 9 | jsr r5,csv 10 | mov 6(r5),r2 11 | sxt r1 12 | sub 4(r5),r1 13 | mov 10.(r5),r0 14 | sxt r3 15 | sub 8.(r5),r3 16 | mul r0,r1 17 | mul r2,r3 18 | add r1,r3 19 | mul r2,r0 20 | sub r3,r0 21 | jmp cret 22 | -------------------------------------------------------------------------------- /usr/src/libc/crt/mcount.s: -------------------------------------------------------------------------------- 1 | / count subroutine calls during profiling 2 | 3 | .globl mcount 4 | .comm countbase,2 5 | 6 | mcount: 7 | mov (r0),r1 8 | bne 1f 9 | mov countbase,r1 10 | beq 2f 11 | add $6,countbase 12 | mov (sp),(r1)+ 13 | mov r1,(r0) 14 | 1: 15 | inc 2(r1) 16 | bne 2f 17 | inc (r1) 18 | 2: 19 | rts pc 20 | 21 | -------------------------------------------------------------------------------- /usr/src/libc/csu/crt0.s: -------------------------------------------------------------------------------- 1 | / C runtime startoff 2 | 3 | .globl _exit, _environ 4 | .globl start 5 | .globl _main 6 | exit = 1. 7 | 8 | start: 9 | setd 10 | mov 2(sp),r0 11 | clr -2(r0) 12 | mov sp,r0 13 | sub $4,sp 14 | mov 4(sp),(sp) 15 | tst (r0)+ 16 | mov r0,2(sp) 17 | 1: 18 | tst (r0)+ 19 | bne 1b 20 | cmp r0,*2(sp) 21 | blo 1f 22 | tst -(r0) 23 | 1: 24 | mov r0,4(sp) 25 | mov r0,_environ 26 | jsr pc,_main 27 | cmp (sp)+,(sp)+ 28 | mov r0,(sp) 29 | jsr pc,*$_exit 30 | sys exit 31 | 32 | .bss 33 | _environ: 34 | .=.+2 35 | .data 36 | .=.+2 / loc 0 for I/D; null ptr points here. 37 | -------------------------------------------------------------------------------- /usr/src/libc/csu/fcrt0.s: -------------------------------------------------------------------------------- 1 | / C runtime startoff 2 | / with floating point interpreter 3 | 4 | .globl fptrap 5 | .globl _exit 6 | .globl _main 7 | .globl _environ 8 | exit = 1. 9 | signal = 48. 10 | 11 | start: 12 | sys signal; 4; fptrap 13 | setd 14 | mov 2(sp),r0 15 | clr -2(r0) 16 | mov sp,r0 17 | sub $4,sp 18 | mov 4(sp),(sp) 19 | tst (r0)+ 20 | mov r0,2(sp) 21 | 1: 22 | tst (r0)+ 23 | bne 1b 24 | cmp r0,*2(sp) 25 | blo 1f 26 | tst -(r0) 27 | 1: 28 | mov r0,4(sp) 29 | mov r0,_environ 30 | jsr pc,_main 31 | cmp (sp)+,(sp)+ 32 | mov r0,(sp) 33 | jsr pc,*$_exit 34 | sys exit 35 | .bss 36 | _environ: 37 | .=.+2 38 | .data 39 | .=.+2 40 | -------------------------------------------------------------------------------- /usr/src/libc/gen/abort.s: -------------------------------------------------------------------------------- 1 | / C library -- abort 2 | 3 | .globl _abort 4 | iot = 4 5 | .globl csv,cret 6 | 7 | _abort: 8 | jsr r5,csv 9 | iot 10 | clr r0 11 | jmp cret 12 | -------------------------------------------------------------------------------- /usr/src/libc/gen/abs.c: -------------------------------------------------------------------------------- 1 | abs(arg) 2 | { 3 | 4 | if(arg < 0) 5 | arg = -arg; 6 | return(arg); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libc/gen/armv6k/abort.c: -------------------------------------------------------------------------------- 1 | #include "../../../../include/signal.h" 2 | 3 | extern int kill(int pid, int signum); 4 | extern int getpid(void); 5 | 6 | void abort(void) 7 | { 8 | kill(getpid(), SIGIOT); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libc/gen/armv6k/l3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Convert longs to and from 3-byte disk addresses 3 | */ 4 | ltol3(cp, lp, n) 5 | char *cp; 6 | long *lp; 7 | int n; 8 | { 9 | register i; 10 | register char *a; 11 | 12 | a = cp; 13 | for(i=0;i> 0) & 0xff; 15 | *a++ = ((*lp) >> 8) & 0xff; 16 | *a++ = ((*lp) >> 16) & 0xff; 17 | lp++; 18 | } 19 | } 20 | 21 | l3tol(lp, cp, n) 22 | long *lp; 23 | char *cp; 24 | int n; 25 | { 26 | register i; 27 | register char *b; 28 | 29 | b = cp; 30 | for(i=0;i= '0' && *p <= '9') 22 | n = n*10 + *p++ - '0'; 23 | return(f? -n: n); 24 | } 25 | -------------------------------------------------------------------------------- /usr/src/libc/gen/atol.c: -------------------------------------------------------------------------------- 1 | long 2 | atol(p) 3 | register char *p; 4 | { 5 | long n; 6 | register int f; 7 | 8 | n = 0; 9 | f = 0; 10 | for(;;p++) { 11 | switch(*p) { 12 | case ' ': 13 | case '\t': 14 | continue; 15 | case '-': 16 | f++; 17 | case '+': 18 | p++; 19 | } 20 | break; 21 | } 22 | while(*p >= '0' && *p <= '9') 23 | n = n*10 + *p++ - '0'; 24 | return(f? -n: n); 25 | } 26 | -------------------------------------------------------------------------------- /usr/src/libc/gen/calloc.c: -------------------------------------------------------------------------------- 1 | /* calloc - allocate and clear memory block 2 | */ 3 | #define CHARPERINT (sizeof(int)/sizeof(char)) 4 | #define NULL 0 5 | 6 | char * 7 | calloc(num, size) 8 | unsigned num, size; 9 | { 10 | register char *mp; 11 | char *malloc(); 12 | register int *q; 13 | register m; 14 | 15 | num *= size; 16 | mp = malloc(num); 17 | if(mp == NULL) 18 | return(NULL); 19 | q = (int *) mp; 20 | m = (num+CHARPERINT-1)/CHARPERINT; 21 | while(--m>=0) 22 | *q++ = 0; 23 | return(mp); 24 | } 25 | 26 | cfree(p, num, size) 27 | char *p; 28 | unsigned num, size; 29 | { 30 | free(p); 31 | } 32 | -------------------------------------------------------------------------------- /usr/src/libc/gen/ctype_.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char _ctype_[] = { 4 | 0, 5 | _C, _C, _C, _C, _C, _C, _C, _C, 6 | _C, _S, _S, _S, _S, _S, _C, _C, 7 | _C, _C, _C, _C, _C, _C, _C, _C, 8 | _C, _C, _C, _C, _C, _C, _C, _C, 9 | _S, _P, _P, _P, _P, _P, _P, _P, 10 | _P, _P, _P, _P, _P, _P, _P, _P, 11 | _N, _N, _N, _N, _N, _N, _N, _N, 12 | _N, _N, _P, _P, _P, _P, _P, _P, 13 | _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, 14 | _U, _U, _U, _U, _U, _U, _U, _U, 15 | _U, _U, _U, _U, _U, _U, _U, _U, 16 | _U, _U, _U, _P, _P, _P, _P, _P, 17 | _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, 18 | _L, _L, _L, _L, _L, _L, _L, _L, 19 | _L, _L, _L, _L, _L, _L, _L, _L, 20 | _L, _L, _L, _P, _P, _P, _P, _C 21 | }; 22 | -------------------------------------------------------------------------------- /usr/src/libc/gen/cuexit.s: -------------------------------------------------------------------------------- 1 | / C library -- exit 2 | 3 | / exit(code) 4 | / code is return in r0 to system 5 | 6 | .globl _exit 7 | .globl __cleanup 8 | exit = 1 9 | 10 | _exit: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | jsr pc,__cleanup 14 | mov 4(r5),r0 15 | sys exit 16 | 17 | -------------------------------------------------------------------------------- /usr/src/libc/gen/fakcu.s: -------------------------------------------------------------------------------- 1 | / 2 | / dummy cleanup routine if none supplied by user. 3 | 4 | .globl __cleanup 5 | 6 | __cleanup: 7 | rts pc 8 | -------------------------------------------------------------------------------- /usr/src/libc/gen/fakfp.s: -------------------------------------------------------------------------------- 1 | / fakefp -- fake floating point simulator 2 | 3 | .globl fptrap 4 | signal = 48. 5 | rti = 2 6 | 7 | fptrap: 8 | sub $2,(sp) 9 | mov r0,-(sp) 10 | sys signal; 4; 0 11 | mov (sp)+,r0 12 | rti 13 | -------------------------------------------------------------------------------- /usr/src/libc/gen/frexp11.s: -------------------------------------------------------------------------------- 1 | / double frexp(x, ip) 2 | / double x; int *ip; 3 | / returns a fractional part 1/16 <= |value| < 1 4 | / and stores an exponent so x = value * 2^(*ip) 5 | 6 | .globl _frexp 7 | .globl csv, cret 8 | 9 | _frexp: 10 | jsr r5,csv 11 | movf 4(r5),fr0 12 | movei fr0,r0 13 | clr r1 14 | movie r1,fr0 15 | mov r0,*12.(r5) 16 | jmp cret 17 | -------------------------------------------------------------------------------- /usr/src/libc/gen/getlogin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static char UTMP[] = "/etc/utmp"; 4 | static struct utmp ubuf; 5 | 6 | char * 7 | getlogin() 8 | { 9 | register me, uf; 10 | register char *cp; 11 | 12 | if( !(me = ttyslot()) ) 13 | return(0); 14 | if( (uf = open( UTMP, 0 )) < 0 ) 15 | return(0); 16 | lseek( uf, (long)(me*sizeof(ubuf)), 0 ); 17 | if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf)) 18 | return(0); 19 | close(uf); 20 | ubuf.ut_name[8] = ' '; 21 | for (cp=ubuf.ut_name; *cp++!=' ';) 22 | ; 23 | *--cp = '\0'; 24 | return( ubuf.ut_name ); 25 | } 26 | -------------------------------------------------------------------------------- /usr/src/libc/gen/index.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Return the ptr in sp at which the character c appears; 3 | * NULL if not found 4 | */ 5 | 6 | #define NULL 0 7 | 8 | char * 9 | index(sp, c) 10 | register char *sp, c; 11 | { 12 | do { 13 | if (*sp == c) 14 | return(sp); 15 | } while (*sp++); 16 | return(NULL); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/libc/gen/isatty.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Returns 1 iff file is a tty 3 | */ 4 | 5 | #include 6 | 7 | isatty(f) 8 | { 9 | struct sgttyb ttyb; 10 | 11 | if (gtty(f, &ttyb) < 0) 12 | return(0); 13 | return(1); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/gen/ldexp11.s: -------------------------------------------------------------------------------- 1 | / double ldexp(number, exp) 2 | / double number 3 | / -- returns number * 2^exp 4 | 5 | .globl _ldexp 6 | .globl csv, cret 7 | 8 | ERANGE = 34. 9 | 10 | _ldexp: 11 | jsr r5,csv 12 | movf 4(r5),fr0 13 | movei fr0,r0 14 | add 12.(r5),r0 15 | movie r0,fr0 16 | cfcc 17 | bvc 1f 18 | bmi 2f 19 | movf huge,fr0 20 | br 3f 21 | 2: 22 | movf huge,fr0 23 | negf fr0 24 | 3: 25 | mov $ERANGE,_errno 26 | 1: 27 | jmp cret 28 | 29 | .comm _errno,2 30 | .data 31 | huge: 077777; 0177776; 0177777; 0177777 32 | -------------------------------------------------------------------------------- /usr/src/libc/gen/ldfps.s: -------------------------------------------------------------------------------- 1 | ldfps = 170100^tst 2 | / 3 | / ldfps(number); 4 | 5 | .globl _ldfps 6 | _ldfps: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | ldfps 4(r5) 10 | mov (sp)+,r5 11 | rts pc 12 | -------------------------------------------------------------------------------- /usr/src/libc/gen/mktemp.c: -------------------------------------------------------------------------------- 1 | char * 2 | mktemp(as) 3 | char *as; 4 | { 5 | register char *s; 6 | register unsigned pid; 7 | register i; 8 | 9 | pid = getpid(); 10 | s = as; 11 | while (*s++) 12 | ; 13 | s--; 14 | while (*--s == 'X') { 15 | *s = (pid%10) + '0'; 16 | pid /= 10; 17 | } 18 | s++; 19 | i = 'a'; 20 | while (access(as, 0) != -1) { 21 | if (i=='z') 22 | return("/"); 23 | *s = i++; 24 | } 25 | return(as); 26 | } 27 | -------------------------------------------------------------------------------- /usr/src/libc/gen/modf11.s: -------------------------------------------------------------------------------- 1 | / double modf(x, *fp) 2 | / double x, *fp; 3 | / return fractional part 4 | / stash integer part (as double) 5 | 6 | .globl _modf 7 | .globl csv, cret 8 | one = 040200 9 | 10 | _modf: 11 | jsr r5,csv 12 | movf 4(r5),fr0 13 | modf $one,fr0 14 | movf fr1,*12.(r5) 15 | jmp cret 16 | -------------------------------------------------------------------------------- /usr/src/libc/gen/mon.c: -------------------------------------------------------------------------------- 1 | monitor(lowpc, highpc, buf, bufsiz, cntsiz) 2 | char *lowpc, *highpc; 3 | int *buf, bufsiz; 4 | { 5 | register o; 6 | static *sbuf, ssiz; 7 | 8 | if (lowpc == 0) { 9 | profil(0, 0, 0, 0); 10 | o = creat("mon.out", 0666); 11 | write(o, sbuf, ssiz<<1); 12 | close(o); 13 | return; 14 | } 15 | ssiz = bufsiz; 16 | buf[0] = (int)lowpc; 17 | buf[1] = (int)highpc; 18 | buf[2] = cntsiz; 19 | sbuf = buf; 20 | buf += 3*(cntsiz+1); 21 | bufsiz -= 3*(cntsiz+1); 22 | if (bufsiz<=0) 23 | return; 24 | o = ((highpc - lowpc)>>1) & 077777; 25 | if(bufsiz < o) 26 | o = ((long)bufsiz<<15) / o; 27 | else 28 | o = 077777; 29 | profil(buf, bufsiz<<1, lowpc, o<<1); 30 | } 31 | -------------------------------------------------------------------------------- /usr/src/libc/gen/perror.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Print the error indicated 3 | * in the cerror cell. 4 | */ 5 | 6 | int errno; 7 | extern int sys_nerr; 8 | extern char *sys_errlist[]; 9 | perror(s) 10 | char *s; 11 | { 12 | register char *c; 13 | register n; 14 | 15 | c = "Unknown error"; 16 | if(errno < sys_nerr) 17 | c = sys_errlist[errno]; 18 | n = strlen(s); 19 | if(n) { 20 | write(2, s, n); 21 | write(2, ": ", 2); 22 | } 23 | write(2, c, strlen(c)); 24 | write(2, "\n", 1); 25 | } 26 | -------------------------------------------------------------------------------- /usr/src/libc/gen/rand.c: -------------------------------------------------------------------------------- 1 | static long randx = 1; 2 | 3 | srand(x) 4 | unsigned x; 5 | { 6 | randx = x; 7 | } 8 | 9 | rand() 10 | { 11 | return(((randx = randx*1103515245 + 12345)>>16) & 077777); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/libc/gen/rindex.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Return the ptr in sp at which the character c last 3 | * appears; NULL if not found 4 | */ 5 | 6 | #define NULL 0 7 | 8 | char * 9 | rindex(sp, c) 10 | register char *sp, c; 11 | { 12 | register char *r; 13 | 14 | r = NULL; 15 | do { 16 | if (*sp == c) 17 | r = sp; 18 | } while (*sp++); 19 | return(r); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/libc/gen/setjmp.s: -------------------------------------------------------------------------------- 1 | / C library -- setjmp, longjmp 2 | 3 | / longjmp(a,v) 4 | / will generate a "return(v)" from 5 | / the last call to 6 | / setjmp(a) 7 | / by restoring sp, r5, pc from `a' 8 | / and doing a return. 9 | / 10 | 11 | .globl _setjmp 12 | .globl _longjmp 13 | .globl csv, cret 14 | 15 | _setjmp: 16 | mov 2(sp),r0 17 | mov r5,(r0)+ 18 | mov sp,(r0)+ 19 | mov (sp),(r0) 20 | clr r0 21 | rts pc 22 | 23 | _longjmp: 24 | jsr r5,csv 25 | mov 4(r5),r1 26 | mov 6(r5),r0 27 | bne 1f 28 | mov $1,r0 29 | 1: 30 | cmp (r5),(r1) 31 | beq 1f 32 | mov (r5),r5 33 | bne 1b 34 | / panic -- r2-r4 lost 35 | mov (r1)+,r5 36 | mov (r1)+,sp 37 | mov (r1),(sp) 38 | rts pc 39 | 1: 40 | mov 4(r1),2(r5) 41 | jmp cret 42 | 43 | -------------------------------------------------------------------------------- /usr/src/libc/gen/sleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static jmp_buf jmp; 5 | 6 | static int sleepx(void); 7 | 8 | sleep(n) 9 | unsigned n; 10 | { 11 | unsigned altime; 12 | int (*alsig)() = SIG_DFL; 13 | 14 | if (n==0) 15 | return; 16 | altime = alarm(1000); /* time to maneuver */ 17 | if (setjmp(jmp)) { 18 | signal(SIGALRM, alsig); 19 | alarm(altime); 20 | return; 21 | } 22 | if (altime) { 23 | if (altime > n) 24 | altime -= n; 25 | else { 26 | n = altime; 27 | altime = 1; 28 | } 29 | } 30 | alsig = signal(SIGALRM, sleepx); 31 | alarm(n); 32 | for(;;) 33 | pause(); 34 | /*NOTREACHED*/ 35 | } 36 | 37 | static 38 | sleepx() 39 | { 40 | longjmp(jmp, 1); 41 | } 42 | -------------------------------------------------------------------------------- /usr/src/libc/gen/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Concatenate s2 on the end of s1. S1's space must be large enough. 3 | * Return s1. 4 | */ 5 | 6 | char * 7 | strcat(s1, s2) 8 | register char *s1, *s2; 9 | { 10 | register char *os1; 11 | 12 | os1 = s1; 13 | while (*s1++) 14 | ; 15 | --s1; 16 | while (*s1++ = *s2++) 17 | ; 18 | return(os1); 19 | } 20 | -------------------------------------------------------------------------------- /usr/src/libc/gen/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Compare strings: s1>s2: >0 s1==s2: 0 s1s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) 11 | if (*s1++ == '\0') 12 | return(0); 13 | return(n<0 ? 0 : *s1 - *--s2); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/gen/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copy s2 to s1, truncating or null-padding to always copy n bytes 3 | * return s1 4 | */ 5 | 6 | char * 7 | strncpy(s1, s2, n) 8 | register char *s1, *s2; 9 | { 10 | register i; 11 | register char *os1; 12 | 13 | os1 = s1; 14 | for (i = 0; i < n; i++) 15 | if ((*s1++ = *s2++) == '\0') { 16 | while (++i < n) 17 | *s1++ = '\0'; 18 | return(os1); 19 | } 20 | return(os1); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libc/gen/stty.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Writearound to old stty and gtty system calls 3 | */ 4 | 5 | #include 6 | 7 | stty(fd, ap) 8 | struct sgtty *ap; 9 | { 10 | return(ioctl(fd, TIOCSETP, ap)); 11 | } 12 | 13 | gtty(fd, ap) 14 | struct sgtty *ap; 15 | { 16 | return(ioctl(fd, TIOCGETP, ap)); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/libc/gen/swab.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Swap bytes in 16-bit [half-]words 3 | * for going between the 11 and the interdata 4 | */ 5 | 6 | swab(pf, pt, n) 7 | register short *pf, *pt; 8 | register n; 9 | { 10 | 11 | n /= 2; 12 | while (--n >= 0) { 13 | *pt++ = (*pf << 8) + ((*pf >> 8) & 0377); 14 | pf++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /usr/src/libc/gen/tell.c: -------------------------------------------------------------------------------- 1 | /* 2 | * return offset in file. 3 | */ 4 | 5 | long lseek(); 6 | 7 | long tell(f) 8 | { 9 | return(lseek(f, 0L, 1)); 10 | } 11 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/armv6k/fprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern void _doprnt(struct _iobuf *buf, const char* format, va_list va); 5 | 6 | int vfprintf(FILE *iop, const char *fmt, va_list va) 7 | { 8 | _doprnt(iop, fmt, va); 9 | return(ferror(iop)? EOF: 0); 10 | } 11 | 12 | int fprintf(FILE *iop, const char *fmt, ...) 13 | { 14 | va_list va; 15 | va_start(va, fmt); 16 | _doprnt(iop, fmt, va); 17 | va_end(va); 18 | return(ferror(iop)? EOF: 0); 19 | } 20 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/armv6k/printf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern void _doprnt(struct _iobuf *buf, const char* format, va_list va); 5 | 6 | int printf(const char *fmt, ...) 7 | { 8 | va_list va; 9 | va_start(va, fmt); 10 | _doprnt(stdout, fmt, va); 11 | va_end(va); 12 | return(ferror(stdout)? EOF: 0); 13 | } 14 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/armv6k/sprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern void _doprnt(struct _iobuf *buf, const char* format, va_list va); 5 | extern int _flsbuf(int c, FILE *iop); 6 | 7 | char *sprintf(char *str, char *fmt, ...) 8 | { 9 | va_list va; 10 | struct _iobuf _strbuf; 11 | 12 | _strbuf._flag = _IOWRT+_IOSTRG; 13 | _strbuf._ptr = str; 14 | _strbuf._cnt = 32767; 15 | va_start(va, fmt); 16 | _doprnt(&_strbuf, fmt, va); 17 | va_end(va); 18 | putc('\0', &_strbuf); 19 | return(str); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/clrerr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | clearerr(iop) 4 | register struct _iobuf *iop; 5 | { 6 | iop->_flag &= ~(_IOERR|_IOEOF); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/data.c: -------------------------------------------------------------------------------- 1 | #include 2 | char _sibuf[BUFSIZ]; 3 | char _sobuf[BUFSIZ]; 4 | 5 | struct _iobuf _iob[_NFILE] = { 6 | { _sibuf, 0, _sibuf, _IOREAD, 0}, 7 | { NULL, 0, NULL, _IOWRT, 1}, 8 | {NULL, 0, NULL, _IOWRT+_IONBF, 2}, 9 | }; 10 | /* 11 | * Ptr to end of buffers 12 | */ 13 | struct _iobuf *_lastbuf = { &_iob[_NFILE] }; 14 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/ffltpr.s: -------------------------------------------------------------------------------- 1 | / C library-- fake floating output 2 | 3 | .globl pfloat 4 | .globl pscien 5 | .globl pgen 6 | 7 | pfloat: 8 | pscien: 9 | pgen: 10 | add $8,r4 11 | movb $'?,(r3)+ 12 | rts pc 13 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fgetc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | fgetc(fp) 4 | FILE *fp; 5 | { 6 | return(getc(fp)); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fgets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char * 4 | fgets(s, n, iop) 5 | char *s; 6 | register FILE *iop; 7 | { 8 | register c; 9 | register char *cs; 10 | 11 | cs = s; 12 | while (--n>0 && (c = getc(iop))>=0) { 13 | *cs++ = c; 14 | if (c=='\n') 15 | break; 16 | } 17 | if (c<0 && cs==s) 18 | return(NULL); 19 | *cs++ = '\0'; 20 | return(s); 21 | } 22 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/findiop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE * 4 | _findiop() 5 | { 6 | extern FILE *_lastbuf; 7 | register FILE *iop; 8 | 9 | for(iop = _iob; iop->_flag & (_IOREAD|_IOWRT|_IORW); iop++) 10 | if (iop >= _lastbuf) 11 | return(NULL); 12 | 13 | return(iop); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE * fopen(const char *file, const char *mode) 4 | { 5 | FILE *_findiop(), *_endopen(); 6 | 7 | return(_endopen(file, mode, _findiop())); 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | fprintf(iop, fmt, args) 4 | FILE *iop; 5 | char *fmt; 6 | { 7 | _doprnt(fmt, &args, iop); 8 | return(ferror(iop)? EOF: 0); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fputc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | fputc(c, fp) 4 | FILE *fp; 5 | { 6 | return(putc(c, fp)); 7 | } 8 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/fputs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | fputs(s, iop) 4 | register char *s; 5 | register FILE *iop; 6 | { 7 | register r; 8 | register c; 9 | 10 | while (c = *s++) 11 | r = putc(c, iop); 12 | return(r); 13 | } 14 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/freopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE * freopen(const char *file, const char *mode, FILE *iop) 4 | { 5 | FILE *_endopen(); 6 | 7 | fclose(iop); 8 | return(_endopen(file, mode, iop)); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/ftell.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Return file offset. 3 | * Coordinates with buffering. 4 | */ 5 | 6 | #include 7 | long lseek(); 8 | 9 | 10 | long ftell(iop) 11 | FILE *iop; 12 | { 13 | long tres; 14 | register adjust; 15 | 16 | if (iop->_cnt < 0) 17 | iop->_cnt = 0; 18 | if (iop->_flag&_IOREAD) 19 | adjust = - iop->_cnt; 20 | else if(iop->_flag&(_IOWRT|_IORW)) { 21 | adjust = 0; 22 | if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0) 23 | adjust = iop->_ptr - iop->_base; 24 | } else 25 | return(-1); 26 | tres = lseek(fileno(iop), 0L, 1); 27 | if (tres<0) 28 | return(tres); 29 | tres += adjust; 30 | return(tres); 31 | } 32 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getchar.c: -------------------------------------------------------------------------------- 1 | /* 2 | * A subroutine version of the macro getchar. 3 | */ 4 | #include 5 | 6 | #undef getchar 7 | 8 | getchar() 9 | { 10 | return(getc(stdin)); 11 | } 12 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getgrgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct group * 4 | getgrgid(gid) 5 | register gid; 6 | { 7 | register struct group *p; 8 | struct group *getgrent(); 9 | 10 | setgrent(); 11 | while( (p = getgrent()) && p->gr_gid != gid ); 12 | endgrent(); 13 | return(p); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getgrnam.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct group * 4 | getgrnam(name) 5 | register char *name; 6 | { 7 | register struct group *p; 8 | struct group *getgrent(); 9 | 10 | setgrent(); 11 | while( (p = getgrent()) && strcmp(p->gr_name,name) ); 12 | endgrent(); 13 | return(p); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getpwnam.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct passwd * 4 | getpwnam(name) 5 | char *name; 6 | { 7 | register struct passwd *p; 8 | struct passwd *getpwent(); 9 | 10 | setpwent(); 11 | while( (p = getpwent()) && strcmp(name,p->pw_name) ); 12 | endpwent(); 13 | return(p); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getpwuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct passwd * 4 | getpwuid(uid) 5 | register uid; 6 | { 7 | register struct passwd *p; 8 | struct passwd *getpwent(); 9 | 10 | setpwent(); 11 | while( (p = getpwent()) && p->pw_uid != uid ); 12 | endpwent(); 13 | return(p); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/gets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char * 4 | gets(s) 5 | char *s; 6 | { 7 | register c; 8 | register char *cs; 9 | 10 | cs = s; 11 | while ((c = getchar()) != '\n' && c >= 0) 12 | *cs++ = c; 13 | if (c<0 && cs==s) 14 | return(NULL); 15 | *cs++ = '\0'; 16 | return(s); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/getw.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | getw(iop) 4 | register struct _iobuf *iop; 5 | { 6 | register i; 7 | 8 | i = getc(iop); 9 | if (iop->_flag&_IOEOF) 10 | return(-1); 11 | return(i | (getc(iop)<<8)); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/printf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | printf(fmt, args) 4 | char *fmt; 5 | { 6 | _doprnt(fmt, &args, stdout); 7 | return(ferror(stdout)? EOF: 0); 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/putchar.c: -------------------------------------------------------------------------------- 1 | /* 2 | * A subroutine version of the macro putchar 3 | */ 4 | #include 5 | 6 | #undef putchar 7 | 8 | putchar(c) 9 | register c; 10 | { 11 | putc(c, stdout); 12 | } 13 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/puts.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | puts(s) 4 | register char *s; 5 | { 6 | register c; 7 | 8 | while (c = *s++) 9 | putchar(c); 10 | return(putchar('\n')); 11 | } 12 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/putw.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | putw(i, iop) 4 | register i; 5 | register struct _iobuf *iop; 6 | { 7 | putc(i, iop); 8 | putc(i>>8, iop); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/rew.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | rewind(iop) 4 | register struct _iobuf *iop; 5 | { 6 | fflush(iop); 7 | lseek(fileno(iop), 0L, 0); 8 | iop->_cnt = 0; 9 | iop->_ptr = iop->_base; 10 | iop->_flag &= ~(_IOERR|_IOEOF); 11 | if (iop->_flag & _IORW) 12 | iop->_flag &= ~(_IOREAD|_IOWRT); 13 | } 14 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/scanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | scanf(fmt, args) 4 | char *fmt; 5 | { 6 | return(_doscan(stdin, fmt, &args)); 7 | } 8 | 9 | fscanf(iop, fmt, args) 10 | FILE *iop; 11 | char *fmt; 12 | { 13 | return(_doscan(iop, fmt, &args)); 14 | } 15 | 16 | sscanf(str, fmt, args) 17 | register char *str; 18 | char *fmt; 19 | { 20 | FILE _strbuf; 21 | 22 | _strbuf._flag = _IOREAD|_IOSTRG; 23 | _strbuf._ptr = _strbuf._base = str; 24 | _strbuf._cnt = 0; 25 | while (*str++) 26 | _strbuf._cnt++; 27 | return(_doscan(&_strbuf, fmt, &args)); 28 | } 29 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/setbuf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | setbuf(iop, buf) 4 | register struct _iobuf *iop; 5 | char *buf; 6 | { 7 | if (iop->_base != NULL && iop->_flag&_IOMYBUF) 8 | free(iop->_base); 9 | iop->_flag &= ~(_IOMYBUF|_IONBF); 10 | if ((iop->_base = buf) == NULL) 11 | iop->_flag |= _IONBF; 12 | else 13 | iop->_ptr = iop->_base; 14 | iop->_cnt = 0; 15 | } 16 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/sprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *sprintf(str, fmt, args) 4 | char *str, *fmt; 5 | { 6 | struct _iobuf _strbuf; 7 | 8 | _strbuf._flag = _IOWRT+_IOSTRG; 9 | _strbuf._ptr = str; 10 | _strbuf._cnt = 32767; 11 | _doprnt(fmt, &args, &_strbuf); 12 | putc('\0', &_strbuf); 13 | return(str); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/strout.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | _strout(string, count, adjust, file, fillch) 4 | register char *string; 5 | register count; 6 | int adjust; 7 | register struct _iobuf *file; 8 | { 9 | while (adjust < 0) { 10 | if (*string=='-' && fillch=='0') { 11 | putc(*string++, file); 12 | count--; 13 | } 14 | putc(fillch, file); 15 | adjust++; 16 | } 17 | while (--count>=0) 18 | putc(*string++, file); 19 | while (adjust) { 20 | putc(fillch, file); 21 | adjust--; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/system.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | system(s) 4 | char *s; 5 | { 6 | int status, pid, w; 7 | register int (*istat)(), (*qstat)(); 8 | 9 | if ((pid = fork()) == 0) { 10 | execl("/bin/sh", "sh", "-c", s, 0); 11 | _exit(127); 12 | } 13 | istat = signal(SIGINT, SIG_IGN); 14 | qstat = signal(SIGQUIT, SIG_IGN); 15 | while ((w = wait(&status)) != pid && w != -1) 16 | ; 17 | if (w == -1) 18 | status = -1; 19 | signal(SIGINT, istat); 20 | signal(SIGQUIT, qstat); 21 | return(status); 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/libc/stdio/ungetc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ungetc(c, iop) 4 | register FILE *iop; 5 | { 6 | if (c == EOF) 7 | return(-1); 8 | if ((iop->_flag&_IOREAD)==0 || iop->_ptr <= iop->_base) 9 | if (iop->_ptr == iop->_base && iop->_cnt==0) 10 | *iop->_ptr++; 11 | else 12 | return(-1); 13 | iop->_cnt++; 14 | *--iop->_ptr = c; 15 | return(0); 16 | } 17 | -------------------------------------------------------------------------------- /usr/src/libc/sys/access.s: -------------------------------------------------------------------------------- 1 | / access(file, request) 2 | / test ability to access file in all indicated ways 3 | / 1 - read 4 | / 2 - write 5 | / 4 - execute 6 | 7 | .globl _access 8 | .globl csv, cret 9 | .comm _errno,2 10 | 11 | .access = 33. 12 | 13 | _access: 14 | jsr r5,csv 15 | mov 4(r5),0f+2 16 | mov 6(r5),0f+4 17 | clr r0 18 | sys 0; 0f 19 | .data 20 | 0: sys .access; ..; .. 21 | .text 22 | bec 1f 23 | mov r0,_errno 24 | mov $-1,r0 25 | 1: 26 | jmp cret 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/acct.s: -------------------------------------------------------------------------------- 1 | / C library -- acct 2 | 3 | / error = acct(string); 4 | 5 | .globl _acct 6 | .globl cerror 7 | .acct = 51. 8 | 9 | _acct: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | .data 21 | 9: 22 | sys .acct; 0:.. 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/alarm.s: -------------------------------------------------------------------------------- 1 | / C library - alarm 2 | 3 | .globl _alarm 4 | .alarm = 27. 5 | 6 | _alarm: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | mov 4(r5),r0 10 | sys .alarm 11 | mov (sp)+,r5 12 | rts pc 13 | -------------------------------------------------------------------------------- /usr/src/libc/sys/armv6k/close.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .arm 3 | .section .text 4 | 5 | .extern errno 6 | 7 | 8 | .global close 9 | .type close,%function 10 | close: 11 | mov r3, lr 12 | swi #6 13 | movcc r0, #0 @ syscall doesn't return anything meaningful 14 | bcc 1f @ syscalls return carry-clear for success and carry-set for error 15 | ldr r2, =errno 16 | str r0, [r2] @ stash the returned errno in the error case 17 | mov r0, #-1 @ syscalls return -1 for error 18 | 1: mov lr, r3 19 | bx lr 20 | .size close, . - close 21 | -------------------------------------------------------------------------------- /usr/src/libc/sys/armv6k/exit.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .arm 3 | .section .text 4 | 5 | .extern errno 6 | 7 | 8 | .global _exit 9 | .type _exit,%function 10 | _exit: 11 | swi #1 12 | bcc 1f @ syscalls return carry-clear for success and carry-set for error 13 | ldr r2, =errno 14 | str r0, [r2] @ stash the returned errno in the error case 15 | mov r0, #-1 @ syscalls return -1 for error 16 | 1: bx lr 17 | .size _exit, . - _exit 18 | -------------------------------------------------------------------------------- /usr/src/libc/sys/chdir.s: -------------------------------------------------------------------------------- 1 | / C library -- chdir 2 | 3 | / error = chdir(string); 4 | 5 | .globl _chdir 6 | .globl cerror 7 | .chdir = 12. 8 | 9 | _chdir: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | .data 21 | 9: 22 | sys .chdir; 0:.. 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/chmod.s: -------------------------------------------------------------------------------- 1 | / C library -- chmod 2 | 3 | / error = chmod(string, mode); 4 | 5 | .globl _chmod 6 | .globl cerror 7 | .chmod = 15. 8 | 9 | _chmod: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | sys 0; 9f 15 | bec 1f 16 | jmp cerror 17 | 1: 18 | clr r0 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .chmod; 0:..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/chown.s: -------------------------------------------------------------------------------- 1 | / C library -- chown 2 | 3 | / error = chown(string, owner); 4 | 5 | .globl _chown, 6 | .globl cerror 7 | .chown = 16. 8 | 9 | _chown: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | mov 8(r5),0f+4 15 | sys 0; 9f 16 | bec 1f 17 | jmp cerror 18 | 1: 19 | clr r0 20 | mov (sp)+,r5 21 | rts pc 22 | .data 23 | 9: 24 | sys .chown; 0:..; ..; .. 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/chroot.s: -------------------------------------------------------------------------------- 1 | / C library -- chroot 2 | 3 | / error = chroot(string); 4 | 5 | .globl _chroot 6 | .globl cerror 7 | .chroot = 61. 8 | 9 | _chroot: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | .data 21 | 9: 22 | sys .chroot; 0:.. 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/close.s: -------------------------------------------------------------------------------- 1 | / C library -- close 2 | 3 | / error = close(file); 4 | 5 | .globl _close, 6 | .globl cerror 7 | .close = 6. 8 | 9 | _close: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),r0 13 | sys .close 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | -------------------------------------------------------------------------------- /usr/src/libc/sys/creat.s: -------------------------------------------------------------------------------- 1 | / C library -- creat 2 | 3 | / file = creat(string, mode); 4 | / 5 | / file == -1 if error 6 | 7 | .globl _creat 8 | .globl cerror 9 | .creat = 8. 10 | 11 | _creat: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | mov 4(r5),0f 15 | mov 6(r5),0f+2 16 | sys 0; 9f 17 | bec 1f 18 | jmp cerror 19 | 1: 20 | mov (sp)+,r5 21 | rts pc 22 | .data 23 | 9: 24 | sys .creat; 0:..; .. 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/dup.s: -------------------------------------------------------------------------------- 1 | / C library -- dup 2 | 3 | / f = dup(of [ ,nf]) 4 | / f == -1 for error 5 | 6 | .globl _dup,_dup2 7 | .globl cerror 8 | .dup = 41. 9 | 10 | _dup2: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),r0 14 | bis $100,r0 15 | br 1f 16 | 17 | _dup: 18 | mov r5,-(sp) 19 | mov sp,r5 20 | mov 4(r5),r0 21 | 1: 22 | mov 6(r5),r1 23 | sys .dup 24 | bec 1f 25 | jmp cerror 26 | 1: 27 | mov (sp)+,r5 28 | rts pc 29 | -------------------------------------------------------------------------------- /usr/src/libc/sys/execl.s: -------------------------------------------------------------------------------- 1 | / C library -- execl 2 | 3 | / execl(file, arg1, arg2, ... , 0); 4 | / 5 | / environment automatically passed 6 | 7 | .globl _execl 8 | .globl cerror, _environ 9 | .exece = 59. 10 | 11 | _execl: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | mov 4(r5),0f 15 | mov r5,r0 16 | add $6,r0 17 | mov r0,0f+2 18 | mov _environ,0f+4 19 | sys 0; 9f 20 | jmp cerror 21 | .data 22 | 9: 23 | sys .exece; 0:..; ..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/execle.s: -------------------------------------------------------------------------------- 1 | / C library -- execle 2 | 3 | / execle(file, arg1, arg2, ... , 0, env); 4 | / 5 | 6 | .globl _execle 7 | .globl cerror 8 | .exece = 59. 9 | 10 | _execle: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),0f 14 | mov r5,r0 15 | add $6,r0 16 | mov r0,0f+2 17 | 1: 18 | tst (r0)+ 19 | bne 1b 20 | mov (r0),0f+4 21 | sys 0; 9f 22 | jmp cerror 23 | .data 24 | 9: 25 | sys .exece; 0:..; ..; .. 26 | -------------------------------------------------------------------------------- /usr/src/libc/sys/execv.s: -------------------------------------------------------------------------------- 1 | / C library -- execv 2 | 3 | / execv(file, argv); 4 | / 5 | / where argv is a vector argv[0] ... argv[x], 0 6 | / last vector element must be 0 7 | / environment passed automatically 8 | 9 | .globl _execv, 10 | .globl cerror, _environ 11 | .exece = 59. 12 | 13 | _execv: 14 | mov r5,-(sp) 15 | mov sp,r5 16 | mov 4(r5),0f 17 | mov 6(r5),0f+2 18 | mov _environ,0f+4 19 | sys 0; 9f 20 | jmp cerror 21 | .data 22 | 9: 23 | sys .exece; 0:..; ..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/execve.s: -------------------------------------------------------------------------------- 1 | / C library -- execve 2 | 3 | / execve(file, argv, env); 4 | / 5 | / where argv is a vector argv[0] ... argv[x], 0 6 | / last vector element must be 0 7 | 8 | .globl _execve 9 | .globl cerror 10 | .exece = 59. 11 | 12 | _execve: 13 | mov r5,-(sp) 14 | mov sp,r5 15 | mov 4(r5),0f 16 | mov 6(r5),0f+2 17 | mov 8(r5),0f+4 18 | sys 0; 9f 19 | jmp cerror 20 | .data 21 | 9: 22 | sys .exece; 0:..; ..; .. 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/exit.s: -------------------------------------------------------------------------------- 1 | / C library -- _exit 2 | 3 | / _exit(code) 4 | / code is return in r0 to system 5 | / Same as plain exit, for user who want to define their own exit. 6 | 7 | .globl __exit 8 | .exit = 1. 9 | 10 | __exit: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),r0 14 | sys .exit 15 | 16 | -------------------------------------------------------------------------------- /usr/src/libc/sys/fork.s: -------------------------------------------------------------------------------- 1 | / C library -- fork 2 | 3 | / pid = fork(); 4 | / 5 | / pid == 0 in child process; pid == -1 means error return 6 | / in child, parents id is in par_uid if needed 7 | 8 | .globl _fork, _par_uid 9 | .globl cerror 10 | .fork = 2. 11 | 12 | _fork: 13 | mov r5,-(sp) 14 | mov sp,r5 15 | sys .fork 16 | br 1f 17 | bec 2f 18 | jmp cerror 19 | 1: 20 | mov r0,_par_uid 21 | clr r0 22 | 2: 23 | mov (sp)+,r5 24 | rts pc 25 | .bss 26 | _par_uid: .=.+2 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/fstat.s: -------------------------------------------------------------------------------- 1 | / C library -- fstat 2 | 3 | / error = fstat(file, statbuf); 4 | 5 | / int statbuf[17] or 6 | / char statbuf[34] 7 | / as appropriate 8 | 9 | .globl _fstat 10 | .globl cerror 11 | .fstat = 28. 12 | 13 | _fstat: 14 | mov r5,-(sp) 15 | mov sp,r5 16 | mov 4(r5),r0 17 | mov 6(r5),0f 18 | sys 0; 9f 19 | bec 1f 20 | jmp cerror 21 | 1: 22 | clr r0 23 | mov (sp)+,r5 24 | rts pc 25 | .data 26 | 9: 27 | sys .fstat; 0:.. 28 | -------------------------------------------------------------------------------- /usr/src/libc/sys/getgid.s: -------------------------------------------------------------------------------- 1 | / C library -- getgid, getegid 2 | 3 | / gid = getgid(); 4 | 5 | .globl _getgid 6 | .getgid = 47. 7 | 8 | _getgid: 9 | mov r5,-(sp) 10 | mov sp,r5 11 | sys .getgid 12 | mov (sp)+,r5 13 | rts pc 14 | 15 | / gid = getegid(); 16 | / returns effective gid 17 | 18 | .globl _getegid 19 | 20 | _getegid: 21 | mov r5,-(sp) 22 | mov sp,r5 23 | sys .getgid 24 | mov r1,r0 25 | mov (sp)+,r5 26 | rts pc 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/getpid.s: -------------------------------------------------------------------------------- 1 | / getpid -- get process ID 2 | 3 | .globl _getpid 4 | .getpid = 20. 5 | 6 | _getpid: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | sys .getpid 10 | mov (sp)+,r5 11 | rts pc 12 | -------------------------------------------------------------------------------- /usr/src/libc/sys/getuid.s: -------------------------------------------------------------------------------- 1 | / C library -- getuid, geteuid 2 | 3 | / uid = getuid(); 4 | 5 | .globl _getuid 6 | .getuid = 24. 7 | 8 | _getuid: 9 | mov r5,-(sp) 10 | mov sp,r5 11 | sys .getuid 12 | mov (sp)+,r5 13 | rts pc 14 | 15 | 16 | / uid = geteuid(); 17 | / returns effective uid 18 | 19 | .globl _geteuid 20 | 21 | _geteuid: 22 | mov r5,-(sp) 23 | mov sp,r5 24 | sys .getuid 25 | mov r1,r0 26 | mov (sp)+,r5 27 | rts pc 28 | -------------------------------------------------------------------------------- /usr/src/libc/sys/ioctl.s: -------------------------------------------------------------------------------- 1 | / C library -- ioctl 2 | 3 | / ioctl(fdes, command, arg) 4 | / struct * arg; 5 | / 6 | / result == -1 if error 7 | 8 | .globl _ioctl, cerror 9 | .ioctl = 54. 10 | 11 | _ioctl: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | mov 4(r5),0f 15 | mov 6(r5),0f+2 16 | mov 8(r5),0f+4 17 | sys 0; 9f 18 | bec 1f 19 | jmp cerror 20 | 1: 21 | mov (sp)+,r5 22 | clr r0 23 | rts pc 24 | .data 25 | 9: 26 | sys .ioctl; 0:..; ..; .. 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/kill.s: -------------------------------------------------------------------------------- 1 | / C library -- kill 2 | 3 | .globl _kill, cerror 4 | .kill = 37. 5 | 6 | _kill: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | mov 4(sp),r0 10 | mov 6(sp),8f 11 | sys 0; 9f 12 | bec 1f 13 | jmp cerror 14 | 1: 15 | clr r0 16 | mov (sp)+,r5 17 | rts pc 18 | 19 | .data 20 | 9: 21 | sys .kill; 8:.. 22 | -------------------------------------------------------------------------------- /usr/src/libc/sys/link.s: -------------------------------------------------------------------------------- 1 | / C library -- link 2 | 3 | / error = link(old-file, new-file); 4 | 5 | .globl _link 6 | .globl cerror 7 | .link = 9. 8 | 9 | _link: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | sys 0; 9f 15 | bec 1f 16 | jmp cerror 17 | 1: 18 | clr r0 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .link; 0:..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/lock.s: -------------------------------------------------------------------------------- 1 | / lock -- C library 2 | 3 | / lock(f) 4 | 5 | .globl _lock, cerror 6 | 7 | .lock = 53. 8 | 9 | _lock: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | .data 15 | 9: 16 | sys .lock; 0:.. 17 | .text 18 | bec 1f 19 | jmp cerror 20 | 1: 21 | mov (sp)+,r5 22 | rts pc 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/lseek.s: -------------------------------------------------------------------------------- 1 | / C library -- lseek 2 | 3 | / error = lseek(file, offset, ptr); 4 | / long offset 5 | / long lseek() 6 | 7 | .globl _lseek, cerror 8 | .lseek = 19. 9 | 10 | _lseek: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),r0 14 | mov 6(r5),0f 15 | mov 8(r5),0f+2 16 | mov 10.(r5),0f+4 17 | sys 0; 9f 18 | bec 1f 19 | mov $1,r1 20 | jmp cerror 21 | 1: 22 | mov (sp)+,r5 23 | rts pc 24 | .data 25 | 9: 26 | sys .lseek; 0:..; ..; .. 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/mknod.s: -------------------------------------------------------------------------------- 1 | / C library -- mknod 2 | 3 | / error = mknod(string, mode, major.minor); 4 | 5 | .globl _mknod, cerror 6 | 7 | .mknod = 14. 8 | _mknod: 9 | mov r5,-(sp) 10 | mov sp,r5 11 | mov 4(r5),0f 12 | mov 6(r5),0f+2 13 | mov 8(r5),0f+4 14 | sys 0; 9f 15 | bec 1f 16 | jmp cerror 17 | 1: 18 | clr r0 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .mknod; 0:..; ..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/mount.s: -------------------------------------------------------------------------------- 1 | / C library -- mount 2 | 3 | / error = mount(dev, file, flag) 4 | 5 | .globl _mount, 6 | .globl cerror 7 | .mount = 21. 8 | 9 | _mount: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(sp),0f 13 | mov 6(sp),0f+2 14 | mov 8(sp),0f+4 15 | sys 0; 9f 16 | bec 1f 17 | jmp cerror 18 | 1: 19 | clr r0 20 | mov (sp)+,r5 21 | rts pc 22 | .data 23 | 9: 24 | sys .mount; 0:..; ..; .. 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/mpxcall.s: -------------------------------------------------------------------------------- 1 | .globl _mpxcall, cerror 2 | 3 | _mpxcall: 4 | mov r5,-(sp) 5 | mov sp,r5 6 | mov 4(r5),0f 7 | mov 6(r5),0f+2 8 | call: 9 | sys 0; 9f 10 | bec 1f 11 | jmp cerror 12 | 1: 13 | mov (sp)+,r5 14 | rts pc 15 | .data 16 | 9: 17 | sys 56.; 0:..; .. 18 | 19 | -------------------------------------------------------------------------------- /usr/src/libc/sys/nice.s: -------------------------------------------------------------------------------- 1 | / C library-- nice 2 | 3 | / error = nice(hownice) 4 | 5 | .globl _nice, 6 | .globl cerror 7 | .nice = 34. 8 | 9 | _nice: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(sp),r0 13 | sys .nice 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | -------------------------------------------------------------------------------- /usr/src/libc/sys/open.s: -------------------------------------------------------------------------------- 1 | / C library -- open 2 | 3 | / file = open(string, mode) 4 | / file == -1 means error 5 | 6 | .globl _open, 7 | .globl cerror 8 | .open = 5. 9 | 10 | _open: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),0f 14 | mov 6(r5),0f+2 15 | sys 0; 9f 16 | bec 1f 17 | jmp cerror 18 | 1: 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .open; 0:..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/pause.s: -------------------------------------------------------------------------------- 1 | / C library - pause 2 | 3 | .globl _pause 4 | .pause = 29. 5 | 6 | _pause: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | sys .pause 10 | mov (sp)+,r5 11 | rts pc 12 | -------------------------------------------------------------------------------- /usr/src/libc/sys/phys.s: -------------------------------------------------------------------------------- 1 | / phys -- C library 2 | 3 | / phys(seg, size, physad) 4 | 5 | .globl _phys, cerror 6 | 7 | .phys = 52. 8 | 9 | _phys: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | mov 8(r5),0f+4 15 | sys 0; 9f 16 | .data 17 | 9: 18 | sys .phys; 0: ..; ..; .. 19 | .text 20 | bec 1f 21 | jmp cerror 22 | 1: 23 | mov (sp)+,r5 24 | rts pc 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/pipe.s: -------------------------------------------------------------------------------- 1 | / pipe -- C library 2 | 3 | / pipe(f) 4 | / int f[2]; 5 | 6 | .globl _pipe, cerror 7 | 8 | .pipe = 42. 9 | 10 | _pipe: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | sys .pipe 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | mov r2,-(sp) 18 | mov 4(r5),r2 19 | mov r0,(r2)+ 20 | mov r1,(r2) 21 | clr r0 22 | mov (sp)+,r2 23 | mov (sp)+,r5 24 | rts pc 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/profil.s: -------------------------------------------------------------------------------- 1 | / profil 2 | 3 | .globl _profil 4 | .prof = 44. 5 | 6 | _profil: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | mov 4(r5),0f 10 | mov 6(r5),0f+2 11 | mov 10(r5),0f+4 12 | mov 12(r5),0f+6 13 | sys 0; 9f 14 | mov (sp)+,r5 15 | rts pc 16 | .data 17 | 9: 18 | sys .prof; 0:..; ..; ..; .. 19 | -------------------------------------------------------------------------------- /usr/src/libc/sys/ptrace.s: -------------------------------------------------------------------------------- 1 | / ptrace -- C library 2 | 3 | / result = ptrace(req, pid, addr, data); 4 | 5 | .ptrace = 26. 6 | indir = 0 7 | 8 | .globl _ptrace 9 | .globl cerror, _errno 10 | 11 | _ptrace: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | mov 4.(r5),0f+4 15 | mov 6.(r5),0f+0 16 | mov 8.(r5),0f+2 17 | mov 10.(r5),r0 18 | clr _errno 19 | sys indir; 9f 20 | bec 1f 21 | jmp cerror 22 | 1: 23 | mov (sp)+,r5 24 | rts pc 25 | 26 | .data 27 | 9: 28 | sys .ptrace; 0: .=.+6 29 | -------------------------------------------------------------------------------- /usr/src/libc/sys/read.s: -------------------------------------------------------------------------------- 1 | / C library -- read 2 | 3 | / nread = read(file, buffer, count); 4 | / nread ==0 means eof; nread == -1 means error 5 | 6 | .globl _read 7 | .globl cerror 8 | .read = 3. 9 | 10 | _read: 11 | mov r5,-(sp) 12 | mov sp,r5 13 | mov 4(r5),r0 14 | mov 6(r5),0f 15 | mov 8(r5),0f+2 16 | sys 0; 9f 17 | bec 1f 18 | jmp cerror 19 | 1: 20 | mov (sp)+,r5 21 | rts pc 22 | .data 23 | 9: 24 | sys .read; 0:..; .. 25 | -------------------------------------------------------------------------------- /usr/src/libc/sys/setgid.s: -------------------------------------------------------------------------------- 1 | / C library -- setgid 2 | 3 | / error = setgid(uid); 4 | 5 | .globl _setgid 6 | .globl cerror 7 | .setgid = 46. 8 | 9 | _setgid: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),r0 13 | sys .setgid 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | -------------------------------------------------------------------------------- /usr/src/libc/sys/setuid.s: -------------------------------------------------------------------------------- 1 | / C library -- setuid 2 | 3 | / error = setuid(uid); 4 | 5 | .globl _setuid 6 | .globl cerror 7 | .setuid = 23. 8 | 9 | _setuid: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),r0 13 | sys .setuid 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | -------------------------------------------------------------------------------- /usr/src/libc/sys/stat.s: -------------------------------------------------------------------------------- 1 | / C library -- stat 2 | 3 | / error = stat(string, statbuf); 4 | 5 | .globl _stat 6 | .globl cerror 7 | .stat = 18. 8 | 9 | _stat: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | sys 0; 9f 15 | bec 1f 16 | jmp cerror 17 | 1: 18 | clr r0 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .stat; 0:..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/stime.s: -------------------------------------------------------------------------------- 1 | / error = stime(&long) 2 | 3 | .globl _stime 4 | .globl cerror 5 | .stime = 25. 6 | 7 | _stime: 8 | mov r5,-(sp) 9 | mov sp,r5 10 | mov 4(sp),r1 11 | mov (r1)+,r0 12 | mov (r1),r1 13 | sys .stime 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | -------------------------------------------------------------------------------- /usr/src/libc/sys/sync.s: -------------------------------------------------------------------------------- 1 | .globl _sync 2 | .sync = 36. 3 | 4 | _sync: 5 | mov r5,-(sp) 6 | mov sp,r5 7 | sys .sync 8 | mov (sp)+,r5 9 | rts pc 10 | -------------------------------------------------------------------------------- /usr/src/libc/sys/time.s: -------------------------------------------------------------------------------- 1 | / C library -- time 2 | 3 | / tvec = time(tvec); 4 | / 5 | / tvec[0], tvec[1] contain the time 6 | 7 | .globl _time 8 | .time = 13. 9 | 10 | 11 | _time: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | sys .time 15 | mov r2,-(sp) 16 | mov 4(r5),r2 17 | beq 1f 18 | mov r0,(r2)+ 19 | mov r1,(r2)+ 20 | 1: 21 | mov (sp)+,r2 22 | mov (sp)+,r5 23 | rts pc 24 | 25 | .globl _ftime 26 | .ftime = 35. 27 | 28 | _ftime: 29 | mov r5,-(sp) 30 | mov sp,r5 31 | mov 4(r5),0f 32 | sys 0; 9f 33 | .data 34 | 9: sys .ftime; 0:.. 35 | .text 36 | mov (sp)+,r5 37 | rts pc 38 | -------------------------------------------------------------------------------- /usr/src/libc/sys/times.s: -------------------------------------------------------------------------------- 1 | / C library -- times 2 | 3 | .globl _times 4 | .times = 43. 5 | 6 | _times: 7 | mov r5,-(sp) 8 | mov sp,r5 9 | mov 4(r5),0f 10 | sys 0; 9f 11 | mov (sp)+,r5 12 | rts pc 13 | .data 14 | 9: 15 | sys .times; 0:.. 16 | -------------------------------------------------------------------------------- /usr/src/libc/sys/umask.s: -------------------------------------------------------------------------------- 1 | / C library -- umask 2 | 3 | / omask = umask(mode); 4 | 5 | .globl _umask 6 | .globl cerror 7 | .umask = 60. 8 | 9 | _umask: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | mov (sp)+,r5 18 | rts pc 19 | .data 20 | 9: 21 | sys .umask; 0:.. 22 | -------------------------------------------------------------------------------- /usr/src/libc/sys/umount.s: -------------------------------------------------------------------------------- 1 | / C library -- umount 2 | 3 | .globl _umount 4 | .globl cerror 5 | indir = 0 6 | .umount = 22. 7 | .comm _errno,2 8 | 9 | _umount: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(sp),0f 13 | sys indir; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | 21 | .data 22 | 9: 23 | sys .umount; 0:.. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/unlink.s: -------------------------------------------------------------------------------- 1 | / C library -- unlink 2 | 3 | / error = unlink(string); 4 | 5 | .globl _unlink, 6 | .globl cerror 7 | .unlink = 10. 8 | 9 | _unlink: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | sys 0; 9f 14 | bec 1f 15 | jmp cerror 16 | 1: 17 | clr r0 18 | mov (sp)+,r5 19 | rts pc 20 | .data 21 | 9: 22 | sys .unlink; 0:.. 23 | -------------------------------------------------------------------------------- /usr/src/libc/sys/utime.s: -------------------------------------------------------------------------------- 1 | / C library -- utime 2 | 3 | / error = utime(string, timev); 4 | 5 | .globl _utime 6 | .globl cerror 7 | .utime = 30. 8 | 9 | _utime: 10 | mov r5,-(sp) 11 | mov sp,r5 12 | mov 4(r5),0f 13 | mov 6(r5),0f+2 14 | sys 0; 9f 15 | bec 1f 16 | jmp cerror 17 | 1: 18 | clr r0 19 | mov (sp)+,r5 20 | rts pc 21 | .data 22 | 9: 23 | sys .utime; 0:..; .. 24 | -------------------------------------------------------------------------------- /usr/src/libc/sys/wait.s: -------------------------------------------------------------------------------- 1 | / C library -- wait 2 | 3 | / pid = wait(0); 4 | / or, 5 | / pid = wait(&status); 6 | / 7 | / pid == -1 if error 8 | / status indicates fate of process, if given 9 | 10 | .globl _wait 11 | .globl cerror 12 | .wait = 7. 13 | 14 | _wait: 15 | mov r5,-(sp) 16 | mov sp,r5 17 | sys .wait 18 | bec 1f 19 | jmp cerror 20 | 1: 21 | tst 4(r5) 22 | beq 1f 23 | mov r1,*4(r5) / status return 24 | 1: 25 | mov (sp)+,r5 26 | rts pc 27 | -------------------------------------------------------------------------------- /usr/src/libc/sys/write.s: -------------------------------------------------------------------------------- 1 | / C library -- write 2 | 3 | / nwritten = write(file, buffer, count); 4 | / 5 | / nwritten == -1 means error 6 | 7 | .globl _write 8 | .globl cerror 9 | .write = 4. 10 | 11 | _write: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | mov 4(r5),r0 15 | mov 6(r5),0f 16 | mov 8(r5),0f+2 17 | sys 0; 9f 18 | bec 1f 19 | jmp cerror 20 | 1: 21 | mov (sp)+,r5 22 | rts pc 23 | .data 24 | 9: 25 | sys .write; 0:..; .. 26 | -------------------------------------------------------------------------------- /usr/src/libc/v6/access.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | access(name, mode) 5 | { 6 | struct stat foo; 7 | 8 | return(stat(name, &foo)); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libc/v6/chown.c: -------------------------------------------------------------------------------- 1 | chown(name, owner, group) 2 | char *name; 3 | int owner, group; 4 | { 5 | return(syscall(16, 0, 0, name, (group<<8)|(owner&0377), 0)); 6 | } 7 | -------------------------------------------------------------------------------- /usr/src/libc/v6/execl.c: -------------------------------------------------------------------------------- 1 | execl(name, arg1, a2, a3, a4, a5) 2 | char *name, arg1, a2, a3, a4, a5; 3 | { 4 | char *args[6]; 5 | 6 | args[0] = arg1; 7 | args[1] = a2; 8 | args[2] = a3; 9 | args[3] = a4; 10 | args[4] = a5; 11 | args[5] = 0; 12 | 13 | syscall(11, 0, 0, name, args, 0); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/v6/ftime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static struct timeb gorp = { 5 | 0L, 6 | 0, 7 | 5*60, 8 | 1 9 | }; 10 | 11 | ftime(gorpp) 12 | struct timeb *gorpp; 13 | { 14 | *gorpp = gorp; 15 | return(0); 16 | } 17 | -------------------------------------------------------------------------------- /usr/src/libc/v6/gtty.c: -------------------------------------------------------------------------------- 1 | gtty(fd, buf) 2 | int fd; 3 | int *buf; 4 | { 5 | if (syscall(32, fd, 0, buf, 0, 0) < 0) 6 | return(-1); 7 | return(0); 8 | } 9 | -------------------------------------------------------------------------------- /usr/src/libc/v6/lseek.c: -------------------------------------------------------------------------------- 1 | lseek(fd, off, ptr) 2 | int fd, ptr; 3 | long off; 4 | { 5 | unsigned a; 6 | 7 | a = off; 8 | 9 | if (a == off) 10 | return (syscall(19, fd, 0, a, ptr, 0)); 11 | a = off/512; 12 | syscall(19, fd, 0, a, ptr+3, 0); 13 | return(syscall(19, fd, 0, (int) (off%512), ptr, 0)); 14 | } 15 | -------------------------------------------------------------------------------- /usr/src/libc/v6/syscall.s: -------------------------------------------------------------------------------- 1 | / syscall 2 | 3 | .globl _syscall,csv,cret,cerror 4 | _syscall: 5 | jsr r5,csv 6 | mov r5,r2 7 | add $04,r2 8 | mov $9f,r3 9 | mov (r2)+,r0 10 | bic $!0377,r0 11 | bis $sys,r0 12 | mov r0,(r3)+ 13 | mov (r2)+,r0 14 | mov (r2)+,r1 15 | mov (r2)+,(r3)+ 16 | mov (r2)+,(r3)+ 17 | mov (r2)+,(r3)+ 18 | mov (r2)+,(r3)+ 19 | mov (r2)+,(r3)+ 20 | sys 0; 9f 21 | bec 1f 22 | jmp cerror 23 | 1: 24 | jmp cret 25 | 26 | .data 27 | 9: .=.+12. 28 | -------------------------------------------------------------------------------- /usr/src/libc/v6/time.s: -------------------------------------------------------------------------------- 1 | / C library -- time 2 | 3 | / tvec = time(tvec); 4 | / 5 | / tvec[0], tvec[1] contain the time 6 | 7 | .globl _time 8 | .time = 13. 9 | 10 | 11 | _time: 12 | mov r5,-(sp) 13 | mov sp,r5 14 | sys .time 15 | mov r2,-(sp) 16 | mov 4(r5),r2 17 | beq 1f 18 | mov r0,(r2)+ 19 | mov r1,(r2)+ 20 | 1: 21 | mov (sp)+,r2 22 | mov (sp)+,r5 23 | rts pc 24 | -------------------------------------------------------------------------------- /usr/src/libdbm/compall: -------------------------------------------------------------------------------- 1 | cc -c -O dbm.c 2 | -------------------------------------------------------------------------------- /usr/src/libdbm/dbm.h: -------------------------------------------------------------------------------- 1 | #define PBLKSIZ 512 2 | #define DBLKSIZ 8192 3 | #define BYTESIZ 8 4 | #define NULL ((char *) 0) 5 | 6 | long bitno; 7 | long maxbno; 8 | long blkno; 9 | long hmask; 10 | 11 | char pagbuf[PBLKSIZ]; 12 | char dirbuf[DBLKSIZ]; 13 | 14 | int dirf; 15 | int pagf; 16 | 17 | typedef struct 18 | { 19 | char *dptr; 20 | int dsize; 21 | } datum; 22 | 23 | datum fetch(); 24 | datum makdatum(); 25 | datum firstkey(); 26 | datum nextkey(); 27 | datum firsthash(); 28 | long calchash(); 29 | long hashinc(); 30 | 31 | -------------------------------------------------------------------------------- /usr/src/libdbm/mklib: -------------------------------------------------------------------------------- 1 | mv dbm.o libdbm.a 2 | -------------------------------------------------------------------------------- /usr/src/libfpsim/compall: -------------------------------------------------------------------------------- 1 | as -o fpsim.o fp?.s 2 | -------------------------------------------------------------------------------- /usr/src/libfpsim/fpx.s: -------------------------------------------------------------------------------- 1 | / fpx -- floating point simulation 2 | 3 | .data 4 | reenter: 1 5 | 6 | .bss 7 | asign: .=.+2 8 | areg: .=.+8 9 | aexp: .=.+2 10 | bsign: .=.+2 11 | breg: .=.+8 12 | bexp: .=.+2 13 | 14 | fpsr: .=.+2 15 | trapins: .=.+2 16 | 17 | ac0: .=.+8. 18 | ac1: .=.+8. 19 | ac2: .=.+8. 20 | ac3: .=.+8. 21 | ac4: .=.+8. 22 | ac5: .=.+8. 23 | 24 | sr0: .=.+2 25 | sr1: .=.+2 26 | .=.+2 27 | .=.+2 28 | .=.+2 29 | .=.+2 30 | ssp: .=.+2 31 | spc: .=.+2 32 | sps: .=.+2 33 | pctmp: .=.+8 34 | 35 | -------------------------------------------------------------------------------- /usr/src/libfpsim/mklib: -------------------------------------------------------------------------------- 1 | ar rb fakfp.o /lib/libc.a fpsim.o 2 | -------------------------------------------------------------------------------- /usr/src/libm/compall: -------------------------------------------------------------------------------- 1 | cc -c -O asin.c 2 | cc -c -O atan.c 3 | cc -c -O exp.c 4 | cc -c -O fabs.c 5 | cc -c -O floor.c 6 | cc -c -O hypot.c 7 | cc -c -O j0.c 8 | cc -c -O j1.c 9 | cc -c -O jn.c 10 | cc -c -O log.c 11 | cc -c -O pow.c 12 | cc -c -O sin.c 13 | cc -c -O sinh.c 14 | cc -c -O sqrt.c 15 | cc -c -O tan.c 16 | cc -c -O tanh.c 17 | -------------------------------------------------------------------------------- /usr/src/libm/fabs.c: -------------------------------------------------------------------------------- 1 | double 2 | fabs(arg) 3 | double arg; 4 | { 5 | 6 | if(arg < 0.) 7 | arg = -arg; 8 | return(arg); 9 | } 10 | -------------------------------------------------------------------------------- /usr/src/libm/floor.c: -------------------------------------------------------------------------------- 1 | /* 2 | * floor and ceil-- greatest integer <= arg 3 | * (resp least >=) 4 | */ 5 | 6 | double modf(); 7 | 8 | double 9 | floor(d) 10 | double d; 11 | { 12 | double fract; 13 | 14 | if (d<0.0) { 15 | d = -d; 16 | fract = modf(d, &d); 17 | if (fract != 0.0) 18 | d += 1; 19 | d = -d; 20 | } else 21 | modf(d, &d); 22 | return(d); 23 | } 24 | 25 | double 26 | ceil(d) 27 | double d; 28 | { 29 | return(-floor(-d)); 30 | } 31 | -------------------------------------------------------------------------------- /usr/src/libm/hypot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sqrt(a^2 + b^2) 3 | * (but carefully) 4 | */ 5 | 6 | double sqrt(); 7 | double 8 | hypot(a,b) 9 | double a,b; 10 | { 11 | double t; 12 | if(a<0) a = -a; 13 | if(b<0) b = -b; 14 | if(a > b) { 15 | t = a; 16 | a = b; 17 | b = t; 18 | } 19 | if(b==0) return(0.); 20 | a /= b; 21 | /* 22 | * pathological overflow possible 23 | * in the next line. 24 | */ 25 | return(b*sqrt(1. + a*a)); 26 | } 27 | 28 | struct complex 29 | { 30 | double r; 31 | double i; 32 | }; 33 | 34 | double 35 | cabs(arg) 36 | struct complex arg; 37 | { 38 | double hypot(); 39 | 40 | return(hypot(arg.r, arg.i)); 41 | } 42 | -------------------------------------------------------------------------------- /usr/src/libm/mklib: -------------------------------------------------------------------------------- 1 | ar rc libm.a \ 2 | asin.o \ 3 | atan.o \ 4 | hypot.o \ 5 | jn.o \ 6 | j0.o \ 7 | j1.o \ 8 | pow.o \ 9 | fabs.o \ 10 | log.o \ 11 | sin.o \ 12 | sqrt.o \ 13 | tan.o \ 14 | tanh.o \ 15 | sinh.o \ 16 | exp.o \ 17 | floor.o 18 | -------------------------------------------------------------------------------- /usr/src/libm/pow.c: -------------------------------------------------------------------------------- 1 | /* 2 | computes a^b. 3 | uses log and exp 4 | */ 5 | 6 | #include 7 | int errno; 8 | double log(), exp(); 9 | 10 | double 11 | pow(arg1,arg2) 12 | double arg1, arg2; 13 | { 14 | double temp; 15 | long l; 16 | 17 | if(arg1 <= 0.) { 18 | if(arg1 == 0.) { 19 | if(arg2 <= 0.) 20 | goto domain; 21 | return(0.); 22 | } 23 | l = arg2; 24 | if(l != arg2) 25 | goto domain; 26 | temp = exp(arg2 * log(-arg1)); 27 | if(l & 1) 28 | temp = -temp; 29 | return(temp); 30 | } 31 | return(exp(arg2 * log(arg1))); 32 | 33 | domain: 34 | errno = EDOM; 35 | return(0.); 36 | } 37 | -------------------------------------------------------------------------------- /usr/src/libm/tanh.c: -------------------------------------------------------------------------------- 1 | /* 2 | tanh(arg) computes the hyperbolic tangent of its floating 3 | point argument. 4 | 5 | sinh and cosh are called except for large arguments, which 6 | would cause overflow improperly. 7 | */ 8 | 9 | double sinh(), cosh(); 10 | 11 | double 12 | tanh(arg) 13 | double arg; 14 | { 15 | double sign; 16 | 17 | sign = 1.; 18 | if(arg < 0.){ 19 | arg = -arg; 20 | sign = -1.; 21 | } 22 | 23 | if(arg > 21.) 24 | return(sign); 25 | 26 | return(sign*sinh(arg)/cosh(arg)); 27 | } 28 | -------------------------------------------------------------------------------- /usr/src/libmp/Makefile: -------------------------------------------------------------------------------- 1 | OBJECTS = gcd.o \ 2 | madd.o \ 3 | mdiv.o \ 4 | mout.o \ 5 | msqrt.o \ 6 | mult.o \ 7 | pow.o \ 8 | util.o 9 | 10 | TARGET = libmp.a 11 | 12 | all: $(TARGET) 13 | 14 | $(TARGET): $(OBJECTS) 15 | $(AR) rcu $@ $^ 16 | $(RANLIB) $@ 17 | 18 | SUBDIR_LEVEL := ../../.. 19 | include $(SUBDIR_LEVEL)/tools/tools.mk 20 | include $(SUBDIR_LEVEL)/tools/patterns.mk 21 | -------------------------------------------------------------------------------- /usr/src/libmp/compall: -------------------------------------------------------------------------------- 1 | cc -c -O pow.c gcd.c msqrt.c mdiv.c mout.c mult.c madd.c util.c 2 | -------------------------------------------------------------------------------- /usr/src/libmp/mklib: -------------------------------------------------------------------------------- 1 | ar cr libmp.a pow.o gcd.o msqrt.o mdiv.o mout.o mult.o madd.o util.o 2 | -------------------------------------------------------------------------------- /usr/src/libplot/makefile: -------------------------------------------------------------------------------- 1 | all: libplot.a libt4014.a libt300.a libt300s.a libt450.a 2 | 3 | cp: all 4 | cp lib*.a /lib 5 | libplot.a: plot.c.a 6 | ar x plot.c.a 7 | cc -c -O *.c 8 | ar rc libplot.a *.o 9 | rm *.c *.o 10 | libt4014.a: t4014.c.a 11 | ar x t4014.c.a 12 | cc -c -O *.c 13 | ar rc libt4014.a *.o 14 | rm *.c *.o 15 | libt300.a: t300.c.a 16 | ar x t300.c.a 17 | cc -c -O *.c 18 | ar rc libt300.a *.o 19 | rm *.c *.o 20 | libt300s.a: t300s.c.a 21 | ar x t300s.c.a 22 | cc -c -O *.c 23 | ar rc libt300s.a *.o 24 | rm *.c *.o 25 | libt450.a: t450.c.a 26 | ar x t450.c.a 27 | cc -c -O *.c 28 | ar rc libt450.a *.o 29 | rm *.c *.o 30 | -------------------------------------------------------------------------------- /usr/sys/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "optional": "c" 4 | } 5 | } -------------------------------------------------------------------------------- /usr/sys/40/README: -------------------------------------------------------------------------------- 1 | The m40.s here is purported to support 7th edition Unix 2 | on the 11/40, 11/60, and 11/23. It has, in fact, 3 | worked on the latter machine. 4 | The param.h is included because various sizes have to 5 | be cut down considerably; this is a guide. 6 | (Things will be tight! You might consider removing some system calls 7 | you don't care about, like accounting.) 8 | Also, it is necessary to remove the 9 | .data 10 | from line 3 of the l.s file, because the interrupt 11 | vectors and such should go in I space. 12 | 13 | Support is included for FP11-style floating point 14 | but I can't vouch for it. 15 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/dev/bcm283x_gpio.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM283X_GPIO_H 2 | #define BCM283X_GPIO_H 3 | 4 | extern void bcm283x_gpio_setup_for_pl011(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/dev/bcm283x_mbox.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM283X_MBOX_H 2 | #define BCM283X_MBOX_H 3 | 4 | #include "../kstddef.h" 5 | #include "../../h/types.h" 6 | 7 | extern int bcm283x_mbox_get_arm_memory(u32 *v); 8 | extern int bcm283x_mbox_set_uart_clock(u32 hz, u32 *new_hz); 9 | extern int bcm283x_mbox_get_sdcard_clock(u32 *hz); 10 | 11 | extern int bcm283x_mbox_sdcard_power(u32 onoff); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/dev/bcm283x_pl011.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM283X_PL011_H 2 | #define BCM283X_PL011_H 3 | 4 | #include "../kstddef.h" 5 | 6 | #define REQUIRED_PLL011_CLOCK_RATE_MHZ 3000000 /* 3MHz */ 7 | extern void bcm283x_uart_early_init(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/dev/bcm283x_systimer.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM283X_SYSTIMER_H 2 | #define BCM283X_SYSTIMER_H 3 | 4 | #include "../kstddef.h" 5 | #include "../../h/types.h" 6 | 7 | extern void udelay(u32 us); 8 | extern void clkinit(void); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/gdb-commands-lowlevel-startup.txt: -------------------------------------------------------------------------------- 1 | file pi1unix.elf 2 | symbol-file pi1unix.elf 3 | add-symbol-file pi1unix.elf 0x8000 4 | target remote localhost:1234 5 | layout reg 6 | break startup.s:191 7 | break startup.s:201 8 | break startup.s:217 9 | break startup.s:289 10 | break startup.s:303 11 | break startup.s:314 12 | break startup.s:325 13 | break startup.s:334 14 | break startup.s:343 15 | break startup.s:357 16 | break startup.s:370 17 | break startup.s:383 18 | break startup.s:393 19 | break startup.s:404 20 | break startup.s:436 21 | break startup.s:442 22 | break startup.s:468 23 | break startup.s:481 24 | break startup.s:555 25 | break startup.s:579 26 | break startup.s:592 27 | break startup.s:603 28 | break startup.s:622 29 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/kstddef.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM2835_KSTDDEF_H 2 | #define BCM2835_KSTDDEF_H 3 | 4 | #define BIT(N) (1U << (N)) 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/mkstartcode: -------------------------------------------------------------------------------- 1 | #!/bin/sh -xe 2 | 3 | arm-none-eabi-as -ggdb -march=armv6k -o startcode.o startcode.s 4 | arm-none-eabi-gcc -T startcode.lds startcode.o -o startcode.elf \ 5 | -nostdlib -nostdinc -Wl,--build-id=none -ffreestanding -marm -march=armv6k -mfloat-abi=hard -ggdb 6 | arm-none-eabi-objdump -D -M reg-names-raw startcode.elf > startcode.lst 7 | arm-none-eabi-objcopy -O binary startcode.elf startcode.bin 8 | od -t x4 -v startcode.bin 9 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/startcode.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm") 2 | ENTRY(_start) 3 | 4 | SECTIONS 5 | { 6 | .text . : AT (0) { 7 | startcode.o(.text) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/startcode.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ Assembly code used to generate the startup stub (icode) in bcm283x_machdep.c 3 | @ 4 | .syntax unified 5 | .arm 6 | .section .text 7 | 8 | .global _start 9 | _start: 10 | ldr lr, =indirect 11 | swi #0 12 | b . 13 | 14 | .p2align 2 15 | arg0: .asciz "/etc/init" 16 | 17 | .p2align 2 18 | arg1: 19 | .word arg0 20 | .word 0 21 | 22 | .p2align 2 23 | args: 24 | .word 11 25 | .word arg0 26 | .word arg1 27 | 28 | .p2align 2 29 | indirect: 30 | .word args 31 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/trap_exit.s: -------------------------------------------------------------------------------- 1 | .arm 2 | .syntax unified 3 | .section .text 4 | 5 | .global __eret_user 6 | __eret_user: 7 | ldr r0, [sp, #(4*16)] 8 | msr spsr_cxsf, r0 9 | 10 | ldmia sp, {r0-r14}^ 11 | add sp, sp, #(4*18) 12 | ldr lr, [sp, #-12] 13 | clrex 14 | movs pc, lr 15 | 16 | .global __eret_kernel 17 | __eret_kernel: 18 | ldr r0, [sp, #(4*16)] 19 | msr spsr_cxsf, r0 20 | clrex 21 | ldmia sp, {r0-r15}^ 22 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/udot.c: -------------------------------------------------------------------------------- 1 | #include "../h/param.h" 2 | #include "../h/dir.h" 3 | #include "../h/user.h" 4 | 5 | struct user u __attribute__ ((section (".udot"))); 6 | -------------------------------------------------------------------------------- /usr/sys/bcm283x/undefined.h: -------------------------------------------------------------------------------- 1 | #ifndef BCM283X_UNDEFINED_H 2 | #define BCM283X_UNDEFINED_H 3 | 4 | struct tf_regs_t; 5 | 6 | extern int handle_undefined(struct tf_regs_t *tf); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /usr/sys/conf/hphtconf: -------------------------------------------------------------------------------- 1 | hp 2 | root hp 0 3 | swap hp 1 4 | swplo 0 5 | nswap 8778 6 | ht 7 | -------------------------------------------------------------------------------- /usr/sys/conf/hptmconf: -------------------------------------------------------------------------------- 1 | hp 2 | root hp 0 3 | swap hp 1 4 | swplo 0 5 | nswap 8778 6 | tm 7 | -------------------------------------------------------------------------------- /usr/sys/conf/makefile: -------------------------------------------------------------------------------- 1 | unix: l.o mch.o c.o ../sys/LIB1 ../dev/LIB2 2 | ld -o unix -X -i l.o mch.o c.o ../sys/LIB1 ../dev/LIB2 3 | 4 | all: 5 | cd ../sys; cc -c -O *.c; mklib; rm *.o 6 | cd ../dev; cc -c -O *.c; mklib; rm *.o 7 | 8 | mch.o: mch0.s mch.s 9 | as -o mch.o mch0.s mch.s 10 | 11 | allsystems: 12 | mkconf