mu/baremetal
Kartik K. Agaram 249bef13d8 7840 2021-03-01 23:49:53 -08:00
..
shell 7840 2021-03-01 23:49:53 -08:00
101screen.subx 7671 2021-01-27 21:16:36 -08:00
102keyboard.subx 7672 2021-01-27 21:52:44 -08:00
103grapheme.subx 7687 2021-02-05 20:35:23 -08:00
104test.subx 7519 - baremetal: run all tests on boot 2021-01-13 21:50:38 -08:00
105string-equal.subx 7547 - baremetal: rpn calculator 2021-01-22 23:29:04 -08:00
106stream.subx 7523 2021-01-15 21:22:33 -08:00
108write.subx 7783 - baremetal: no, delete trace stream 2021-02-22 19:02:56 -08:00
109stream-equal.subx 7726 2021-02-11 21:27:25 -08:00
112read-byte.subx 7723 - baremetal: rendering string values 2021-02-11 19:34:55 -08:00
113write-stream.subx 7802 2021-02-24 23:03:31 -08:00
115write-byte.subx 7817 2021-02-27 06:55:41 -08:00
117write-int-hex.subx 7530 - baremetal: print ints to screen 2021-01-16 16:27:58 -08:00
118parse-hex-int.subx 7724 - baremetal: rendering array values 2021-02-11 20:59:39 -08:00
120allocate.subx 7767 - baremetal/shell: skeleton repl 2021-02-21 12:32:57 -08:00
121new-stream.subx 7767 - baremetal/shell: skeleton repl 2021-02-21 12:32:57 -08:00
123slice.subx 7693 - baremetal: pass background color everywhere 2021-02-07 15:50:16 -08:00
124next-token.subx 7779 2021-02-21 22:17:26 -08:00
126write-int-decimal.subx 7693 - baremetal: pass background color everywhere 2021-02-07 15:50:16 -08:00
127next-word.subx 7547 - baremetal: rpn calculator 2021-01-22 23:29:04 -08:00
301array-equal.subx 7724 - baremetal: rendering array values 2021-02-11 20:59:39 -08:00
302stack_allocate.subx 7492 2021-01-09 18:55:24 -08:00
308allocate-array.subx 7529 - baremetal: fake screen 2021-01-16 15:32:26 -08:00
309stream.subx 7693 - baremetal: pass background color everywhere 2021-02-07 15:50:16 -08:00
310copy-bytes.subx 7723 - baremetal: rendering string values 2021-02-11 19:34:55 -08:00
311decimal-int.subx 7724 - baremetal: rendering array values 2021-02-11 20:59:39 -08:00
312copy.subx 7723 - baremetal: rendering string values 2021-02-11 19:34:55 -08:00
313index-bounds-check.subx 7693 - baremetal: pass background color everywhere 2021-02-07 15:50:16 -08:00
314divide.subx 7719 - baremetal: print floats 2021-02-11 00:44:13 -08:00
400.mu 7802 2021-02-24 23:03:31 -08:00
403unicode.mu 7690 2021-02-07 00:20:29 -08:00
408float.mu 7719 - baremetal: print floats 2021-02-11 00:44:13 -08:00
411string.mu 7723 - baremetal: rendering string values 2021-02-11 19:34:55 -08:00
412render-float-decimal.mu 7817 2021-02-27 06:55:41 -08:00
500text-screen.mu 7743 2021-02-14 15:09:16 -08:00
501draw-text.mu 7793 - baremetal/shell: menu 2021-02-22 23:59:35 -08:00
502test.mu 7788 2021-02-22 22:32:12 -08:00
503manhattan-line.mu 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
504test-screen.mu 7788 2021-02-22 22:32:12 -08:00
README.md 7567 - baremetal: shift-key support 2021-01-27 19:54:05 -08:00
boot.bochsrc 7716 2021-02-10 23:51:27 -08:00
boot.hex 7835 2021-03-01 22:41:13 -08:00
boot0.hex 7682 2021-02-01 13:26:48 -08:00
ex1.hex 7673 2021-01-28 00:25:54 -08:00
ex1.subx 7518 2021-01-13 21:41:45 -08:00
ex2.hex 7673 2021-01-28 00:25:54 -08:00
ex2.mu 7690 2021-02-07 00:20:29 -08:00
ex2.subx 7671 2021-01-27 21:16:36 -08:00
ex3.hex 7671 2021-01-27 21:16:36 -08:00
ex3.mu 7690 2021-02-07 00:20:29 -08:00
ex4.mu 7713 2021-02-10 22:34:08 -08:00
ex5.mu 7690 2021-02-07 00:20:29 -08:00
ex6.mu 7690 2021-02-07 00:20:29 -08:00
ex7.mu 7713 2021-02-10 22:34:08 -08:00
ex8.mu 7717 - baremetal: enable FPU (I think) 2021-02-11 00:12:08 -08:00
life.mu 7738 2021-02-13 20:19:11 -08:00
mu-init.subx 7789 2021-02-22 22:35:08 -08:00
rpn.mu 7715 2021-02-10 23:13:08 -08:00
vga_palette 7505 2021-01-12 22:01:50 -08:00
vga_palette.c 7504 2021-01-12 21:51:46 -08:00
vga_palette.png 7503 - baremetal: noodling on default VGA palette 2021-01-12 19:50:22 -08:00
vimrc.vim 7466 2020-12-29 20:29:55 -08:00

README.md

Some apps written in SubX and Mu. Where the rest of this repo relies on a few Linux syscalls, the apps in this subdirectory interface directly with hardware. We still need the top-level and apps to build them.

I'd like to eventually test these programs on real hardware, and to that end they are extremely parsimonious in the hardware they assume:

  1. Lots (more than 640KB/1MB[1]) of RAM
  2. Pure-graphics video mode (1024x768 pixels) in 256-color mode. At 8x8 pixels per grapheme, this will give us 160x128 graphemes. But it's still an open question if it's reasonably widely supported by modern hardware. If it isn't, I'll downsize.
  3. Keyboard. Just a partial US keyboard for now. Main qwerty zone only. No number pad, no function keys, no ctrl/alt/meta/fn/super/capslck/numlck.

That's it:

  • No wifi, no networking
  • No multitouch, no touchscreen, no mouse
  • No graphics acceleration
  • No virtual memory, no memory reclamation

Just your processor, gigabytes of RAM[1], a moderately-sized monitor and a keyboard. (The mouse should also be easy to provide.)

We can't yet read from or write to disk, except for the initial load of the program. Enabling access to lots of RAM gives up access to BIOS helpers for the disk.

These programs don't convert to formats like ELF that can load on other operating systems. There's also currently no code/data segment separation, just labels and bytes. I promise not to write self-modifying code. Security and sandboxing is still an open question.

Programs start executing at address 0x9400. See baremetal/boot.hex for details.

Mu programs always run all their automated tests first. main only runs if there are no failing tests. See baremetal/mu-init.subx for details.

So far the programs have only been tested in Qemu and Bochs emulators.

[1] Though we might need to start thinking of the PC memory map as our programs grow past the first 32MB of memory. Mu doesn't yet make any attempt to understand how much RAM the underlying computer has. Also, writing to random locations can damage hardware or corrupt storage devices.