Commit Graph

66 Commits

Author SHA1 Message Date
Virgil Dupras 097c677641 emul/zasm: use libcfs
This allows us to get rid of the zasm.sh wrapper.
2019-12-31 15:07:39 -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 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 880775ae69 recipes/rc2014/sdcard: use BASIC shell 2019-12-11 11:18:32 -05:00
Virgil Dupras fb93fcd6e6 recipes/rc2014/eeprom: add usr.asm
A little life saver if your target shell doesn't have a proper at28w.
2019-12-09 21:03:31 -05:00
Virgil Dupras b9292eb8d0 recipes/rc2014/ps2: Use BASIC shell 2019-12-06 20:00:29 -05:00
Virgil Dupras 08392fee60 recipes/rc2014/eeprom: use BASIC shell 2019-12-02 23:00:35 -05:00
Virgil Dupras 10864afa96 recipes/ti84: use the BASIC shell 2019-12-01 20:11:13 -05:00
Virgil Dupras aad8efeff7 recipes/rc2014/basic: new recipe 2019-11-23 21:22:31 -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 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 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 9344c4b961 doc: minor improvements 2019-11-04 14:45:10 -05:00
Virgil Dupras 2a55bfd375 stdio: remove a layer of indirection in GetC/PutC
We use zasm's ability to use labels in .equ directive.

We didn't do it before because for a while, we were in between scas
and zasm (scas was used in automated tests) so we needed to use the
lowest common denominator: zasm doesn't have macros and scas can't
use labels in .equ directives.

This forced us to add this layer of indirection. But now that we are
completely cut from scas' dependency, we can use this nice zasm's
ability.
2019-11-04 09:55:12 -05:00
Virgil Dupras 20c0ba3dd0 Clarify recipes structure
Drop the "{pre,post}-collapse" thing and specify that the rc2014 recipes
are canonical.
2019-11-03 16:09:11 -05:00
Virgil Dupras b745f49186 Rename blockdev's API routines to GetB/PutB
The goal is to avoid mixing those routines with "character devices"
(acia, vpd, kbd) which aren't block devices and have routines that
have different expectations.

This is a first step to fixing #64.
2019-10-30 16:59:35 -04:00
Virgil Dupras f4b6c7637d zasm: rename #inc to .inc
scas, it's not needed any more.
2019-10-06 14:32:23 -04:00
Virgil Dupras 0c0db41477 recipes/sms/kbd: add schematic 2019-07-20 14:51:34 -04:00
Virgil Dupras 57e7b3ca05 recipes/sms/kbd: PS/2 keyboard adapter for the SMS! 2019-07-20 12:42:55 -04:00
Virgil Dupras 2efe887434 recipes/rc2014/ps2: add schema 2019-06-30 17:37:18 -04:00
Virgil Dupras e3eea8839b recipes/rc2014/ps2: works rather well now! 2019-06-30 14:16:00 -04:00
Virgil Dupras 2c6ab08d51 recipes/rc2014/ps2: add "resend" requests on parity check failures 2019-06-30 11:17:12 -04:00
Virgil Dupras 0f82ebe02d recipes/rc2014/ps2: add parity checks
Also, add timer to reset reception status after 100us.
2019-06-29 20:45:08 -04:00
Virgil Dupras 360446e731 recipes/rc2014/ps2: don't alter SREG in hdlPCINT 2019-06-29 15:47:02 -04:00
Virgil Dupras e44ebb08b2 recipes/rc2014/ps2: drive a shell with ps/2 kbd! 2019-06-29 14:26:03 -04:00
Virgil Dupras 3cdb25bfda recipes/rc2014/ps2: implement scan code buffer 2019-06-29 11:18:37 -04:00
Virgil Dupras 20a7ad231f recipes/rc2014/pc2: new recipe (WIP) 2019-06-28 22:54:57 -04:00
Virgil Dupras 6df77ddef3 recipes/rc2014/zasm: we can now assemble the recipe's kernel 2019-06-18 22:07:44 -04:00
Virgil Dupras 0a36ea0815 recipes/rc2014/zasm: add unpack + verification 2019-06-17 15:35:14 -04:00
Virgil Dupras 95b658897a recipes/rc2014/zasm: add instructions to assemble kernel 2019-06-17 14:19:49 -04:00
Virgil Dupras 3e437747c2 recipes/rc2014: add missing calls to fsInit
Also, tighten RAM addresses. They were unecessarily loose.
2019-06-17 13:46:33 -04:00
Virgil Dupras 92a04f4627 sdc: support 24-bit addressing
Needed if we want to compile the kernel and zasm from within a SD card.
I didn't go straight for 32-bit because it was significantly more
complex and 24-bit give us 16M. Enough to go on for a while...
2019-06-15 13:41:20 -04:00
Virgil Dupras e7c07cdd9a apps/at28w: fix argument byte order 2019-06-14 21:11:45 -04:00
Virgil Dupras c613f7b0ee recipes/rc2014/eeprom: fix broken a28w args passing
That's why the command seemed slow! It's much faster than I thought.
2019-06-14 16:30:01 -04:00
Virgil Dupras 817636242a Add at28w app and recipe
This allows us to write to an AT28 EEPROM from within collapse os.
2019-06-14 14:15:30 -04:00
Virgil Dupras 145b48efb7 Add apps/sdct
A new app to stress test the SD card driver. Also, accompanying this
commit, changes solidifying the SD card driver so that stress tests
actually pass :)
2019-06-10 15:54:15 -04:00
Virgil Dupras 9bb2194fb0 recipes/rc2014/zasm: zasm can now assemble *and* write to file 2019-06-07 19:53:50 -04:00
Virgil Dupras e046081900 sdc: add second buffer 2019-06-06 22:16:57 -04:00
Virgil Dupras ae028e3a86 blockdev: make implementors "random access"
This huge refactoring remove the Seek and Tell routine from blockdev
implementation requirements and change GetC and PutC's API so that they
take an address to read and write (through HL/DE) at each call.

The "PTR" approach in blockdev implementation was very redundant from
device to device and it made more sense to generalize. It's possible
that future device aren't "random access", but we'll be able to add more
device types later.

Another important change in this commit is that the "blockdev handle" is
now opaque. Previously, consumers of the API would happily call routines
directly from one of the 4 offsets. We can't do that any more. This
makes the API more solid for future improvements.

This change forced me to change a lot of things in fs, but overall,
things are now simpler. No more `FS_PTR`: the "device handle" now holds
the active pointer.

Lots, lots of changes, but it also feels a lot cleaner and solid.
2019-06-04 15:36:20 -04:00
Virgil Dupras 63473cc2e3 blockdev: make selection structure opaque
I'm about to change that structure and I don't want fs to be messed up
by this. I'm proceeding step by step...
2019-06-04 09:56:36 -04:00
Virgil Dupras 50a26f6e39 recipe/rc2014/zasm: new recipe 2019-06-03 13:35:21 -04:00
Virgil Dupras 9a72f10221 zasm: includes CFS is now built on-the-fly by zasm.sh
This makes for a much more usable zasm linux binary that doesn't have to
be rebuilt every time apps or kernel change.
2019-06-02 19:57:40 -04:00
Virgil Dupras 22e990ed89 Parametrize zasm linux bin's include CFS file
... instead of embedding it in the binary itself. Additionally, add a
"zasm.sh" wrapper to faciliate zasm calls on a linux machine.
2019-06-02 15:50:59 -04:00
Virgil Dupras 57356e47b4 recipes/rc2014/sdcard: add instructions to write to SD card 2019-06-02 12:04:11 -04:00
Virgil Dupras 73c3fc7947 shell/stdio: decouple from blkdev (again)
Move load/save to blkdev_cmds and add a new "poke" builtin shell cmd
that is the mirror of "peek" and strictly uses stdio (no blkdev
involved).

This allows us to slim the minimal OS size but, more importantly, change
the behavior of "load" so that we don't expect GetC to block until Z is
set. This way, using "load X" with X being larger than the blkdev size
won't block forever.

This also brings our RC2014 minimal kernel below the 1K mark again.
2019-06-02 11:06:38 -04:00
Virgil Dupras 88bf98321e fs: adjust to DE->IX change in recipe/emul glue code 2019-06-02 10:18:03 -04:00
Virgil Dupras 5e5c7e6592 sdc: add sdcPutC
Wriiiiiite!
2019-06-01 19:53:42 -04:00
Virgil Dupras 2e8af376e3 pgm: new kernel module
The pgm module implements a shell hook so that when an unknown command
is typed, we look into the mounted filesystem and look for a file with
the same name as the command. If we find one, we load it in memory and
run it.
2019-05-31 14:54:15 -04:00