Commit Graph

62 Commits

Author SHA1 Message Date
Kartik Agaram
fcad74b7b1 7505 2021-01-12 22:01:50 -08:00
Kartik Agaram
c5e617f5cc 7504 2021-01-12 21:51:46 -08:00
Kartik Agaram
e59086e65a 7503 - baremetal: noodling on default VGA palette 2021-01-12 19:50:22 -08:00
Kartik Agaram
0d12f6676b 7502 - baremetal text: better interface 2021-01-12 00:32:06 -08:00
Kartik Agaram
bb0e67a308 7501 - baremetal: draw text within a rectangle 2021-01-12 00:20:22 -08:00
Kartik Agaram
589eba07e2 7500 - baremetal: bounds-check screen space before drawing 2021-01-12 00:00:20 -08:00
Kartik Agaram
ebf912eb7a 7499 2021-01-12 00:00:20 -08:00
Kartik Agaram
b7e736b508 7497 2021-01-11 23:24:35 -08:00
Kartik Agaram
f6075374f5 7496 2021-01-11 23:19:43 -08:00
Kartik Agaram
3de4d557d5 7493 2021-01-09 19:01:13 -08:00
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
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
cb13d94740 7477 2020-12-30 19:25:32 -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
562476d750 7467 2020-12-29 20:50:11 -08:00
Kartik Agaram
6b11049d13 7466 2020-12-29 20:29:55 -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
437fa654cb 7437 - baremetal: draw pixel on keyboard event
It's now clear that our keyboard handler doesn't trigger after the first
event.
2020-12-28 00:12:06 -08:00
Kartik Agaram
5d2f1c57a5 7436
Start highlighting lines that may need to be recomputed when offsets change.
2020-12-27 23:35:31 -08:00
Kartik Agaram
bf50df60a1 7435 - baremetal: buffer for keyboard events
I'm trying to read the status register, but I'm still not seeing the breakpoint
being hit a second time. (And I again ran into the Bochs bug that breakpoints
at the first instruction of an interrupt handler don't work.)

Maybe this is just a debugger issue. Let's keep going, and try to start
using the keyboard events.
2020-12-27 23:22:20 -08:00
Kartik Agaram
a9b25d62c1 7434
Fix a stale displacement.
2020-12-27 23:01:14 -08:00
Kartik Agaram
57fd753a01 7433 - some major layout changes
I'd missed that VBE call 0x4f01 (get video mode) can write up to 256 bytes.
Unexpected areas were getting clobbered because I wasn't reserving enough
space.
2020-12-27 22:54:54 -08:00
Kartik Agaram
4ffe861a45 7432
Bugfix: 32-bit code in 16-bit mode.
Seems like it was benign, maybe.
2020-12-27 22:38:07 -08:00
Kartik Agaram
74529e2e62 7431
Typo.
2020-12-27 22:33:47 -08:00
Kartik Agaram
2e24062f2f 7430 2020-12-27 21:09:22 -08:00
Kartik Agaram
b3a0a540cd 7428 2020-12-27 11:39:38 -08:00
Kartik Agaram
46cf7b7908 7427 2020-12-27 11:39:17 -08:00
Kartik Agaram
3a67140281 7425 - baremetal: render the palette
It's now very obvious that we don't actually have 256 unique colors by
default in 256-color graphics modes.
2020-12-27 10:51:09 -08:00
Kartik Agaram
5095021f77 7424 - baremetal: downsize graphics resolution
If it's large enough that I have doubts whether my top-of-the-line Mac
is showing the bottom of the screen inside an emulator, it's too large.

This way I also feel more confident that most modern hardware will support
this graphics mode, and that these programs will work for others.
2020-12-27 08:45:03 -08:00
Kartik Agaram
0e0b0c6edb 7423 2020-12-27 08:03:48 -08:00
Kartik Agaram
2628a51f37 7422 2020-12-26 23:45:37 -08:00
Kartik Agaram
e5b2f3f169 7421 - baremetal: beginnings of keyboard map
First keypress is detected, but we need to ack it somehow.
2020-12-26 23:38:52 -08:00
Kartik Agaram
88d2df2f96 7420 2020-12-26 22:57:16 -08:00
Kartik Agaram
03708aa5a3 7419 2020-12-26 22:56:44 -08:00
Kartik Agaram
6f3f814839 7418 - baremetal: adjust entrypoint address
We need a few pages of data for the keyboard mappings.

If I moved them to some later address I'd be able to keep the nice round
starting address unchanged. But that seems like a superficial aesthetic
concern. There's really no value in having an array of hex bytes represented
in SubX rather than just raw hex. And it's better to colocate data near
the handler code which uses it (and which runs instructions SubX doesn't
support).
2020-12-26 22:36:52 -08:00
Kartik Agaram
0243ee4e83 7417 - baremetal: drawing on LFB in Bochs 2020-12-26 22:01:45 -08:00
Kartik Agaram
9ef034fde8 7416 - baremetal: drawing on frame buffer
This currently works on Qemu, but not on Bochs. I'm now trying to make
sense of https://wiki.osdev.org/Bochs_VBE_Extensions#Using_a_linear_frame_buffer_.28LFB.29
2020-12-26 21:44:01 -08:00