Commit Graph

100 Commits

Author SHA1 Message Date
Kartik K. Agaram b8afd4becf start hacky experiment to support combining chars
https://en.wikipedia.org/wiki/Combining_character

The plan: just draw the combining character in the same space as the
previous character. This will almost certainly not work for some Unicode
blocks (tibetan?)

This commit only changes the data/memory/disk model to make some space.
As always in Mu, we avoid bit-mask tricks even if that wastes memory.
2021-08-31 23:03:34 -07:00
Kartik K. Agaram b1dcfb03d0 load Font in a non-contiguous area of memory 2021-08-29 20:34:53 -07:00
Kartik K. Agaram 14cfa3e109 . 2021-08-29 19:13:23 -07:00
Kartik K. Agaram 8306c084ad . 2021-08-29 19:12:47 -07:00
Kartik K. Agaram c5f8415e03 retreat to 640KB 2021-08-29 11:21:09 -07:00
Kartik K. Agaram 0e2a9ad93d build still broken
Now we load all the code, but it overwrites the extended BIOS area.
640KB is no longer enough. Need to rethink loading strategy.
2021-08-29 11:21:09 -07:00
Kartik K. Agaram 2c87cd2f34 reorganize font before adding non-ASCII 2021-08-27 08:41:15 -07:00
Kartik K. Agaram 5aea0c11b7 update memory map doc and anticipate a gotcha 2021-07-22 03:58:54 -07:00
Kartik K. Agaram 96c217ab1c . 2021-07-16 08:48:40 -07:00
Kartik K. Agaram ef73cb78f1 initial image rendering
Supports just some ASCII formats: https://en.wikipedia.org/wiki/Netpbm

Colors are messed up. That's next.
2021-07-07 07:13:16 -07:00
Kartik K. Agaram f32caac6df grow code region yet again
We need a cleaner way to do this.
2021-07-05 17:53:57 -07:00
Kartik K. Agaram c76679dbff more general timer interface 2021-06-29 22:46:26 -07:00
Kartik K. Agaram eba4e7af24 move timer handler to boot.subx 2021-06-29 22:26:08 -07:00
Kartik K. Agaram db5f7c26a5 . 2021-06-29 22:05:00 -07:00
Kartik K. Agaram f25b8e6e41 poking at the broken timer interrupt handler again 2021-06-29 21:37:06 -07:00
Kartik K. Agaram de013be794 ok, function modal now has full coverage 2021-06-08 18:09:17 -07:00
Kartik K. Agaram e700d30d8c . 2021-05-30 16:20:31 -07:00
Kartik K. Agaram 1d89aa38c2 fix a bug in loading code disk
Identical bug to commit 2f10bc7302.
2021-05-29 18:43:16 -07:00
Kartik K. Agaram 9516dfa0b0 shell: skeleton for scrolling 2021-05-29 17:23:04 -07:00
Kartik K. Agaram 3f916e6414 press '0' to reset all state 2021-05-16 21:24:20 -07:00
Kartik K. Agaram eede9e222f . 2021-05-14 23:15:46 -07:00
Kartik K. Agaram 56c9248109 load debug info from disk on abort 2021-05-14 21:51:47 -07:00
Kartik K. Agaram 3b1f23f5d7 expand stack to 16MB
It's also no longer contiguous with code.
2021-04-25 21:29:42 -07:00
Kartik Agaram 8185a605c6 expand heap to Qemu default 2021-04-25 08:08:47 -07:00
Kartik K. Agaram 1114442c23 . 2021-04-19 10:47:30 -07:00
Kartik K. Agaram 2f10bc7302 fix a bug in loading code disk 2021-04-18 23:09:09 -07:00
Kartik K. Agaram 8c7aaa6b96 revert experiment: expand heap
There are several things in the codebase right now that don't seem sustainable.
I need to take them out and bring them back in more gradually.
2021-04-18 11:56:10 -07:00
Kartik K. Agaram 6e6e840e88 experiment: expand heap 2021-04-18 11:56:10 -07:00
Kartik K. Agaram d0804ac04b update the memory map 2021-04-18 09:06:20 -07:00
Kartik K. Agaram 97df52bf2f shell: ctrl-r runs on real screen without a trace
We run out of memory fairly early in the course of drawing a chessboard
on the whole screen.
2021-04-17 23:52:52 -07:00
Kartik K. Agaram 568eb7328f write-multiple support
Is flush-ata-cache even needed? Reading the ATA 5 spec more closely, it
looks like it's only required by ATAPI devices! (Packet Interface is what
the 'PI' stands for!) And it's unclear if my driver actually supports ATAPI
at the moment.
2021-04-17 20:20:25 -07:00
Kartik K. Agaram 18e8ee4e16 start flushing the ATA disk cache
"Make sure to do a Cache Flush (ATA command 0xE7) after each write command
completes."
  https://wiki.osdev.org/index.php?title=ATA_PIO_Mode&oldid=25664#Writing_28_bit_LBA
2021-04-17 19:49:50 -07:00
Kartik K. Agaram 31a2c8aac6 starting write-multiple support 2021-04-17 19:45:41 -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 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 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 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 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 55adbda2d9 . 2021-03-23 21:41:40 -07:00
Kartik K. Agaram 7b89f8e67e reorg boot.subx 2021-03-23 21:27:06 -07:00
Kartik K. Agaram 49a9938333 mouse support that requires polling 2021-03-23 21:14:49 -07:00
Kartik K. Agaram e0f6dd5240 get rid of unnecessary padding
Now we only specify addresses where it matters.
2021-03-23 20:00:15 -07:00
Kartik K. Agaram 49464e5866 . 2021-03-23 19:37:07 -07:00