Skip to content

le0kar0ub1/RVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RVM

A simple rust (micro-)'virtual machine'.

RVM run binary and provide a securited run-time environment for userspace programs.

root documentation

Dependencies

  • cargo

Build

Assured by our servitor cargo.

cargo build

Run

caro run $BINARY

where $BINARY is the executable path you want run.

Sub-Ref

Directory Ref
src/arch ref
src/loader ref
src/mem ref

About

Scoped architecture: x86_64

Sample

Juste a sample of x64 assembly code to test the VM.

global _start

section .text

called:
    mov rax, 0x1
    mov rdi, 0x1
    lea rsi, [metoo]
    mov rdx, 0xF
    syscall
    ret

_start:
    lea rax, [wrme]
    inc BYTE [rax]
    mov rax, called
    call rax
    mov rcx, 0x4
re:
    mov rax, 0x1
    mov rdi, 0x1
    lea rsi, [wrme]
    mov rdx, 0xD
    push rcx
    syscall
    pop rcx
    dec rcx
    cmp rcx, 0x0
    jne re

    mov rax, 0x3C
    mov rdi, 0x0
    syscall

section .data
   wrme DB 'gello world!', 0xA
   metoo DB 'called routine', 0xA
[anywhere/RVM]$ sample/asm.sh sampe/s
[anywhere/RVM]$ cargo run sample/s

Then the given output:

called routine
hello world!
hello world!
hello world!
hello world!
Program exit with code: 0

Epilogue

To learn rust language.

Feel free to fork, use, improve.

Releases

No releases published

Packages

 
 
 

Languages