Commit Graph

7910 Commits

Author SHA1 Message Date
Kartik K. Agaram 1d724f9260 shell: structural equality check
Mu can now compute (factorial 5)
2021-04-09 22:51:24 -07:00
Kartik K. Agaram b3c6dddcd4 shell: if 2021-04-09 22:21:00 -07:00
Kartik K. Agaram 630a7396c5 shell: highlight matching paren for cursor 2021-04-09 21:57:40 -07:00
Kartik K. Agaram 5094473b2f shell: highlight matching close-paren 2021-04-09 20:39:53 -07:00
Kartik K. Agaram f5defca117 . 2021-04-09 20:10:47 -07:00
Kartik K. Agaram fd0e9b5b68 shell: render primitives at the bottom 2021-04-08 23:04:30 -07:00
Kartik K. Agaram f21e224fcd . 2021-04-08 23:04:30 -07:00
Kartik K. Agaram c3069ab818 shell: start rendering globals 2021-04-08 23:04:30 -07:00
Kartik K. Agaram d6d28b8c94 shell: create space to display globals 2021-04-08 22:19:24 -07:00
Kartik K. Agaram 119aea6d06 shell: ctrl-u to clear sandbox 2021-04-06 19:39:09 -07:00
Kartik K. Agaram 7032a92cf2 shell: 'set' for defining globals
Currently stateful, but still good for things.
2021-04-06 10:00:23 -07:00
Kartik K. Agaram 26a1849895 shell: quote 2021-04-06 09:40:13 -07:00
Kartik K. Agaram 6ef0eabdcf shell: now we can start adding primitives 2021-04-06 09:07:25 -07:00
Kartik K. Agaram b9656ea881 shell: look up globals 2021-04-06 07:51:56 -07:00
Kartik K. Agaram 0db683ffdb shell: extensible array of globals
I'm not bothering with full dynamic scope for now.
2021-04-05 23:55:13 -07:00
Kartik K. Agaram 9142cd8519 . 2021-04-05 23:23:41 -07:00
Kartik K. Agaram 07bc1eeb90 shell: save repl input to disk before running 2021-04-05 23:09:05 -07:00
Kartik K. Agaram 4861c39474 shell: ctrl-a/e 2021-04-05 22:39:37 -07:00
Kartik K. Agaram 143cce94ee support for arrow keys
Mu's keyboard handling is currently a bit of a mess, and this commit might
be a bad idea.

Ideally keyboards would return Unicode. Currently Mu returns single bytes.
Mostly ASCII. No support for international keyboards yet.

ASCII and Unicode have some keyboard scancodes grandfathered in, that don't
really make sense for data transmission. Like backspace and delete. However,
other keyboard scancodes don't have any place in Unicode. Including arrow keys.

So Mu carves out an exception to Unicode for arrow keys. We'll place the
arrow keys in a part of Unicode that is set aside for implementation-defined
behavior (https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls):

  0x80: left arrow
  0x81: down arrow
  0x82: up arrow
  0x83: right arrow

The order is same as hjkl for mnemonic convenience. I'd _really_ to follow
someone else's cannibalization here. If I find one later, I'll switch to
it.

Applications that blindly assume the keyboard generates Unicode will have
a bad time. Events like backspace, delete and arrow keys are intended to
be processed early and should not be in text.

With a little luck I won't need to modify this convention when I support
international keyboards.
2021-04-05 22:37:27 -07:00
Kartik K. Agaram 316bf37541 undo previous commit 2021-04-05 21:16:45 -07:00
Kartik K. Agaram 928fd47d68 snapshot: stupid debugging session
I spent a while building a little keyboard scancode printer:

  $ ./translate ex1.mu &&  qemu-system-i386 disk.img

..and wondering why up-arrow was 0x48 in hex but 724 in decimal. I ended
up paranoidly poking at a bunch of crap (though there _is_ a cool chromatography-based
debugging technique in 126write-int-decimal.subx) before I realized:

  - 724 just has one extra digit over the correct answer
  - the 0xe0 scan code is a 3-digit number in decimal -- and the final digit is '4'

There's nothing actually wrong.
2021-04-05 21:15:06 -07:00
Kartik K. Agaram 463878a4a4 shell: clean up unimplemented menu items 2021-04-05 19:46:47 -07:00
Kartik K. Agaram 8a31a087b0 . 2021-04-05 19:41:46 -07:00
Kartik Agaram f9e8b0c784 . 2021-04-05 13:56:02 -07:00
Kartik Agaram 40c1a2b595 . 2021-04-04 20:14:43 -07:00
Kartik Agaram 77c747379e make online help more obvious 2021-04-04 20:12:43 -07:00
Kartik Agaram 2839c89b80 delete some obsolete files
They stopped working ever since boot.subx started relying on functions
(for the disk driver) implemented in Mu.
2021-04-04 16:30:40 -07:00
Kartik K. Agaram 3e9a266eda . 2021-04-02 22:53:11 -07:00
Kartik K. Agaram 350a10251a . 2021-04-02 22:24:29 -07:00
Kartik K. Agaram d8d9dfa855 some hacky checks for common errors
They're not really baked into the regular compilation process; I have to
remember to run them if I see strange behavior.
2021-03-31 23:16:01 -07:00
Kartik K. Agaram 971062583a . 2021-03-31 21:17:20 -07:00
Kartik Agaram 16f2bd1174 . 2021-03-29 18:47:52 -07:00
Kartik Agaram 386641c021 . 2021-03-29 15:00:52 -07:00
Kartik K. Agaram 18ef136b2c . 2021-03-28 08:36:03 -07:00
Kartik K. Agaram cfe4fea124 . 2021-03-28 08:32:48 -07:00
Kartik K. Agaram a3a7ffe4da . 2021-03-28 08:32:15 -07:00
Kartik K. Agaram dfda825e55 always acknowledge enabled interrupts
Now we can start enabling the timer interrupt. It doesn't do anything yet,
but keyboard continues to work.
2021-03-28 08:30:57 -07:00
Kartik K. Agaram ad53022489 . 2021-03-27 21:52:16 -07:00
Kartik K. Agaram b98832253f . 2021-03-27 21:48:44 -07:00
Kartik K. Agaram 763719c211 .
Clean up some debug prints.
2021-03-27 17:53:15 -07:00
Kartik K. Agaram 7bf8adb893 explicitly pass data disk to main 2021-03-27 17:50:44 -07:00
Kartik K. Agaram 9818f1de98 .
https://wiki.osdev.org/ATA_PIO_Mode#IDENTIFY_command recommends the straight-and-narrow
way, but the LBA bit shouldn't matter in drive-select during IDENTIFY command,
according to the ATA 3 spec. And it works in Qemu and bochs. It'll slightly
simplify drive parameter management.
2021-03-27 08:38:01 -07:00
Kartik K. Agaram 83c25a03c9 fix stale examples 2021-03-26 23:07:35 -07:00
Kartik K. Agaram 1a43d12b15 explicitly pass screen and keyboard to main 2021-03-26 23:07:35 -07:00
Kartik K. Agaram 9f71d7248c . 2021-03-26 22:32:22 -07:00
Kartik K. Agaram 4d0df592ac . 2021-03-26 22:22:54 -07:00
Kartik Agaram 681c0156a9 . 2021-03-25 14:33:04 -07:00
Kartik Agaram c2aeba0a11 . 2021-03-24 09:12:32 -07:00
Kartik Agaram 754d813bc5 . 2021-03-23 23:02:41 -07:00
Kartik Agaram 3120f938c6 . 2021-03-23 22:27:59 -07:00