mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-09 12:41:51 +09:00
making bootloader to load the dos kernel to run a shell
This commit is contained in:
@@ -60,30 +60,22 @@ class VMGUI(val appConfig: LwjglApplicationConfiguration) : ApplicationAdapter()
|
||||
val bios = fr1.readText()
|
||||
fr1.close()
|
||||
|
||||
|
||||
val fr2 = FileReader("./assets/tvdos/gl.js")
|
||||
val tvgl = fr2.readText()
|
||||
fr2.close()
|
||||
|
||||
val fr3 = FileReader("./assets/tvdos/TVDOS.SYS")
|
||||
val tvknl = fr3.readText()
|
||||
fr3.close()
|
||||
|
||||
|
||||
//val fr = FileReader("./assets/tvdos/command.js")
|
||||
//val fr = FileReader("./assets/zippytest.js")
|
||||
//val fr = FileReader("./assets/serialtest.js")
|
||||
//val fr = FileReader("./assets/tvdos/fsh.js")
|
||||
val fr = FileReader("./assets/tvdos/flsh.js")
|
||||
//val fr = FileReader("./assets/tvdos/flsh.js")
|
||||
//val fr = FileReader("./assets/tbas/basic.js")
|
||||
//val fr = FileReader("./assets/jscon.js")
|
||||
val fr = FileReader("./assets/!BOOTSEC")
|
||||
val prg = fr.readText()
|
||||
fr.close()
|
||||
|
||||
vmRunner = VMRunnerFactory(vm, "js")
|
||||
coroutineJob = GlobalScope.launch {
|
||||
vmRunner.evalGlobal("$bios\n$tvknl\n$tvgl")
|
||||
vmRunner.executeCommand(prg)
|
||||
//vmRunner.evalGlobal("$bios")
|
||||
//vmRunner.executeCommand(prg)
|
||||
vmRunner.executeCommand("$bios\n$prg")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.InputProcessor
|
||||
import net.torvald.UnsafeHelper
|
||||
import net.torvald.tsvm.VM
|
||||
import net.torvald.util.CircularArray
|
||||
import java.io.File
|
||||
import kotlin.experimental.and
|
||||
|
||||
class IOSpace(val vm: VM) : PeriBase, InputProcessor {
|
||||
@@ -39,7 +40,7 @@ class IOSpace(val vm: VM) : PeriBase, InputProcessor {
|
||||
|
||||
init {
|
||||
blockTransferPorts[1].attachDevice(TestFunctionGenerator())
|
||||
blockTransferPorts[0].attachDevice(TestDiskDrive(0))
|
||||
blockTransferPorts[0].attachDevice(TestDiskDrive(0, File("assets/")))
|
||||
}
|
||||
|
||||
private fun composeBlockTransferStatus(portno: Int): Int {
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.File
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
|
||||
class TestDiskDrive(private val driveNum: Int) : BlockTransferInterface(false, true) {
|
||||
class TestDiskDrive(private val driveNum: Int, theRootPath: File? = null) : BlockTransferInterface(false, true) {
|
||||
|
||||
companion object {
|
||||
const val STATE_CODE_STANDBY = 0
|
||||
@@ -41,7 +41,7 @@ class TestDiskDrive(private val driveNum: Int) : BlockTransferInterface(false, t
|
||||
return sb.toByteArray()
|
||||
}
|
||||
|
||||
private val rootPath = File("test_assets/test_drive_$driveNum")
|
||||
private val rootPath = theRootPath ?: File("test_assets/test_drive_$driveNum")
|
||||
|
||||
private var fileOpen = false
|
||||
private var fileOpenMode = -1 // 1: 'W", 2: 'A'
|
||||
|
||||
Reference in New Issue
Block a user