Commit graph

7213 commits

Author SHA1 Message Date
David Given a69045c0e4 Import aap@github's B compiler. 2016-11-27 11:37:25 +01:00
David Given 4f446467c8 Suppress spurious message when testdriver probes for a testing method. 2016-11-26 21:50:56 +01:00
David Given 4633ca0886 Updated the README. 2016-11-26 19:25:02 +01:00
David Given 9641801455 Merge pull request #17 from davidgiven/dtrg-tests
Refactor the tests so they run for several plats.
2016-11-26 12:59:13 +01:00
David Given 2dc083f436 Use command -v rather than hash to detect commands (command is Posix and works
on OpenBSD).
2016-11-26 12:53:36 +01:00
David Given a596973f28 OSX doesn't work; let's not bother building it. 2016-11-26 12:52:09 +01:00
David Given a9a0b37b14 Plats which use aelflod need to depend on it. 2016-11-26 12:07:08 +01:00
David Given dff67447fe qmu-system-x86 isn't in Travis' repository? Let's try qemu-user. 2016-11-26 12:00:59 +01:00
David Given 98c761d5c0 Enable tests for linux386 via qemu-i386. 2016-11-26 11:58:02 +01:00
David Given cf33bd6cc4 Enable tests for linuxppc via qemu-ppc. 2016-11-26 11:56:17 +01:00
David Given 90e3d45c69 Travis only whitelists the -x86 version of qemu. 2016-11-26 11:29:57 +01:00
David Given 8a58614aef Rework the tests to run on pc86; lots of test fixes for the brk() test, which
was nearly useless; lots of fixes to qemuppc and pc86 sbrk(), which was broken;
change the pc86 console to echo output to the serial port (needed for running
tests on qemu).
2016-11-26 11:23:25 +01:00
David Given 5f66f06dc6 Refactored the tests to make the generic across different plats. 2016-11-25 21:02:51 +01:00
David Given bfa8e501a3 Make pc86 echo console output to the serial port, so qemu can pipe it to
stdout.
2016-11-25 20:28:41 +01:00
David Given ed181a8d20 Ansify Paranoia, because I was getting annoyed by all the compiler warnings on
every build.
2016-11-25 20:01:43 +01:00
David Given b21197c0c7 Merge pull request #16 from davidgiven/dtrg-pascal-mark-release
Remove the Mark() and Release() procedures from Pascal.
2016-11-24 20:45:14 +01:00
David Given c084f9f224 Remove the Mark() and Release() procedures from the Pascal compiler and
standard library, because they never worked and come from an achingly old
version of the Pascal specification. Fix the implementations of New() and
Dispose() to use the standard C memory allocator rather than rolling their own
(also in C). Write test!
2016-11-24 20:35:26 +01:00
David Given 899f1ea4f3 Forgot to check in the change to qemuppc's brk() to set errno on memory
allocation failure.
2016-11-24 19:47:11 +01:00
David Given 3b46aadf94 Merge pull request #15 from davidgiven/dtrg-allocs
Fix various memory allocation bugs.
2016-11-23 22:35:50 +01:00
David Given 991f47098c Add a test for brk() and sbrk(). 2016-11-23 22:28:21 +01:00
David Given 6cd2a9ba81 Add a test for calloc(). 2016-11-23 22:22:04 +01:00
David Given 9481487e3d Implement calloc() (accidentally got dropped with the malloc rewrite). 2016-11-23 22:16:25 +01:00
David Given 36ab90385f Change sbrk() to take an int rather than an intptr_t (following the OpenBSD way
rather than the Linux way; various non-C bits of the ACK assume it takes an
int, so it's cleaner).
2016-11-23 22:06:24 +01:00
David Given 0aac9aafd3 Combine brk() with sbrk(); modify brk() to update the sbrk(0) value. 2016-11-23 22:04:21 +01:00
David Given 0b21f18d4c Merge pull request #14 from davidgiven/dtrg-experimental-mcgg
Merge mcg code generator to trunk
2016-11-23 21:58:31 +01:00
David Given 2367b011f5 Don't install qemu-system-ppc until openbios-ppc gets whitelisted by Travis. 2016-11-23 21:53:14 +01:00
George Koehler b6b707d9df Make working gettimeofday() for Mac OS X.
The system call puts the time in a pair of registers, not in the
timeval structure.  Add code to move the time to the structure, so
programs see the correct time, not garbage.  This fixes our example
programs that use the time as a random seed.
2016-11-23 13:25:55 -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 19310d2521 Make possible to #include <object.h>.
This header declares functions in libobject.  Our programs never
included object.h, but called functions in libobject without declaring
them.  So, our build system never put object.h in the include path;
any #include <object.h> would fail to find the header.

With this commit, a program may #include <object.h> if it has
modules/src/object+lib in its deps.

Declare structs in object.h so we can use them in prototypes without
gcc warning, "'struct whatever' declared inside parameter list".

Remove inclusion of ansi.h from object.h.  Programs would need to
depend on modules+headers to get ansi.h in the include path.
2016-11-22 11:13:14 -05:00
David Given 6e9c2d5c0d Also call .trp .trap, for ncg compatibility. 2016-11-20 19:39:28 +01:00
David Given f8fa3ece42 inn on ncg now passes the CPU tests. 2016-11-20 19:35:34 +01:00
David Given 2d0bc7ef0d Finally fix the build system issue where ackprogram would try to explicitly
link all the language libraries.
2016-11-20 18:57:44 +01:00
George Koehler 88c2ea63aa Use uint32_t in util/led/main.c
This uses uint32_t for the base, file offset, and alignment of each
section, to be consistent with the usage of uint32_t in h/out.h

Also declare setbit() as static.
2016-11-20 11:38:16 -05:00
David Given 953c08839f inn works now; add a helper for it. 2016-11-20 12:53:44 +01:00
David Given 196fa914b3 lxa now works, I hope; traps are better (and stubbed out on qemuppc). 2016-11-20 11:57:21 +01:00
David Given d5328492d7 Better handling of float conversions; more tests; converting to unsigned ints
works now.
2016-11-20 11:27:40 +01:00
David Given 132baac78a Add some more tests. 2016-11-20 10:46:53 +01:00
David Given 84c7b6ba90 No, sudo doesn't get openbios-ppc installed. I added a whitelisting request:
https://github.com/travis-ci/apt-package-whitelist/issues/3745
2016-11-20 10:36:30 +01:00
David Given 3f45a7d633 Need sudo to install openbios-ppc. 2016-11-20 10:09:58 +01:00
David Given 5423a175c6 Install openbios on Travis (needed by qemu-system-ppc). 2016-11-20 10:00:59 +01:00
George Koehler 6e31d46d6f Fix my typo to put symbol "begrom" in correct section. 2016-11-19 19:23:42 -05:00
David Given 454a7494bb cif8 and cuf8 work now. More tests. 2016-11-19 11:42:30 +01:00
David Given cc660b230f Floats and doubles are now written out correctly. 2016-11-19 11:39:13 +01:00
David Given db3564f35a Use .hol0 as an additional name for hol0; mcg requires it. 2016-11-19 11:09:07 +01:00
David Given d31bc6a3f9 Made csa and csb work with mcg; adjust the libem functions and the
corresponding invocation in the ncg table so the same helpers can be used for
both mcg and ncg. Add a new IR opcode, FARJUMP, which jumps to a helper
function but saves volatile registers.
2016-11-19 10:55:41 +01:00
David Given 5208e5f751 Yet another OB1 stack format fix. 2016-11-19 10:42:22 +01:00
David Given a4616b7124 Betterer timeout handling. 2016-11-17 22:04:50 +01:00
David Given 43439c6d0c Remember to push the result of lor onto the stack. 2016-11-17 22:04:32 +01:00
David Given 745eb8f17b Now _errsym and _erlsym are defined in the standard library, don't define them
in the program.
2016-11-16 21:13:00 +01:00
David Given c25ad82a89 Tests can now specify (via a hacky filename suffix) which runtime they want. 2016-11-16 21:08:03 +01:00