1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-10 02:48:05 +11:00
Commit Graph

237 Commits

Author SHA1 Message Date
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
Virgil Dupras
3db38b0d89 basic: add while command 2019-12-12 11:17:10 -05:00
Virgil Dupras
5d33d165a2 cfspack: allow multiple patterns and multiple paths in args
Also, always end the CFS chain with a stop block.

fixes #55 #56 #57
2019-12-11 21:08:46 -05:00
Virgil Dupras
888395d496 tools: replace tools for old shell with tools for new shell
ref #80
2019-12-11 14:58:50 -05:00
Virgil Dupras
25d25d017c Replace old shell with BASIC shell
fixes #80
2019-12-11 14:05:34 -05:00
Virgil Dupras
20151a97f8 recipes/rc2014/zasm: use BASIC shell
Also made Makefile actually portable.
2019-12-11 13:01:51 -05:00
Virgil Dupras
7907687abf tools/uploadb: make it much much faster
By uploading a BASIC loop and then run it, we can reduce the serial
communication to pure content which greatly reduces the overhead and make
the process much much faster.
2019-12-11 09:27:05 -05:00
Virgil Dupras
b40b39f45c tools: add blkdumpb 2019-12-10 10:33:29 -05:00
Virgil Dupras
9ec71ecfee tools/uploadb: rewrite in C 2019-12-09 22:05:39 -05:00
Virgil Dupras
fcee98ee4e tools: use the new "puth" BASIC command 2019-12-09 21:17:45 -05:00
Virgil Dupras
beaea6f978 basic: add puth command 2019-12-09 14:34:14 -05:00
Virgil Dupras
d9db0a824e Make makefiles and shell scripts portable
It's no longer required to use `gmake` under OpenBSD and shell scripts
no longer require bash.
2019-12-09 09:45:22 -05:00
Virgil Dupras
8ff4b18c51 tools: add memdumpb
In C this time. Python/Perl code is barely terser than C for these little
tools. Why bother with interpreted?
2019-12-08 22:33:33 -05:00
Virgil Dupras
b56d6ca1c7 Rewrite uploadb.py in perl
I know, this is silly, but I'm moving tools to something a bit closer to the
system. I consider perl to be more system-like than python for a simple reason:
perl is part of the OpenBSD base system and python is not.

Also, I'm learning perl and using this as an opportunity.
2019-12-08 08:32:19 -05:00
Virgil Dupras
30a0f69101 Fix broken uploadb.py
putc didn't work well with any byte value on most terminal configuration. It
was a bad idea...
2019-12-02 22:57:22 -05:00
Virgil Dupras
270ad926c9 recipes/sms: use BASIC shell 2019-12-02 20:18:41 -05:00
Virgil Dupras
66dacd1816 tools/emul: add "Min SP" debug value
This gives the maximum size of the stack at any given moment during the
execution of the program. It's useful to figure out if the stack gets
dangerously close to the heap.
2019-12-02 17:44:54 -05:00
Virgil Dupras
2f07d849a8 tools/emul: deduplicate a little bit of C code 2019-12-02 17:28:01 -05:00
Virgil Dupras
572e3566eb Add upload tooling for BASIC shell 2019-11-30 22:36:14 -05:00
Virgil Dupras
871b06fecf bshell: adjust RAMSTART to avoid clashwith USER_CODE
With a 0x4000 RAMSTART, bshell's RAM usage clashed with USER_CODE, making
RAM-using userapp break everything.
2019-11-30 19:50:23 -05:00
Virgil Dupras
7c893dada1 basic: can now execute user apps!
Shell replacement sequence beginning in 3, 2, 1...
2019-11-25 22:05:10 -05:00
Virgil Dupras
12bc120375 basic: add bsel, bseek, getb, putb commands 2019-11-24 20:34:23 -05:00
Virgil Dupras
e1df320d44 basic: add ldbas command 2019-11-24 14:26:32 -05:00
Virgil Dupras
13f935aa88 basic: add fls command
Also, add the new `bshell` emulated tool. BASIC is on its way to replace the
shell.
2019-11-24 10:24:15 -05:00
Virgil Dupras
585e9f3b6e tools/emul: add troubleshooting instructions in README
fixes #79
2019-11-23 15:22:26 -05:00
Virgil Dupras
a680fd3328 basic: add support for signed integers 2019-11-23 14:56:23 -05:00
Virgil Dupras
43b450ca30 Update bootstrap binaries 2019-11-22 19:57:11 -05:00
Virgil Dupras
2f71ad6d2f lib/expr: add left/right shifting operators 2019-11-22 18:35:10 -05:00
Virgil Dupras
a03c5ac700 lib/expr: add bitwise operators 2019-11-22 17:16:51 -05:00
Virgil Dupras
972e8221f1 lib/expr: add division and modulo operators 2019-11-22 15:03:16 -05:00
Virgil Dupras
1b01f13105 lib/expr: refactor for easier operator addition 2019-11-22 14:45:12 -05:00
Virgil Dupras
7262993f14 basic: add if 2019-11-21 16:06:14 -05:00
Virgil Dupras
f5b04fc02f basic: add expression support to print
Again, same thing as in zasm.
2019-11-18 15:52:44 -05:00
Virgil Dupras
0bd58fd178 basic: parse hex, binary and char literals
Same thing as in zasm.
2019-11-18 15:22:09 -05:00
Virgil Dupras
1cea6e71e0 basic: add a print cmd
It can only print a decimal literal. But still, that's a big step because
I hadn't implemented decimal formatting yet.
2019-11-18 13:40:23 -05:00
Virgil Dupras
019d05f64c Make the shell a userspace app
That's my mega-commit you've all been waiting for.

The code for the shell share more routines with userspace apps than with kernel
units, because, well, its behavior is that of a userspace app, not a device
driver.

This created a weird situation with libraries and jump tables. Some routine
belonging to the `kernel/` directory felt weird there.

And then comes `apps/basic`, which will likely share even more code with the
shell. I was seeing myself creating huge jump tables to reuse code from the
shell. It didn't feel right.

Moreover, we'll probably want basic-like apps to optionnally replace the shell.

So here I am with this huge change in the project structure. I didn't test all
recipes on hardware yet, I will do later. I might have broken some...

But now, the structure feels better and the line between what belongs to
`kernel` and what belongs to `apps` feels clearer.
2019-11-15 15:37:49 -05:00
Virgil Dupras
cdd0b64570 Modify userspace .org and RAMSTART expectations
Instead of expecting a `USER_CODE` symbol to be set, we expect `.org` to be
set in all userspace glue code. This gives us more flexibility with regards to
how we manage that.

Moreover, instead of making `USER_RAMSTART` mandatory, we make it default to
the end of the binary, which is adequate in a majority of cases.

Will be useful for my upcoming mega-commit... :)
2019-11-15 10:33:13 -05:00
Virgil Dupras
d74b85f146 zasm: allow .org to be specified from command line
Also important for upcoming mega commit...
2019-11-15 09:57:53 -05:00
Virgil Dupras
e5255d22f9 zasm: make .org affect "@" symbol 2019-11-15 08:59:26 -05:00
Virgil Dupras
79e04189b0 Update bootstrap binaries 2019-11-14 21:25:11 -05:00
Virgil Dupras
6e714875dc zasm: Constants now override labels at all times
Will be important for a mega-commit I'm preparing.
2019-11-14 21:16:36 -05:00
Virgil Dupras
7cf3ed38da Extract str.asm from core.asm and make core included by userspace
Most of register fiddling routines (which is now the only thing contained
in care.asm) are used by almost all userspace apps, often in inner loops.

That makes the penalty of using jump tables for those a bit too high.
Moreover, it burdens jump tables needlessly.

Because this unit is very small (now that string routines are out), it makes
sense to always include it in binaries.
2019-11-14 10:14:15 -05:00
Virgil Dupras
0e79035d9c Disable test failing on Travis 2019-11-13 22:37:00 -05:00
Virgil Dupras
69750b4da6 Update bootstrap binaries 2019-11-13 22:28:47 -05:00
Virgil Dupras
82995eb346 zasm: have .fill generate an error on overflow
Can possibly avoid a lot of debugging pain.
2019-11-13 22:27:48 -05:00
Virgil Dupras
8d46895dd3 lib/parse: decimal ending with a whitespace are now valid
Also, make empty strings be parsed as invalid by parseDecimal.
2019-11-13 22:10:06 -05:00
Virgil Dupras
7274dccbe7 Move ASCII consts to ascii.h
And made them shorter in name. The new ascii.h file allow reuse in userspace
code.
2019-11-13 20:38:06 -05:00
Virgil Dupras
f3992ed598 basic: begin an implementation from sratch
Let's see where it will lead us...
2019-11-13 15:28:16 -05:00
Virgil Dupras
1ae51bea3a tests: remove instr blacklist
Because scas isn't used as a reference anymore, no need to blacklist its bugs
anymore.
2019-11-12 20:47:09 -05:00