Doc updates

This commit is contained in:
Toby Jaffey 2025-12-07 01:01:11 +00:00
parent 30cf60561f
commit 4610e8ddaf

View file

@ -11,6 +11,8 @@ uvm32 is a minimalist, dependency-free virtual machine sandbox designed for micr
* Safe minimalistic FFI
* Small enough for "if this then that" scripts/plugins, capable enough for much more
Although based on a fully fledged CPU emulator, uvm32 is intended for executing custom script like logic, not for simulating hardware.
Check out the [apps](apps) folder for more.
## Quickstart
@ -76,6 +78,9 @@ stateDiagram
UVM32_STATUS_RUNNING --> UVM32_STATUS_ERROR
```
## Boot
At boot, the whole memory is zeroed. The user program is placed at the start, the CPU registers are stored at the end. The stack pointer is set to the start of the CPU registers and grows downwards.
## ioreqs
@ -148,6 +153,10 @@ int main(int argc, char *argv[]) {
}
```
## Configuration
The uvm32 memory size is set at compile time with `-DUVM32_MEMORY_SIZE=X` (in bytes). A memory of 512 bytes will be sufficient for trivial programs.
## Samples
* [host](host) vm host which loads a binary and runs to completion, handling multiple ioreq types
@ -155,6 +164,7 @@ int main(int argc, char *argv[]) {
* [host-parallel](host-parallel) parallel vm host running multiple vm instances concurrently, with baked in bytecode
* [host-arduino](host-arduino) vm host as Arduino sketch (tested on Arduino Uno ATmega328P, uses 9950 bytes of flash/1254 bytes RAM)
* [apps/helloworld](apps/helloworld) C hello world program
* [apps/fib](apps/fib) C fibonacci series program (iterative and recursive)
* [apps/sketch](apps/sketch) C Arduino/Wiring/Processing type program in `setup()` and `loop()` style
* [apps/rust-hello](apps/rust-hello) Rust hello world program (note, the version of rust installed by brew on mac has issues, use the official rust installer from https://rust-lang.org/learn/get-started/)
* [apps/zig-mandel](apps/zig-mandel) Zig ASCII mandelbrot generator program