make code in Readme easier to copy

Thanks Sumeet Agarwal for the suggestion.
This commit is contained in:
Kartik K. Agaram 2021-06-18 07:11:36 -07:00
parent 8c47da082b
commit c22dbbea39
2 changed files with 14 additions and 14 deletions

View File

@ -10,10 +10,10 @@ Running the code you want to run, and nothing else.
Here's the Mu computer running [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
```sh
$ git clone https://github.com/akkartik/mu
$ cd mu
$ ./translate life.mu # emit a bootable code.img
$ qemu-system-i386 code.img
git clone https://github.com/akkartik/mu
cd mu
./translate life.mu # emit a bootable code.img
qemu-system-i386 code.img
```
<img alt='screenshot of Game of Life running on the Mu computer' src='html/baremetal-life.png'>
@ -94,7 +94,7 @@ Mu programs build natively either on Linux or on Windows using [WSL 2](https://d
For Macs and other Unix-like systems, use the (much slower) emulator:
```sh
$ ./translate_emulated ex2.mu # ~2 mins to emit code.img
./translate_emulated ex2.mu # ~2 mins to emit code.img
```
Mu programs can be written for two very different environments:
@ -203,9 +203,9 @@ If you're still reading, here are some more things to check out:
for a postfix language that I might work on again one day:
```sh
$ cd linux
$ ./translate tile/*.mu
$ ./a.elf screen
cd linux
./translate tile/*.mu
./a.elf screen
```
- [A summary](mu_instructions) of how the Mu compiler translates statements

View File

@ -5,12 +5,12 @@ Currently runs a tiny dialect of Lisp. Steps to run it from the top-level:
1. Build it:
```sh
$ ./translate shell/*.mu # generates code.img
./translate shell/*.mu # generates code.img
```
You can now already run it (under emulation):
```sh
$ qemu-system-i386 code.img
qemu-system-i386 code.img
```
But let's add some more 'meat' to play with.
@ -18,13 +18,13 @@ Currently runs a tiny dialect of Lisp. Steps to run it from the top-level:
2. Create a data disk with a library of functions.
```sh
$ dd if=/dev/zero of=data.img count=20160
$ cat shell/data.limg |dd of=data.img conv=notrunc
dd if=/dev/zero of=data.img count=20160
cat shell/data.limg |dd of=data.img conv=notrunc
```
Run with data disk (and 2GB of RAM):
```sh
$ qemu-system-i386 -m 2G -hda code.img -hdb data.img
qemu-system-i386 -m 2G -hda code.img -hdb data.img
```
<img alt='screenshot of the Mu shell' src='../html/20210615-shell.png'>
@ -59,7 +59,7 @@ Currently runs a tiny dialect of Lisp. Steps to run it from the top-level:
Putting it all together, here's the command I typically use on Linux:
```
$ qemu-system-i386 -m 2G -enable-kvm -hda code.img -hdb data.img
qemu-system-i386 -m 2G -enable-kvm -hda code.img -hdb data.img
```
*Known issues*