Skip to content

Commit 806f362

Browse files
authored
Update README.md
1 parent c065411 commit 806f362

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,26 @@ cargo run
6767

6868
## Future Improvements plans for the 16-bit VM
6969

70-
Implement runtime
71-
72-
Run eBPF-inspired programs: Support a small subset of eBPF instructions (arithmetic, logic, memory access, branching) adapted to 16-bit registers.
73-
74-
Enhanced stack and memory: Add bounds-checked stack and simple memory model to handle eBPF-like program execution safely.
75-
76-
Syscalls / helpers: Implement basic runtime functions such as logging or debug output for program interaction.
77-
78-
Instruction decoding and execution: Support immediate values, relative jumps, and conditional branching for richer eBPF-style logic.
79-
80-
Debugging and verification: Add execution logs, stack/register inspection, and basic safety checks (overflow, invalid jumps).
70+
Right now, my 16-bit Rust VM is a pure-interpreter.
71+
It reads my VM instructions (Read, decode, executes, one instruction at a time) in the software on the host CPU. Nothing gets translated to native instructions.
72+
- The host CPU executes Rust code that implements the operations, not the ADD itself.
73+
- VM registers live in Rust memory, not in actual CPU registers.
74+
75+
Adding a runtime with JIT will allow me:
76+
- Translate my 16-bit VM into host CPU instructions (ARM64)
77+
- Execute them natively instead of interpreting them one by one
78+
- Get much higher performance for “heavy work”
79+
- Keep safety and control over execution because the VM still manages correctness
80+
81+
The goal is to make my VM run eBPF programs with runtime + JIT:
82+
- Define a mapping from eBPF instructions to your VM structures (Implement the eBPF Interpreter), adding verifier is optional (probably will not implement)
83+
- Add a eBPF VM runtime -> program execution manager
84+
- Implement JIT Compilation -> translate eBPF instructions to host CPU instructions at runtime
8185

8286
## Resources & Inspiration
8387
- [Writing an LC-3 VM in C](https://www.jmeiners.com/lc3-vm/)
8488
- [Writing a VM (Stephen Gream)](https://stephengream.com/writing-a-vm-part-one/)
8589
- [Build Virtual Machine](https://www.youtube.com/watch?v=OjaAToVkoTw&list=PLSewtCfzWXPKemmD0_hi_G8ZOvYxSJDpo&index=10)
8690

8791
---
88-
This project is for learning and experimentation. Contributions and questions are welcome!
92+
This project is for learning and experimentation. Contributions and questions are welcome!

0 commit comments

Comments
 (0)