Commit Graph

7492 Commits

Author SHA1 Message Date
Kartik Agaram
57e4978eac 7492
Port some support for unicode to baremetal.
2021-01-09 18:55:24 -08:00
Kartik Agaram
0518944e37 7491 - baremetal: draw ASCII text to screen 2021-01-09 18:29:04 -08:00
Kartik Agaram
7f8770ae08 7490 - baremetal: draw a grapheme to screen 2021-01-09 18:28:14 -08:00
Kartik Agaram
dbd7082a0e 7489 - include GNU Unifont
https://en.wikipedia.org/wiki/GNU_Unifont#The_.hex_font_format
http://unifoundry.com/unifont/index.html

Since GNU Unifont is covered under the GPL v2, so I believe is this repo.
2021-01-09 18:20:28 -08:00
Kartik Agaram
952ccfc66e 7488 2021-01-09 13:45:41 -08:00
Kartik Agaram
26697e649b 7487 2021-01-09 13:43:39 -08:00
Kartik Agaram
be87d72335 7486 - primitive for reading keys
It also clears keys after reading them, allowing us to read more than 16
keys.
2021-01-09 10:39:12 -08:00
Kartik Agaram
8be561f599 7485 2021-01-09 10:15:33 -08:00
Kartik Agaram
adf7fba7fe 7484 2021-01-09 10:07:41 -08:00
Kartik Agaram
ae1089cb76 7483 2021-01-09 08:46:37 -08:00
Kartik Agaram
5efca3695a 7482 2021-01-09 08:11:52 -08:00
Kartik Agaram
efa6c5f44e 7481 2021-01-07 22:41:41 -08:00
Kartik Agaram
3f7db804c9 7480 - baremetal/ex3.hex now draws multiple pixels
I was wrong in commit 7437 that only one keystroke was working. The problem
was just that I was getting _too_ many events. I wasn't handling key-up
events, and they were entering the buffer, and I was not skipping null
events since the circular buffer is currently considered to be null-terminated.

ex3 isn't done yet; it can only handle 16 events. Apps need to be clearing
the keyboard buffer.
2021-01-07 22:38:07 -08:00
Kartik Agaram
53d99784de 7479 2021-01-07 20:17:32 -08:00
Kartik Agaram
6dc9722704 7478 2021-01-03 22:38:41 -08:00
Kartik Agaram
cb13d94740 7477 2020-12-30 19:25:32 -08:00
Kartik Agaram
762107fdc2 7476 2020-12-30 09:39:50 -08:00
Kartik Agaram
d0bc0d2673 7475 2020-12-30 08:32:52 -08:00
Kartik Agaram
ce667598a2 7474 2020-12-29 21:44:49 -08:00
Kartik Agaram
691dd9cbd1 7473 2020-12-29 21:23:25 -08:00
Kartik Agaram
00c4d61221 7472 2020-12-29 21:20:36 -08:00
Kartik Agaram
1e02d840e8 7471 2020-12-29 21:19:41 -08:00
Kartik Agaram
520e3c2542 7470
The ol' 8-byte-register-names issue strikes again. There's no way to access
the lower 8 bits of ESI.

There's still a bug in baremetal/ex2.mu; it's printing transposed somehow.
2020-12-29 21:17:03 -08:00
Kartik Agaram
0daf12c59a 7469 - first working baremetal Mu program
It doesn't _quite_ do what it should, so this is more precisely the first
_buggy_ baremetal Mu program. But the tooling works, at least.
2020-12-29 21:08:05 -08:00
Kartik Agaram
63a247fcd4 7468 2020-12-29 20:50:55 -08:00
Kartik Agaram
562476d750 7467 2020-12-29 20:50:11 -08:00
Kartik Agaram
6b11049d13 7466 2020-12-29 20:29:55 -08:00
Kartik Agaram
783b0659d3 7465 2020-12-29 19:32:39 -08:00
Kartik Agaram
395f736d1a 7464 2020-12-29 19:28:56 -08:00
Kartik Agaram
c35ae0085c 7463 2020-12-29 19:25:51 -08:00
Kartik Agaram
c5dfa89bb3 7462 - SubX version of baremetal/ex2.subx 2020-12-29 19:14:26 -08:00
Kartik Agaram
796f3b70f2 7461 2020-12-29 18:56:21 -08:00
Kartik Agaram
c1b1d1f4e6 7460 - baremetal backend for SubX 2020-12-29 17:46:04 -08:00
Kartik Agaram
3618118c8d 7459
Bring baremetal variant up to date with recent changes.
2020-12-29 10:34:20 -08:00
Kartik Agaram
c88af82232 7458
Switch survey_elf to the new approach.
2020-12-29 10:28:15 -08:00
Kartik Agaram
8836afbcbd 7457 2020-12-28 23:30:13 -08:00
Kartik Agaram
286faf6f0b 7456 2020-12-28 23:28:07 -08:00
Kartik Agaram
b15db82f7c 7455
New approach to disambiguating /disp32 arguments: based on opcodes rather
than metadata.

I interpret /disp32 as PC-relative in a short list of instructions. Otherwise
it's absolute if it gets a label.

There should be no reason to pass labels into /disp8 or /disp16.
2020-12-28 23:20:14 -08:00
Kartik Agaram
d6d8ce2244 7454
Go back to commit 7448.
2020-12-28 23:05:00 -08:00
Kartik Agaram
c17b909b82 7453
Snapshot: this approach of disambiguating /disp32 based on metadata doesn't
work. The `survey` phase runs after `pack`, which gets rid of most metadata.
2020-12-28 23:03:26 -08:00
Kartik Agaram
59e4177c71 7452 2020-12-28 21:26:01 -08:00
Kartik Agaram
cb7139956e 7451 2020-12-28 21:16:08 -08:00
Kartik Agaram
5da03f118c 7450 2020-12-28 21:05:50 -08:00
Kartik Agaram
83bec4a59e 7449
There's an ambiguity in how x86 interprets disp32 fields:

- For jumps and calls they're displacements from the starting address of
  the next instruction. So far so good.

- However, when the ModR/M requires them they can also be absolute addresses.

Ideally I'd take the presence of the ModR/M byte into account in interpreting
them.

However, it's easier to assume relative addressing only for labels in the
code segment.

This commit raises an error if we ever refer to labels in the code segment
in instructions with a ModR/M byte. (I'm assuming that no instruction with
a ModR/M byte will ever use a displacement without the ModR/M byte requiring
it.)
2020-12-28 20:01:47 -08:00
Kartik Agaram
6e79e84a72 7448 2020-12-28 20:01:24 -08:00
Kartik Agaram
ce6aa0c9cc 7447 2020-12-28 17:05:17 -08:00
Kartik Agaram
ec8c039abf 7446 2020-12-28 15:30:23 -08:00
Kartik Agaram
d1c9894306 7445 2020-12-28 15:29:29 -08:00
Kartik Agaram
70b350dfba 7444 2020-12-28 12:36:51 -08:00
Kartik Agaram
2107d5f1f1 7443
A new phase for baremetal compilations. Doesn't work yet, but it passes
all its tests, so we can add it to CI.
2020-12-28 12:14:15 -08:00