mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-15 17:04:04 +09:00
it does work if you load compiled hypervisor
This commit is contained in:
14
assets/disk0/home/hdk/free.js
Normal file
14
assets/disk0/home/hdk/free.js
Normal file
@@ -0,0 +1,14 @@
|
||||
if (exec_args[1] === undefined) {
|
||||
println("Usage: free ptr_in_hex")
|
||||
println(" This will free the pointer loaded using 'load'")
|
||||
return 1
|
||||
}
|
||||
|
||||
// check for CUM header
|
||||
const ptr = parseInt(exec_args[1], 16)
|
||||
const magic = sys.peek(ptr)
|
||||
|
||||
if (magic != 0xA5) return 1
|
||||
|
||||
|
||||
sys.free(ptr)
|
||||
Reference in New Issue
Block a user