mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
drive manager for clustered
This commit is contained in:
@@ -810,7 +810,7 @@ shell.execute = function(line) {
|
||||
}
|
||||
shell.pipes = {} // syntax: _G.shell.pipes[name] = contents; all pipes are named pipes just like in Windows
|
||||
shell.currentlyActivePipes = [] // Queue of pipe's names. Use shell.removePipe() to dequeue and shell.pushPipe() to enqueue.
|
||||
shell._rndstr = '0123456789+qwfpgjluyarstdhneiozxcvbkm/QWFPGJLUYARSTDHNEIOZXCVBKM'
|
||||
shell._rndstr = '0123456789+qwfpgjluyarstdhneiozxcvbkm&QWFPGJLUYARSTDHNEIOZXCVBKM'
|
||||
shell.generateAnonPipeName = function() {
|
||||
let name = ''
|
||||
while (true) {
|
||||
|
||||
@@ -1,10 +1,38 @@
|
||||
/*
|
||||
TVDOS Linear File Strip.
|
||||
|
||||
Format:
|
||||
|
||||
- Header
|
||||
- FileBlock... (repeatedly appended for every file collected)
|
||||
|
||||
# Header
|
||||
|
||||
Bytes "TVDOSLFS\x01" - header
|
||||
Uint16 Encoding
|
||||
00 00 : Pure ASCII/CP437
|
||||
01 00..0F : ISO 8859-1..16
|
||||
10 00 : UTF-8
|
||||
10 01 : UTF-16BE
|
||||
10 02 : UTF-16LE
|
||||
Byte[5] Padding
|
||||
|
||||
# FileBlocks
|
||||
Uint8 File type (only 1 is used)
|
||||
Uint16 Length of the Path
|
||||
Bytes[*] Fully Qualified Path string
|
||||
Uint32 Length of the binary
|
||||
Bytes[*] Binary representation of the file, no extra compression (to reduce the size of the archive, gzip the entire LFS
|
||||
instead of compressing individual files)
|
||||
*/
|
||||
|
||||
function printUsage() {
|
||||
println(`Collects files under a directory into a single archive.
|
||||
Usage: lfs [-c/-x/-t] dest.lfs path\\to\\source
|
||||
To collect a directory into myarchive.lfs:
|
||||
lfs -c myarchive.lfs path\\to\\directory
|
||||
To extract an archive to path\\to\\my\\files:
|
||||
lfs -x myarchive.lfs \\path\\to\\my\\files
|
||||
lfs -x myarchive.lfs path\\to\\my\\files
|
||||
To list the collected files:
|
||||
lfs -t myarchive.lfs`)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.torvald.tsvm.peripheral
|
||||
|
||||
import net.torvald.tsvm.VM
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* `theArchivePath` must always be specified (where to load/save)
|
||||
*
|
||||
* To denote formatted (=already created) disk:
|
||||
* - specify diskUUIDstr
|
||||
* - set sectorsForNewDisk as -1
|
||||
* - set deviceOrigin and deviceTier as 0
|
||||
*
|
||||
* To denote unformatted (=not yet created) disk:
|
||||
* - set diskUUIDstr as ""
|
||||
* - specify sectorsForNewDisk
|
||||
* - specify deviceOrigin and deviceTier
|
||||
*
|
||||
* Created by minjaesong on 2023-05-15.
|
||||
*/
|
||||
class ClusteredDiskDrive(
|
||||
private val vm: VM,
|
||||
private val driveNum: Int,
|
||||
private val theArchivePath: String,
|
||||
private val diskUUIDstr: String,
|
||||
private val sectorsForNewDisk: Int,
|
||||
private val deviceOrigin: Int,
|
||||
private val deviceTier: Int
|
||||
) {
|
||||
|
||||
private var uuid: UUID? = if (diskUUIDstr.isEmpty()) null else UUID.fromString(diskUUIDstr)
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user