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

20 Commits

Author SHA1 Message Date
Virgil Dupras
3dde51ae98 Allow file-to-file compilation in the emulated shell 2019-06-05 19:51:19 -04:00
Virgil Dupras
fc81bce70f Fix error handling when writing to files in emulated shell 2019-06-05 16:13:15 -04:00
Virgil Dupras
c18d42f08b fs: further adjust to previous blkdev refactoring
Previous refacoring broke all seek/tell within fs. fs handles now lost
the responsibility to keep track of current position. It's blkdev's job.
2019-06-04 20:45:01 -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
082fa3431d We can now assemble source files from within the shell! 2019-06-03 11:15:07 -04:00
Virgil Dupras
bed7032ee5 pgm: have its own file handle 2019-06-03 09:25:17 -04:00
Virgil Dupras
f511289a3a tools/emul: make shell's cfsin always have all apps compiled in it 2019-06-03 08:34:29 -04:00
Virgil Dupras
f8bd8eeaaf Make userspace parse args the same way the shell does 2019-06-02 14:05:20 -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
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
Virgil Dupras
328f44814e Make blockdev pointers 32 bits
This allows us to break through the 64K limit for includes CFS in zasm,
a limit we were dangerously close to breaking. In fact, this commit
makes us go over that limit. Right in time!
2019-05-28 19:42:35 -04:00
Virgil Dupras
c586c0d63c Make the shell emulator be built by zasm 2019-05-20 07:29:19 -04:00
Virgil Dupras
013a3b74c8 Add the concept of unit tests
Will be much much easier to tests new core routines without having to
re-create their context first.

Also, extract parse.asm from core.asm
2019-05-17 09:33:20 -04:00
Virgil Dupras
45b8e84e2a shell: de-macro-ize 2019-05-17 08:21:37 -04:00
Virgil Dupras
56760b5aba stdio: de-macro-ize 2019-05-17 08:14:19 -04:00
Virgil Dupras
dfce0d3a62 tools/emul: fix shell RAMSTART 2019-05-17 07:55:28 -04:00
Virgil Dupras
def6c2123d tools/emul: clean up the place a bit 2019-05-17 07:23:59 -04:00