diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-01-24 19:38:10 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-01-24 20:16:27 -0800 |
commit | 3844651e49258a400ed81273f7cd620a14264386 (patch) | |
tree | ec050e286314f49945dd0b3f97e4aa839b1a67f5 /baremetal/102keyboard.subx | |
parent | 1c77be68d75d8134bea72305057eb9ce523e9748 (diff) | |
download | mu-3844651e49258a400ed81273f7cd620a14264386.tar.gz |
7559 - reorganize sectors built in raw hex
This was tedious for three reasons beyond the usual one of having to track and update offsets several time while I debug: - The Bochs troubles of the previous commit kept polluting my brain even though they were irrelevant. - I had to keep some changes locally to allow myself to use Bochs, which polluted my working directory. - I had to travel the long way to the realization that I'm not actually initializing the stack anywhere. BIOS was starting my stack off at 0x10000, which was promptly clobbered by my second read from disk. The good news: while I'm here I grow the interrupt descriptor table. So I don't have to go through this exercise when I get back to supporting the mouse.
Diffstat (limited to 'baremetal/102keyboard.subx')
-rw-r--r-- | baremetal/102keyboard.subx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/baremetal/102keyboard.subx b/baremetal/102keyboard.subx index f2c22339..8faa71e3 100644 --- a/baremetal/102keyboard.subx +++ b/baremetal/102keyboard.subx @@ -20,19 +20,19 @@ read-key: # kbd: (addr keyboard) -> result/eax: byte { 75/jump-if-!= break/disp8 # var read/ecx: byte = keyboard buffer's read index - 8b/-> *0x7dcc 1/r32/CL # keyboard-buffer-read + 8b/-> *0x7ee4 1/r32/CL # keyboard-buffer-read # var next-key/eax: byte = *(keyboard buffer + ecx) - 8a/byte-> *(ecx+0x7dd0) 0/r32/AL # keyboard-buffer-data - # if (next-key != 0) lock and remove from keyboard-buffer + 8a/byte-> *(ecx+0x7ee8) 0/r32/AL # keyboard-buffer-data + # if (next-key != 0) lock and remove from keyboard buffer 81 7/subop/compare %eax 0/imm32 { 74/jump-if-= break/disp8 # TODO: add some instructions in this block to SubX if we ever want to # use bootstrap on baremetal programs fa/disable-interrupts - c6 0/subop/copy-byte *(ecx+0x7dd0) 0/imm8 - ff 0/subop/increment *0x7dcc # keyboard-buffer-read - 81 4/subop/and *0x7dcc 0xf/imm32 # keyboard-buffer-read + c6 0/subop/copy-byte *(ecx+0x7ee8) 0/imm8 # keyboard-buffer-data + ff 0/subop/increment *0x7ee4 # keyboard-buffer-read + 81 4/subop/and *0x7ee4 0xf/imm32 # keyboard-buffer-read fb/enable-interrupts } # return |