Commit graph

6 commits

Author SHA1 Message Date
George Koehler bec236c108 Include more headers to declare functions.
This causes clang to give fewer warnings of implicit declarations of
functions.

In mach/pdp/cv/cv.c, rename wr_int2() to cv_int2() because it
conflicts with wr_int2() in <object.h>.

In util/ack, rename F_OK to F_TRANSFORM because it conflicts with F_OK
for access() in <unistd.h>.
2019-03-22 15:59:35 -04:00
George Koehler 969e98b82d Create Mach-o files with mode 0777 to allow executing them.
Until now, I was always doing chmod +x before running my files on the
Mac.  Now files get created +x.  There's no change when overwriting
an existing file.  I needed to gmake clean my build to remove the
example programs without +x, so cvmach can create them with +x.
2016-12-03 17:52:24 -05:00
George Koehler e06b1fa05e Write a manual page for cvmach(6).
This manual is in the new mdoc(7) format.  All existing ack manuals
use the old man(7) format.  This might be a problem if someone can't
display mdoc(7) files.

The build system doesn't install the cvmach(6) manual; that might
happen later.  The current build system installs manuals in two
different places, and doesn't install some manuals, so I don't know
what to do.
2016-12-02 18:04:06 -05:00
George Koehler 98f2273d97 Teach cvmach to emit the symbol table.
This preserves the name and value of every symbol.  The type and other
info of a symbol might be lost.  In gdb, one can now "disas main" or
"disas '.ret'" to disassemble functions by name.

Most symbols are in sections, so I also teach cvmach to emit the Mach
section headers.  The entry point in plat/osx*/descr moves down to
make room for the section headers and LC_SYMTAB.

I fix some bugs in calculations of cvmach.  They were wrong if ROM had
a greater alignment than TEXT, or if DATA did not start on a page
boundary.  I introduce machseg[] to simplify the mess of variables in
main().  I declare most functions as static.  Also, cvmach becomes the
first program to #include <object.h>.
2016-11-22 17:16:30 -05:00
George Koehler 7f94e971fd Remove trailing whitespace in plat/osx*
Also fix a comment.
2016-11-08 15:22:09 -05:00
George Koehler 02fb480217 Commit a preview of osx386 and osxppc as new platforms.
These produce Mach-o executables for Mac OS X on Intel or PowerPC
processors.  Our code generator for PowerPC (mach/powerpc) still has
bugs.  Some examples seem to run, but startrek crashes.  Our code
generator for Intel (mach/i386) is better.

There is a problem with job control.  If you run paranoia or startrek,
then suspend the job (^Z) and resume it ('fg' in bash), then read(2)
might fail with EINTR.

The larger files in this commit are
 - plat/osx/cvmach/cvmach.c
 - plat/osx/libsys/brk.c
 - plat/osx386/libsys/sigaction.s
 - plat/osxppc/libsys/sigaction.s
2016-10-02 14:58:05 -04:00