1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 01:30:56 +11:00
Commit Graph

285 Commits

Author SHA1 Message Date
Virgil Dupras
e37f4c2551 bin2c: add missing stdtypes.h 2020-04-07 18:13:42 -04:00
Byron A. Grobe
217df20d77
Moved tools/bin2c to single-level with other tools. 2020-04-07 16:56:55 -05:00
Byron A. Grobe
f65c189e9b
Replace bin2c.sh with a more portable implementation.
`xxd' is not available on all systems, and on others does not support
the `-i' flag. Since bin2c.sh relied on a tool that I can't seem to find
a compatible version of, I have included a simple, portable replacement in C.

Usage remains the same:
bin2c ARRAYNAME < inputfile > outputfile.

This change is also reflected in emul/Makefile.
2020-04-05 13:04:05 -05:00
Virgil Dupras
049f2cf222 Reverse ttysafe escaping order
Sending the escape after its target made things complicated for upcoming
stuff I want to add. Although it makes `recv.asm` slightly larger, it's really
worth it.
2020-02-22 14:11:43 -05:00
Virgil Dupras
c5116b39ae Fix tools Makefile for GNU make
It seems that my little "@.c" trick only worked in BSD make...
2020-02-12 10:12:46 -05:00
Virgil Dupras
a74ee81822 recipes/trs80: new recipe (WIP) 2020-01-11 23:01:28 -05:00
Virgil Dupras
439f880abe Rewrite font_compile.pl to C 2020-01-07 18:26:40 -05:00
Virgil Dupras
359991c005 cfspack: fix compilation error
Some compilers don't like assigning stdout statically.
2019-12-31 15:12:17 -05:00
Virgil Dupras
4cde58fd83 cfspack: make into a library
Use it in shell instead of using popen()
2019-12-31 13:57:52 -05:00
Virgil Dupras
72357fec86 Move "emul" folder to root 2019-12-31 13:34:24 -05:00
Virgil Dupras
40f56dd6dc cfspack: silence compilation warning 2019-12-31 13:08:24 -05:00
Virgil Dupras
c5c6ef4c6c Move "tests" folder to root 2019-12-31 13:07:05 -05:00
Virgil Dupras
e3c885085d Consolidate tests
Also, removed leftover in runbin.c (what did it do there??) that
could result in tests falsely passing.
2019-12-30 20:08:08 -05:00
Virgil Dupras
7ca54d179d lib/expr: make EXPR_PARSE "tail" HL
Things are now much simpler.
2019-12-30 19:24:53 -05:00
Virgil Dupras
289037a3dd lib/parse: make parseDecimal "tail" HL
HL, instead of being preserved, is set to the character following
the last read character.
2019-12-30 10:13:55 -05:00
Virgil Dupras
dcb96aefe9 lib/parse: remove parseHexPair
Also, make parseHexadecimal "tail" (HL). Soon, all routines in lib/parse
will do that, making the life of lib/expr easier.
2019-12-29 21:56:56 -05:00
Virgil Dupras
2503bdfced lib/args: remove 2019-12-29 21:05:09 -05:00
Virgil Dupras
981c93bfd4 lib/expr: fix stack imbalance on failure 2019-12-29 16:15:48 -05:00
Virgil Dupras
4760d044c0 test_expr: simplify 2019-12-29 15:39:39 -05:00
Virgil Dupras
213614af33 lib/expr: make recursion process a bit more orderly
Instead of going left and right, finding operators chars and replacing them
with nulls, we parse expressions in a more orderly manner, one chunk at a
time. I think it qualifies as "recursive descent", but I'm not sure.

This allows us to preserve the string we parse and should also make the
implementation of parens much easier.
2019-12-29 11:42:18 -05:00
Virgil Dupras
7410891ad1 lib/expr: fix unary minus
For some reason, I've mistakenly disabled tests in test_expr without noticing
and I also broke "-123" parsing. Fixed.
2019-12-23 20:53:31 -05:00
Virgil Dupras
6d88c3a754 parseExprDE --> parseExpr 2019-12-23 19:13:44 -05:00
Virgil Dupras
025b90909f Update bootstrap bin 2019-12-23 16:03:23 -05:00
Virgil Dupras
aef96c5e96 Add missing common.asm test harness file 2019-12-23 16:02:26 -05:00
Virgil Dupras
a034f63e23 test: begin adding common test harnessing code
This should make tests a bit more convenient to write and debug.

Moreover, begin de de-IX-ization of parseExpr. I have, in a local WIP, a
parseExpr implemented using a recursive descent algo, it passes all tests, but
it unfortunately assembles a faulty zasm. I have to find the expressions that
it doesn't parse properly.

But before I do that, I prefer to commit these significant improvements I've
been making to tests harness in parallel of this development.
2019-12-23 15:41:25 -05:00
Virgil Dupras
98ca338aba avra: add LD/ST 2019-12-22 21:50:20 -05:00
Virgil Dupras
b955a67daa avra: add TST 2019-12-22 19:24:36 -05:00
Virgil Dupras
6e1e8e0e59 avra: add LSL 2019-12-22 18:36:15 -05:00
Virgil Dupras
8ded02bc78 avra: fix misordered MOV, MUL, NEG and NOP 2019-12-22 18:35:08 -05:00
Virgil Dupras
f54e10f9fd avra: add CALL and JMP 2019-12-22 15:54:46 -05:00
Virgil Dupras
10b925e0e0 avra: add BCLR and BSET 2019-12-22 15:11:15 -05:00
Virgil Dupras
1771ee8da7 avra: add SER 2019-12-22 15:01:08 -05:00
Virgil Dupras
0a9ac27cf6 avra: add SBIC and SBIS 2019-12-22 14:55:38 -05:00
Virgil Dupras
a9dcba5793 avra: add CBR instruction 2019-12-22 14:45:10 -05:00
Virgil Dupras
c968995ec0 avra: add CBI and SBI
This completes instruction support for the Blink tn45 example.
2019-12-15 20:51:31 -05:00
Virgil Dupras
2652c81519 avra: make CLR work properly 2019-12-15 16:43:32 -05:00
Virgil Dupras
aa8df95f7d Add "avr/" includes folder
Also, add a "real world" example in AVRA tests, a blink program on
a ATtiny45. Some instructions are commented out because they aren't
implemented yet, but not many.

The output of the program has been verified against AVRA's own
output.
2019-12-15 09:38:01 -05:00
Virgil Dupras
64935d8b40 avra: add IN and OUT instructions 2019-12-15 08:43:59 -05:00
Virgil Dupras
fa75f30ffb avra: add RJMP and RCALL instructions 2019-12-14 12:28:27 -05:00
Virgil Dupras
a5efc695e9 avra: add "Rd + bit" instructions 2019-12-14 09:33:46 -05:00
Virgil Dupras
c696fcbce4 avra: add "with immediate" instructions 2019-12-14 09:05:38 -05:00
Virgil Dupras
4b9712a224 avra: add branching instructions 2019-12-13 22:49:15 -05:00
Virgil Dupras
57c1a10434 avra: first steps 2019-12-13 17:38:40 -05:00
Virgil Dupras
e691dab070 zasm: little drive-by optimization
Use IX directly for argspec rows instead of going through DE. It saves a bit
of processing. The code was this way because I initially didn't use IX at all,
so as code evolved, that DE translation stayed as an artifact.
2019-12-13 10:54:01 -05:00
James Stanley
1b8b113536 Fix filesystem in shell emulator
We now treat the block device as fixed-size rather than trying to grow it in response
to kernel activity.

Previously, if you tried to create 2 files in a row, only the first 1 would actually appear,
because the device only ever got larger when a byte was written immediately past the end of
the device.

Now we just let the kernel write bytes to the disk anywhere, so new files can be created even
when the previous file is not completely full.

Also, fix buffer overrun in reading filesystem image, and use a more idiomatic fgetc loop.
2019-12-12 16:58:17 -05:00
Virgil Dupras
948a06cb41 tools/tests: add missing doc about shell tests 2019-12-12 16:31:52 -05:00
Virgil Dupras
4f7a05e3b7 core: remove cpHLDE
It wasn't used much, so I replaced its use in the kernel with direct code
and moved the routine in apps/ed, the only other place where it was used.
2019-12-12 15:53:14 -05:00
Virgil Dupras
c002c69208 Include tools/tests/shell/test.cfs in repo
The order in which cfspack includes its file depend on the platform. To have
tests that reliably pass, test.cfs has to be committed in.
2019-12-12 14:49:09 -05:00
Virgil Dupras
9ab292a6d5 Add shell automated tests 2019-12-12 14:32:47 -05:00
Virgil Dupras
5b155a5c15 tools: use BASIC's new while loop
Also, increase STDIO_BUFSIZE to 0x40 so that those while loops work.
2019-12-12 12:04:56 -05:00