How aurimukstis1/python-virtualmachine works
This repository is a small bytecode virtual machine. Its principal workflow loads a program into a process’s virtual memory, executes instructions on the CPU, and has the main loop respond to halt, error, syscall, and scheduling statuses. The kernel creates processes, handles syscalls, and coordinates context switches; the MMU provides paged address translation and frame allocation. Source excerpts show these core interactions; the README documents the VM’s broader memory, register, arithmetic, and function-call capabilities.
Main entry points: kernel.py Process kernel · main.py VM runner · cpu.py Bytecode CPU · memory.py Paged MMU
Components 8
Execution
- VM runner
main.py - Bytecode CPU
cpu.py
Kernel
- Process state
process.py - Process kernel
kernel.py
Memory
- Paged MMU
memory.py - Physical frames
memory.py
Other components
- Program user
- Console
Connections 12
- Program user → VM runner: starts VM
main.py - VM runner → Process kernel: creates system
main.py - VM runner → Bytecode CPU: steps instructions
main.py - VM runner → Process kernel: loads program
main.py - Process kernel → Process state: creates state
kernel.py - Process kernel → Paged MMU: loads bytes
kernel.py - Bytecode CPU → Paged MMU: reads/writes
cpu.py - Paged MMU → Physical frames: allocates pages
memory.py - VM runner → Process kernel: handles status
main.py - Process kernel → Console: prints syscall
kernel.py - VM runner → Process kernel: switches process
main.py - Process kernel → Bytecode CPU: syncs registers
kernel.py