mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
tvdos bootable disk image builder
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -262,7 +262,7 @@ _fsh.drawTitlebar()
|
||||
|
||||
// TEST
|
||||
con.move(2,1);
|
||||
print("Hit backspace to exit")
|
||||
print("fSh is very much in-dev! Hit backspace to exit")
|
||||
|
||||
// TODO update for events: key down (updates some widgets), timer (updates clock and calendar widgets)
|
||||
while (true) {
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
1
assets/disk0/root.bootable/!BOOTSEC
Normal file
1
assets/disk0/root.bootable/!BOOTSEC
Normal file
@@ -0,0 +1 @@
|
||||
let p=_BIOS.FIRST_BOOTABLE_PORT;com.sendMessage(p[0],"DEVRST\x17");com.sendMessage(p[0],'OPENR"tvdos/TVDOS.SYS",'+p[1]);let r=com.getStatusCode(p[0]);if(0==r)if(com.sendMessage(p[0],"READ"),r=com.getStatusCode(p[0]),0==r){let g=com.pullMessage(p[0]);eval(g)}else println("I/O Error");else println("TVDOS.SYS not found");println("Shutting down...");println("It is now safe to turn off the power");
|
||||
8
assets/disk0/root.bootable/AUTOEXEC.BAT
Normal file
8
assets/disk0/root.bootable/AUTOEXEC.BAT
Normal file
@@ -0,0 +1,8 @@
|
||||
echo "Starting TVDOS..."
|
||||
|
||||
rem put set-xxx commands here:
|
||||
rem e.g. set PATH=\home\my-cool-project;$PATH
|
||||
set KEYBOARD=us_qwerty
|
||||
|
||||
rem this line specifies which shell to be presented after the boot precess:
|
||||
command /fancy
|
||||
44
tsvm_executable/src/net/torvald/tsvm/BuildTvdosBootable.kt
Normal file
44
tsvm_executable/src/net/torvald/tsvm/BuildTvdosBootable.kt
Normal file
@@ -0,0 +1,44 @@
|
||||
package net.torvald.tsvm
|
||||
|
||||
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.VDUtil
|
||||
import net.torvald.tsvm.VM
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2022-12-21.
|
||||
*/
|
||||
fun main(args: Array<String>) {
|
||||
if (args.size != 1)
|
||||
println("Usage: java -jar BuildTvdosBootable.jar outfile")
|
||||
|
||||
val disk = VDUtil.createNewDisk(720L shl 10, "TVDOS", VM.CHARSET)
|
||||
|
||||
val tvdosDir = VDUtil.addDir(disk, 0, "tvdos".toByteArray(VM.CHARSET))
|
||||
val homeDir = VDUtil.addDir(disk, 0, "home".toByteArray(VM.CHARSET))
|
||||
|
||||
//tvdos/bin/*
|
||||
VDUtil.importDirRecurse(disk, File("assets/disk0/tvdos/bin"), tvdosDir, VM.CHARSET)
|
||||
|
||||
//tvdos/*
|
||||
listOf(
|
||||
VDUtil.importFile(File("assets/disk0/tvdos/gl.js"), disk.generateUniqueID(), VM.CHARSET),
|
||||
VDUtil.importFile(File("assets/disk0/tvdos/TVDOS.SYS"), disk.generateUniqueID(), VM.CHARSET),
|
||||
VDUtil.importFile(File("assets/disk0/tvdos/us_colemak.key"), disk.generateUniqueID(), VM.CHARSET),
|
||||
VDUtil.importFile(File("assets/disk0/tvdos/us_qwerty.key"), disk.generateUniqueID(), VM.CHARSET),
|
||||
// VDUtil.importFile(File("assets/disk0/tvdos/wall.bytes"), disk.generateUniqueID(), VM.CHARSET),
|
||||
// VDUtil.importFile(File("assets/disk0/tvdos/wall.png"), disk.generateUniqueID(), VM.CHARSET),
|
||||
).forEach {
|
||||
VDUtil.addFile(disk, tvdosDir, it)
|
||||
}
|
||||
|
||||
// bare file in root dir
|
||||
listOf(
|
||||
VDUtil.importFile(File("assets/disk0/root.bootable/!BOOTSEC"), disk.generateUniqueID(), VM.CHARSET),
|
||||
VDUtil.importFile(File("assets/disk0/root.bootable/AUTOEXEC.BAT"), disk.generateUniqueID(), VM.CHARSET),
|
||||
).forEach {
|
||||
VDUtil.addFile(disk, 0, it)
|
||||
}
|
||||
|
||||
|
||||
VDUtil.dumpToRealMachine(disk, File(args[0]))
|
||||
}
|
||||
Reference in New Issue
Block a user