mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-08 04:01:51 +09:00
RESET and SYSRQ is now trapped by a hypervisor
This commit is contained in:
@@ -285,11 +285,13 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
private fun reboot(profileName: String) {
|
||||
val vm = currentlyLoadedProfiles[profileName]!!
|
||||
|
||||
vmRunners[vm.id]!!.close()
|
||||
/*vmRunners[vm.id]!!.close()
|
||||
coroutineJobs[vm.id]!!.interrupt()
|
||||
|
||||
vm.init()
|
||||
initVMenv(vm, profileName)
|
||||
initVMenv(vm, profileName)*/
|
||||
|
||||
// hypervisor will take over by monitoring MMIO addr 48
|
||||
}
|
||||
|
||||
private fun updateGame(delta: Float) {
|
||||
|
||||
@@ -59,6 +59,8 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
|
||||
|
||||
private lateinit var crtShader: ShaderProgram
|
||||
|
||||
internal val whatToDoOnVmExceptionQueue = ArrayList<() -> Unit>()
|
||||
|
||||
fun loadShaderInline(frag0: String): ShaderProgram {
|
||||
// insert version code
|
||||
val frag: String
|
||||
@@ -156,7 +158,7 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
e.printStackTrace()
|
||||
killVMenv()
|
||||
whatToDoOnVmExceptionQueue.add { killVMenv() }
|
||||
}
|
||||
}, "VmRunner:${vm.id}")
|
||||
coroutineJob.start()
|
||||
@@ -192,10 +194,12 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
|
||||
private var rebootRequested = false
|
||||
|
||||
private fun reboot() {
|
||||
vmRunner.close()
|
||||
/*vmRunner.close()
|
||||
coroutineJob.interrupt()
|
||||
|
||||
init()
|
||||
init()*/
|
||||
|
||||
// hypervisor will take over by monitoring MMIO addr 48
|
||||
}
|
||||
|
||||
private var updateAkku = 0.0
|
||||
@@ -226,6 +230,15 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
|
||||
renderGame(dt)
|
||||
|
||||
vm.watchdogs.forEach { (_, watchdog) -> watchdog.update(dt) }
|
||||
|
||||
|
||||
val vmExceptionHandlers = whatToDoOnVmExceptionQueue.toList()
|
||||
vmExceptionHandlers.forEach { it.invoke() }
|
||||
synchronized(whatToDoOnVmExceptionQueue) {
|
||||
vmExceptionHandlers.forEach {
|
||||
whatToDoOnVmExceptionQueue.remove(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateGame(delta: Float) {
|
||||
|
||||
Reference in New Issue
Block a user