Commit Graph

60 Commits

Author SHA1 Message Date
Kartik K. Agaram c76679dbff more general timer interface 2021-06-29 22:46:26 -07:00
Kartik K. Agaram 9d7d99fe6c snapshot
This is going better than expected; just 3 failing tests among the new
ones.
2021-06-20 20:36:47 -07:00
Kartik K. Agaram c2c6f4c7ab flickerlessly render fake screens in environment
Font rendering now happens off the real screen, which provides the effect
of double-buffering.

Apps can now also use convert-graphemes-to-pixels for more traditional
double-buffering.
2021-06-15 10:33:18 -07:00
Kartik K. Agaram 67aeff8934 .
I wrote a comment about how some code was not covered by tests, and then
promptly forgot what it was for. This is why we need tests.

Now the hack is gone.
2021-06-08 15:06:08 -07:00
Kartik K. Agaram 8dc3c85a03 .
Minor counter infrastructure. We invoke next-token 1400 times while loading
the shell's data disk, so we're wasting around 1.4MB during tokenization.
2021-05-29 15:40:58 -07:00
Kartik K. Agaram 4b57c101b7 more robust print-cell
It is used to print to the trace, and we shouldn't crash the whole computer
just because the trace ran out of space.
2021-05-19 23:14:27 -07:00
Kartik K. Agaram 73744d098c dump addresses of call stack on abort 2021-05-14 20:52:27 -07:00
Kartik K. Agaram adc92f49dc .
Move abort to SubX. We'll need to do some unsafe stuff to display the call
stack here.
2021-05-14 15:40:49 -07:00
Kartik K. Agaram 2c0539e6fa primitive: read r/g/b for color 2021-05-01 21:11:40 -07:00
Kartik K. Agaram 4e70cac998 . 2021-04-22 09:03:20 -07:00
Kartik K. Agaram c54b7e9630 shell: separate 'def' from 'set'
'def' creates new bindings (only in globals)
'set' only modifies existing bindings (either in env or globals)
2021-04-21 20:53:38 -07:00
Kartik K. Agaram 7b2d39b8d4 an interface approximating stack traces 2021-04-20 23:27:13 -07:00
Kartik K. Agaram d94821d301 some primitives for monitoring code integrity 2021-04-18 11:56:10 -07:00
Kartik K. Agaram 21a6f5539b data.img now has more than one sector of data 2021-04-16 20:26:56 -07:00
Kartik K. Agaram 7bf8adb893 explicitly pass data disk to main 2021-03-27 17:50:44 -07:00
Kartik K. Agaram 49a9938333 mouse support that requires polling 2021-03-23 21:14:49 -07:00
Kartik K. Agaram 62a2442110 writes to disk now working
Tested by inserting a call into the shell, but we can't leave it in because
every test ends up clobbering the disk. So it's now time to think about
a testable interface for the disk.
2021-03-23 00:32:49 -07:00
Kartik K. Agaram c0607ecca8 . 2021-03-22 22:56:33 -07:00
Kartik K. Agaram e6b42204ef shell: read initial expression from secondary disk
See shell/README.md for (extremely klunky) instructions.
2021-03-21 23:10:55 -07:00
Kartik K. Agaram cec5ef31b3 update vocabulary documentation
Top-level and linux/ now have separate vocabulary.md files.
2021-03-08 23:50:35 -08:00
Kartik Agaram 1a1a1671ed 7866 2021-03-07 19:46:21 -08:00
Kartik K. Agaram 71e4f38129 7842 - new directory organization
Baremetal is now the default build target and therefore has its sources
at the top-level. Baremetal programs build using the phase-2 Mu toolchain
that requires a Linux kernel. This phase-2 codebase which used to be at
the top-level is now under the linux/ directory. Finally, the phase-2 toolchain,
while self-hosting, has a way to bootstrap from a C implementation, which
is now stored in linux/bootstrap. The bootstrap C implementation uses some
literate programming tools that are now in linux/bootstrap/tools.

So the whole thing has gotten inverted. Each directory should build one
artifact and include the main sources (along with standard library). Tools
used for building it are relegated to sub-directories, even though those
tools are often useful in their own right, and have had lots of interesting
programs written using them.

A couple of things have gotten dropped in this process:
  - I had old ways to run on just a Linux kernel, or with a Soso kernel.
    No more.
  - I had some old tooling for running a single test at the cursor. I haven't
    used that lately. Maybe I'll bring it back one day.

The reorg isn't done yet. Still to do:
  - redo documentation everywhere. All the README files, all other markdown,
    particularly vocabulary.md.
  - clean up how-to-run comments at the start of programs everywhere
  - rethink what to do with the html/ directory. Do we even want to keep
    supporting it?

In spite of these shortcomings, all the scripts at the top-level, linux/
and linux/bootstrap are working. The names of the scripts also feel reasonable.
This is a good milestone to take stock at.
2021-03-03 22:21:03 -08:00
Kartik Agaram eea6659a40 7331 - hacky way to convert slice to string 2020-12-04 23:02:53 -08:00
Kartik Agaram 18d5bab2b6 7329 - snapshot: advent day 4 part 2
I've found two bugs in SubX libraries:

1. next-word had an out-of-bounds read
2. next-word was skipping comments, because that's what I need during bootstrapping.
I've created a new variant called next-raw-word that doesn't skip comments.
These really need better names.

We're now at the point where 4b.mu has the right structure and returns
identical result to 4a.mu.
2020-12-04 23:02:53 -08:00
Kartik Agaram 6f65b65f7d 7290
I've wrestled for a long time with how to support integer division with
its hard-coded registers. The answer's always been staring me in the face:
just turn it into a function! We already expect function outputs to go
to hard-coded registers.
2020-11-27 21:37:20 -08:00
Kartik Agaram 91dc5814df 7239 2020-11-15 16:06:00 -08:00
Kartik Agaram 307745bcc2 7225
Both manual tests described in commit 7222 now work.

To make them work I had to figure out how to copy a file. It
requires a dependency on a new syscall: lseek.
2020-11-11 23:25:55 -08:00
Kartik Agaram 5df70f4dff 7127 2020-10-27 00:49:02 -07:00
Kartik Agaram 71418907f6 7115 2020-10-26 21:24:43 -07:00
Kartik Agaram 2d7960d493 7106 - tile: arrays of ints 2020-10-25 21:15:43 -07:00
Kartik Agaram a148b23a22 7101 - tile: remove quotes when evaluating strings
This found several bugs due to me not checking for null strings.
2020-10-25 18:45:11 -07:00
Kartik Agaram 8a6ad45d8d 7100 - tile: render string literals 2020-10-25 18:14:12 -07:00
Kartik Agaram 21387ef514 6963 - tile: more idiomatic conventional repl 2020-10-05 21:09:42 -07:00
Kartik Agaram b8d613e7c2 6946 - print floats somewhat intuitively in hex 2020-10-04 11:18:23 -07:00
Kartik Agaram c79b93ca6c 6921 2020-10-01 20:35:14 -07:00
Kartik Agaram e0bceffe08 6860
Snapshot: tile currently segfaulting. I need to back up and make it easier
to debug.
2020-09-26 13:41:23 -07:00
Kartik Agaram 022595a20a 6821 - highlight words clobbered by the next word
Another suggestion from the Future of Software forum.
2020-09-20 13:42:13 -07:00
Kartik Agaram 4449f48781 6810 - tile: adaptive column widths 2020-09-19 22:15:40 -07:00
Kartik Agaram 86a124769d 6808 2020-09-19 21:53:52 -07:00
Kartik Agaram 8e4b4f2013 6807 - tile: render intermediate stack state 2020-09-19 21:44:48 -07:00
Kartik Agaram c9093dbb08 6800 2020-09-19 09:01:42 -07:00
Kartik Agaram e403d15732 6794 - cleaner interface for keyboard
So far I've been assuming that read-key only works for ascii, and that
I'd need to get more sophisticated both for multi-byte utf-8 and multi-byte
terminal escape codes like arrow keys. Rather to my surprise, both work
fine. We just need to adjust the types to reflect this fact.
2020-09-16 18:54:12 -07:00
Kartik Agaram 9b873e3bcd 6792
Roll back all buffering of Stdout.
2020-09-16 16:52:26 -07:00
Kartik Agaram f4fb198af3 6790 experiment: explicit flush
tile is already visibly slow (49x212 screen) :/ So programmer needs more
control over performance.

But this may not be the right approach. That extra flush-stdout in tui.mu
suggests it's either going to be finicky, or we have to flush on every
attribute change. And going through a buffered-file may be slower. May.
2020-09-16 16:43:52 -07:00
Kartik Agaram ae470b42f1 6781 - new app: RPN (postfix) calculator
This was surprisingly hard; bugs discovered all over the place.
2020-09-15 22:52:41 -07:00
Kartik Agaram ad1e53df8b 6778 2020-09-14 21:42:31 -07:00
Kartik Agaram 6b41ca6d95 6777
Print answers in decimal in apps/arith.mu
2020-09-14 21:14:04 -07:00
Kartik Agaram 492fb2783f 6769 - support for creating fake files in Mu tests 2020-09-10 23:00:19 -07:00
Kartik Agaram 5462619d96 6742 - support for formatting in fake screens
We still need a few primitives, but we can implement these as needed. I'm
ready to call the fake screen done.
2020-09-07 14:18:48 -07:00
Kartik Agaram cd94852dbc 6733 - read utf-8 'grapheme' from byte stream
No support for combining characters. Graphemes are currently just utf-8
encodings of a single Unicode code-point. No support for code-points that
require more than 32 bits in utf-8.
2020-08-28 23:24:04 -07:00