Skip to content

Commit

Permalink
simplify Qemu instructions
Browse files Browse the repository at this point in the history
Turns out we don't need a special case for KVM.
  https://qemu.readthedocs.io/en/latest/system/invocation.html
  • Loading branch information
akkartik committed Jun 27, 2021
1 parent c7e1fed commit efecaa9
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,23 @@ Currently runs a tiny dialect of Lisp. Steps to run it from the top-level:
results. Hit `ctrl-m` to focus on the `...` after a run, and browse how the
_trace_ of how the results were computed. [Here's a 2-minute demo](https://archive.org/details/akkartik-mu-2021-05-31).

3. If your Qemu installation supports them, one of these commandline arguments
may speed up emulation:
3. If your Qemu installation supports them, an `-accel` arguments
will speed up emulation. Try `-accel help` to list your options.

- `-enable-kvm`
- `-accel ___` (run with `-accel help` for a list of available options)
Once you select an accelerator, I recommend also adjusting the `responsiveness`
mask in shell/evaluate.mu, which controls how frequently the fake screen
updates within the REPL. Smaller values will seem more responsive, larger
values will leave more time to run your programs. I like to see the screen
update about once a second. Some suggested values depending on how fast your
Qemu is running:

If you do this, I recommend also adjusting the `responsiveness` mask in
shell/evaluate.mu, which controls how frequently the fake screen updates.
Smaller values will seem more responsive, larger values will leave more time
to run your programs. I like to see the screen update about once a second.
Some suggested values depending on how fast your Qemu is running:

- `-enable-kvm` on a T420s running Linux: `0xffff/responsiveness=64k`
- `-accel kvm` on a T420s running Linux: `0xffff/responsiveness=64k`
- `-accel tcg` on a 2019 Mac: `0xfff/responsiveness=4k`

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 -accel kvm -hda code.img -hdb data.img
```

### Indent-sensitivity
Expand Down

0 comments on commit efecaa9

Please sign in to comment.