Jan 9, 2021
Rendering text atop baremetal
Mu can now render text atop baremetal x86.
Try clicking around from http://akkartik.github.io/mu/html/apps/ex5.mu.html
The boot-up machine code reads a few sectors from disk, configures a keyboard handler, and loads a bitmap font (2KB for ASCII, with the option for more).
I use GNU Unifont. I believe that means Mu is now GPL v2. So stated. IANAL and I try not to think about software IP. But a font? Copyright seems reasonable there.
Next up: a text editor!
https://github.com/akkartik/mu
permalink
* *
Dec 24, 2020
Towards running Mu without Linux
All Mu really needs so far is to print to screen and read from the keyboard. Here's a 2-minute video about achieving that:
https://archive.org/details/akkartik-2min-2020-12-24
It seems such a small thing. But I needed lots of help, as you can see from the additions to my credits.
Merry Christmas to all! What a beautiful world.
Project page: https://github.com/akkartik/mu
More context: https://mastodon.social/@akkartik/104896128141863951
permalink
* *
Dec 7, 2020
Editing functions in the Mu shell
https://archive.org/details/akkartik-2min-2020-12-06
Long delay since my last video. Printing floating-point numbers is really hard. I'm still half-assing it.
As a follow-up to my previous post, I'm tightening focus to two threads:
- These Mu shell experiments, and
- An extremely skeletal OS to drop the Linux kernel dependency.
Deprioritized for now:
- Other processors: RISCV, ARM, RPi, etc.
- Graphics, mouse, etc. Device priorities for the OS are disk then ethernet.
permalink
* *
Dec 5, 2020
Feeling low today.
Damn hands are acting up again. RSI. Perhaps I should give up on Advent.
Mu's compromises:
- Just one instruction set. New processors need reworking. And I have RSI.
- Text mode. Hopefully a graphics stack can slot in underneath without needing rework.
- No pointer device. Apps are starting to make this assumption. Adding a mouse will require rework. And I have RSI.
:/ Constraints I consider "temporary" are perhaps not.
Want less. — The Buddha
permalink
* *
Dec 5, 2020
#adventofcode in Mu
I seem to be settling into a pattern of solving these on alternate days. Late for one round, early for the next.
Day 4 solutions (spoiler alert):
http://akkartik.github.io/mu/html/apps/advent2020/4a.mu.html
http://akkartik.github.io/mu/html/apps/advent2020/4b.mu.html (utterly ghastly)
2.5 hours. 2 machine-code bugs found, 1 new (terribly named) library primitive added: https://github.com/akkartik/mu/commit/18d5bab2b66
Day 5 solutions:
http://akkartik.github.io/mu/html/apps/advent2020/5a.mu.html
http://akkartik.github.io/mu/html/apps/advent2020/5b.mu.html
30 minutes. No new Mu bugs found.
Project page: https://github.com/akkartik/mu
permalink
* *
Dec 2, 2020
Advent of code in Mu
Day 2 solutions (spoiler alert):
2a
2b.
40 minutes. No new Mu bugs found, no machine-code hacking was needed.
Day 3 solution
60 minutes. Lost 11 minutes debugging a silly mistake (see commit log)
No new Mu bugs found, no machine-code hacking was needed.
Project page: https://github.com/akkartik/mu
permalink
* *
Dec 1, 2020
Advent of code in Mu
http://akkartik.github.io/mu/html/linux/apps/advent2020/1a.mu.html
Day 1 part 1 solution (don't click if you don't want to be spoiled):
Took me about 40 minutes. In the process, I had to:
- Fix a bug in reading lines from stdin into streams
- Start trailing newlines when parsing ints from streams
- Implement `find` in an array
We'll see how long I can keep this up. Linear scans will soon not cut it.
Day 1 part 2 (same deal, same spoiler alert, just more brute force): http://akkartik.github.io/mu/html/apps/advent2020/1b.mu.html
Part 1 took 40 minutes and part 2 took 18. Therefore I'm getting better at this.
Project page: https://github.com/akkartik/mu
permalink
* *
Nov 24, 2020
I'm trying to come up with a notation for the rotate (circular shift) operation:
https://stackoverflow.com/questions/32785998/symbol-for-bitwise-circular-shifts
Kinda surprising that there isn't a standard answer yet, given how common it is in cryptography, and how much of a workhorse it is in the ARM instruction set.
permalink
* *
Nov 14, 2020
The Mu shell, compiling down to a subset of 32-bit x86 machine code, then to a Linux ELF binary, packaged up with just a Linux kernel and nothing else, running on a Linux console emulated on Qemu, on a Thinkpad T420s running 64-bit Linux.
Just another 27 million lines of C to take out (Linux kernel), and I'll have a decent computing stack.
I'm also thinking today about what it would take to fork Mu for the Raspberry Pi. It uses ARM processors, a 64-bit instruction since the Pi 3 which was released in 2015. The 64-bit ISA looks quite nice, but it's incompatible with the Pi 1 and Pi 2. Contrast x86, where 64-bit is quite compatible with 32-bit, but grotesque as a result, with bits for a register scattered across multiple bytes. So I might make the opposite choice to x86 and support just the 64-bit ISA. Thoughts?
https://developer.arm.com/documentation/den0024/a
permalink
* *
Nov 12, 2020
Screenception
Visualizing programs with side-effects in a postfix shell with a live-updating text-mode environment. Built all the way up from machine code without any dependencies (except an x86 processor and Linux kernel).
https://archive.org/details/akkartik-2min-2020-11-12
Project page: https://github.com/akkartik/mu
More context
permalink
* *