mu/baremetal
Kartik Agaram 6efc1ebed7 7529 - baremetal: fake screen 2021-01-16 15:32:26 -08:00
..
101screen.subx 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
102keyboard.subx 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
103grapheme.subx 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
104test.subx 7519 - baremetal: run all tests on boot 2021-01-13 21:50:38 -08:00
106stream.subx 7523 2021-01-15 21:22:33 -08:00
108write.subx 7523 2021-01-15 21:22:33 -08:00
109stream-equal.subx 7523 2021-01-15 21:22:33 -08:00
112read-byte.subx 7524 - bring back some abort messages 2021-01-15 21:27:52 -08:00
115write-byte.subx 7524 - bring back some abort messages 2021-01-15 21:27:52 -08:00
120allocate.subx 7528 - heap allocator 2021-01-16 11:35:13 -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 7527 2021-01-16 10:40:19 -08:00
313index-bounds-check.subx 7527 2021-01-16 10:40:19 -08:00
400.mu 7528 - heap allocator 2021-01-16 11:35:13 -08:00
403unicode.mu 7492 2021-01-09 18:55:24 -08:00
500text-screen.mu 7529 - baremetal: fake screen 2021-01-16 15:32:26 -08:00
501draw-text.mu 7516 2021-01-13 21:15:24 -08:00
502test.mu . 2021-01-14 13:37:28 -08:00
503manhattan-line.mu 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
README.md 7528 - heap allocator 2021-01-16 11:35:13 -08:00
boot.bochsrc 7461 2020-12-29 18:56:21 -08:00
boot.hex 7529 - baremetal: fake screen 2021-01-16 15:32:26 -08:00
boot0.hex 7403 - baremetal/ for apps without a kernel 2020-12-26 13:30:04 -08:00
ex1.hex 7489 - include GNU Unifont 2021-01-09 18:20:28 -08:00
ex1.subx 7518 2021-01-13 21:41:45 -08:00
ex2.hex 7489 - include GNU Unifont 2021-01-09 18:20:28 -08:00
ex2.mu 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
ex2.subx 7518 2021-01-13 21:41:45 -08:00
ex3.hex 7489 - include GNU Unifont 2021-01-09 18:20:28 -08:00
ex3.mu 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
ex4.mu 7490 - baremetal: draw a grapheme to screen 2021-01-09 18:28:14 -08:00
ex5.mu 7500 - baremetal: bounds-check screen space before drawing 2021-01-12 00:00:20 -08:00
ex6.mu 7521 - new plan for tests 2021-01-15 20:30:07 -08:00
ex7.mu 7513 2021-01-13 19:50:30 -08:00
mu-init.subx 7528 - heap allocator 2021-01-16 11:35:13 -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.

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 0x9000. 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.