From c22dbbea3960ffbcf983f6ac2d1b0daf9d294461 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 18 Jun 2021 07:11:36 -0700 Subject: make code in Readme easier to copy Thanks Sumeet Agarwal for the suggestion. --- README.md | 16 ++++++++-------- shell/README.md | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3e53f3fe..f623ed95 100644 --- a/README.md +++ b/README.md @@ -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 ``` screenshot of Game of Life running on the Mu computer @@ -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 diff --git a/shell/README.md b/shell/README.md index 072e9d60..6bde168b 100644 --- a/shell/README.md +++ b/shell/README.md @@ -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 ``` screenshot of the Mu shell @@ -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* -- cgit 1.4.1-2-gfad0