lemma

package module
v0.0.0-...-af49336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sys_Data = 0x7E00 // and upward
	Sys_Load = 0x7000 // and upward

	Usr_Load  = 0x3000 // and upward
	Usr_Stack = 0x3000 // downward
	Usr_Data  = 0x0800 // and upward
)
View Source
const (
	Ready   = 1
	Waiting = 2
	Blocked = 3
)
View Source
const (
	BadRequest = 400
	ImATeapot  = 418
)
View Source
const CocoBreak = 3
View Source
const CocoClear = 12
View Source
const CocoDown = 10
View Source
const CocoEnter = 13
View Source
const CocoLeft = 8
View Source
const CocoRight = 9
View Source
const CocoShiftDown = 91 // '['
View Source
const CocoShiftLeft = 21 // ^U
View Source
const CocoShiftRight = 93 // ']'
View Source
const CocoShiftUp = 95 // '_'
View Source
const CocoUp = 94
View Source
const DirPerm = 0775
View Source
const FilePerm = 0664
View Source
const FloppySize35 = 161280
View Source
const FloppySize40 = 184320
View Source
const FloppySize80 = 368640
View Source
const FooterSize = 2
View Source
const HeaderSize = 2
View Source
const HomePageHtml = `` /* 1428-byte string literal not displayed */
View Source
const LemmaErrorMax = 99
View Source
const LemmaErrorMin = 80

LemmaError() takes Printf arguments, logs the error in the lemma server, and returns an error number in 80..99 for the OS9 error.

View Source
const MuxBad = '-'
View Source
const MuxEnough = '.'
View Source
const MuxGoAhead = ':'

MidMux marks.

View Source
const MuxGood = '+'

EndMux marks.

View Source
const MuxNotYet = '~'
View Source
const MuxOK = ';'
View Source
const NumDrives = 10
View Source
const SET_R0_ONE = 0xFFD7
View Source
const SET_R0_ZERO = 0xFFD6

file:///home/strick/doc/CoCo%20Hardware%20Reference.pdf

View Source
const SET_R1_ONE = 0xFFD9
View Source
const SET_R1_ZERO = 0xFFD8
View Source
const TEMP = "Temp"

Variables

View Source
var BLOCK0 = flag.String("block0", "", "[one program mode] filename of block drive 0")
View Source
var Block0 *os.File
View Source
var Book_Menu = &Menu{
	Name: "Book",
	Items: []*Menu{
		&Menu{
			Name:  "Set Bookmark",
			Items: SetBookmark_Menu.Items,
		},
		&Menu{
			Name:   "View Bookmarks",
			Action: &ViewBookmarksAction{},
		},
		&Menu{
			Name:   "0 : Goto Bookmark 0",
			Action: MakeGotoBookmark(0),
		},
		&Menu{
			Name:   "1 : Goto Bookmark 1",
			Action: MakeGotoBookmark(1),
		},
		&Menu{
			Name:   "2 : Goto Bookmark 2",
			Action: MakeGotoBookmark(2),
		},
		&Menu{
			Name:   "3 : Goto Bookmark 3",
			Action: MakeGotoBookmark(3),
		},
		&Menu{
			Name:   "4 : Goto Bookmark 4",
			Action: MakeGotoBookmark(4),
		},
		&Menu{
			Name:   "5 : Goto Bookmark 5",
			Action: MakeGotoBookmark(5),
		},
		&Menu{
			Name:   "6 : Goto Bookmark 6",
			Action: MakeGotoBookmark(6),
		},
		&Menu{
			Name:   "7 : Goto Bookmark 7",
			Action: MakeGotoBookmark(7),
		},
		&Menu{
			Name:   "8 : Goto Bookmark 8",
			Action: MakeGotoBookmark(8),
		},
		&Menu{
			Name:   "9 : Goto Bookmark 9",
			Action: MakeGotoBookmark(9),
		},
	},
}
View Source
var CARDS = flag.Bool("cards", false, "Preferred mode: Present numbered pages to choose what to boot.")
View Source
var Cards = make(map[int]*Card)
View Source
var CommandFuncs = make(map[string]CommandFunc)
View Source
var DEMO = flag.String("demo", "", "[demo mode] run a demo")
View Source
var Demos map[string]func(net.Conn)
View Source
var Edit_Menu = &Menu{
	Name: "Edit",
	Items: []*Menu{
		&Menu{
			Name:   "X : Cut",
			Action: &EditAction{'X'},
		},
		&Menu{
			Name:   "C : Copy",
			Action: &EditAction{'C'},
		},
		&Menu{
			Name:   "V : Paste",
			Action: &EditAction{'V'},
		},
	},
}
View Source
var FLAVOR = flag.String("flavor", "", "what flavor the server (e.g. alpha, beta, prod)")
View Source
var FS = flag.String("fs", "", "Danger: Filesystem root that can be read and written remotely")
View Source
var FlagHttpPort = flag.Int("http_port", 8080, ":port for web")
View Source
var FlagInkeyRaw = flag.String("inkey_raw", "inkey_trap.lwraw", "raw machine code fragment for HdbDos")
View Source
var FlagInputs = flag.String("inputs", "/home/pizga/public-inputs/", "serving directory for inputs to coco-shelf")
View Source
var FlagL0ModuleDirPath = flag.String("l0_module_dir", "", "[experimental] where to find commands for Level0")
View Source
var FlagNavRoot = flag.String("nav_root", "", "top of navigable tree on native filesystem")
View Source
var FlagReleases = flag.String("releases", "/home/pizga/public-releases/", "serving directory for built releases")
View Source
var FlagSideloadRaw = flag.String("sideload_raw", "sideload.lwraw", "raw machine code fragment for HdbDos")
View Source
var FlagTemp = flag.String("temp", "/home/pizga/public-temp/", "for whatever")
View Source
var FlagWebReaderPwFlipped = flag.String("web_reader_pw_flipped", "XLXL-KVYYOVH", "magic web reader pw (optional)")
View Source
var FlagWebStatic = flag.String("web_static", "", "web-static serving directory")
View Source
var ForcePage = flag.Int("force_page", 0, "Always launch this page")
View Source
var GimeText40Video = &VideoSettings{0x4C, [8]byte{0x03, 0x05, 0x12, 0x00, 0x0F, 0xD8, 0, 0}}
View Source
var GimeText80Video = &VideoSettings{0x4C, [8]byte{0x03, 0x15, 0x12, 0x00, 0x0F, 0xD8, 0, 0}}
View Source
var Go_Menu = &Menu{
	Name: "Go",
	Items: []*Menu{
		&Menu{
			Name:   "AAAAAAAAAAA",
			Action: nil,
		},
		&Menu{
			Name:   "BBBBBBBBBBBBB",
			Action: nil,
		},
		&Menu{
			Name:   "CCCCCCCCCCCCCC",
			Action: nil,
		},
	},
}
View Source
var Help_Menu = &Menu{
	Name:   "?Help",
	Action: &HelpAction{},
}
View Source
var Inodes [1024]*LMPath // Index excess 1024
View Source
var KIDSPORT = flag.Int("kidsport", 20185, "Lemma kids can connect here (for treenet)")
View Source
var KnownNodes map[string]*TreeNode // closure Parents and immediate Kids
View Source
var LEMMAN_FS = flag.String(
	"lemman_fs", "lemman_fs", "directory to use as LemMan filesystem")
View Source
var LEMMINGS_ROOT = flag.String("lemmings_root", "LEMMINGS/", "read only resource directory, for -cards mode.")
View Source
var LEVEL0 = flag.String("level0", "", "[experimental Level0 mode] level0.bin (decb) to upload")
View Source
var LMPaths = make(map[uint]*LMPath)
View Source
var LemManNames = []string{
	"Lem_UNKNOWN_ZERO",
	"Lem_Create",
	"Lem_Open",
	"Lem_MakDir",
	"Lem_ChgDir",
	"Lem_Delete",
	"Lem_Seek",
	"Lem_Read",
	"Lem_Write",
	"Lem_ReadLn",
	"Lem_WritLn",
	"Lem_GetStat",
	"Lem_SetStat",
	"Lem_Close",
}
View Source
var LogicalRamImage [0x10000]byte // capture coco image.
View Source
var MatchPathFront = regexp.MustCompile("^(/[-a-z]*)")
View Source
var ModuleMap map[string]*L0Module
View Source
var Mount_Menu = &Menu{
	Name: "Mount",
	Items: []*Menu{
		&Menu{
			Name:   "0 : Mount Drive 0",
			Action: MakeMounter(0),
		},
		&Menu{
			Name:   "1 : Mount on Drive 1",
			Action: MakeMounter(1),
		},
		&Menu{
			Name:   "2 : Mount on Drive 2",
			Action: MakeMounter(2),
		},
		&Menu{
			Name:   "3 : Mount on Drive 3",
			Action: MakeMounter(3),
		},
		&Menu{
			Name:   "4 : Mount on Drive 4",
			Action: MakeMounter(4),
		},
		&Menu{
			Name:   "5 : Mount on Drive 5",
			Action: MakeMounter(5),
		},
		&Menu{
			Name:   "6 : Mount on Drive 6",
			Action: MakeMounter(6),
		},
		&Menu{
			Name:   "7 : Mount on Drive 7",
			Action: MakeMounter(7),
		},
		&Menu{
			Name:   "8 : Mount on Drive 8",
			Action: MakeMounter(8),
		},
		&Menu{
			Name:   "9 : Mount on Drive 9",
			Action: MakeMounter(9),
		},
		&Menu{
			Name:   "Unmount All",
			Action: &UnmountAllAction{},
		},
		&Menu{
			Name:   "View Mounts",
			Action: &ViewMountsAction{},
		},
	},
}
View Source
var NAME = flag.String("name", "", "Name to use (for treenet)")
View Source
var NextInodeVar = 1024
View Source
var OpNames = []string{
	"???", "Cre", "Ope", "Mkd", "Cgd", "Del", "Sek", "Rea", "Wri", "RLn", "WLn", "Get", "Set", "Clo",
}
View Source
var PARENT = flag.String("parent", "", "Connect to a parent lemma host:port (for treenet)")
View Source
var PORT = flag.Int("port", 2321, "Listen on this TCP port (V41)")
View Source
var PRINT_VERSION = flag.Bool("version", false, "Just print protocol version")
View Source
var PROGRAM = flag.String("program", "", "[one program mode] Program to upload to COCOs")
View Source
var Pref_Menu = &Menu{
	Name: "Pref",
	Items: []*Menu{
		&Menu{
			Name:   "User Settings",
			Action: nil,
		},
		&Menu{
			Name:   "Host Settings",
			Action: nil,
		},
	},
}
View Source
var PrevLemmaError byte = LemmaErrorMin - 1
View Source
var PublicExceptions = map[string]bool{
	"/":            true,
	"/pizga":       true,
	"/pizga/Homes": true,
}
View Source
var Quik_Menu = &Menu{
	Name: "Quik",
	Items: []*Menu{
		&Menu{
			Name: "Speed Poke",
			Items: []*Menu{
				&Menu{Name: "Y : Fast 1.78 MHz", Action: &ModeAction{'S', 'Y'}},
				&Menu{Name: "N : Slow 0.9 MHz", Action: &ModeAction{'S', 'N'}},
				&Menu{Name: "R : ROM fast, rest slow", Action: &ModeAction{'S', 'R'}},
				&Menu{Name: "X : GimeX 2.86 MHz", Action: &ModeAction{'S', 'X'}},
			},
		},
		&Menu{
			Name: "Hitachi 6309 Mode",
			Items: []*Menu{
				&Menu{Name: "Y : 6309 Native Mode", Action: &ModeAction{'H', 'Y'}},
				&Menu{Name: "N : 6809 Compatability Mode", Action: &ModeAction{'H', 'N'}},
			},
		},
		&Menu{
			Name:   "Un-hijack the CLEAR Key",
			Action: &ModeAction{'U', 0},
		},
		&Menu{
			Name:   "Reboot",
			Action: &ModeAction{'R', 0},
		},
	},
}
View Source
var SCAN_KEYBOARD = flag.Bool("scan_keyboard", true, "flag flip for CMD_KEYBOARD (to detect SHIFT, etc)")
View Source
var SetBookmark_Menu = &Menu{
	Items: []*Menu{
		&Menu{
			Name:   "0 : Set Bookmark 0",
			Action: MakeSetBookmark(0),
		},
		&Menu{
			Name:   "1 : Set Bookmark 1",
			Action: MakeSetBookmark(1),
		},
		&Menu{
			Name:   "2 : Set Bookmark 2",
			Action: MakeSetBookmark(2),
		},
		&Menu{
			Name:   "3 : Set Bookmark 3",
			Action: MakeSetBookmark(3),
		},
		&Menu{
			Name:   "4 : Set Bookmark 4",
			Action: MakeSetBookmark(4),
		},
		&Menu{
			Name:   "5 : Set Bookmark 5",
			Action: MakeSetBookmark(5),
		},
		&Menu{
			Name:   "6 : Set Bookmark 6",
			Action: MakeSetBookmark(6),
		},
		&Menu{
			Name:   "7 : Set Bookmark 7",
			Action: MakeSetBookmark(7),
		},
		&Menu{
			Name:   "8 : Set Bookmark 8",
			Action: MakeSetBookmark(8),
		},
		&Menu{
			Name:   "9 : Set Bookmark 9",
			Action: MakeSetBookmark(9),
		},
	},
}
View Source
var SlashPage []byte
View Source
var TESTHOST = flag.String("testhost", "", "Host that runs tests")
View Source
var TopMenu = &Menu{
	Name: "",
	Items: []*Menu{
		View_Menu,
		Edit_Menu,
		Quik_Menu,

		Mount_Menu,
		Book_Menu,

		Help_Menu,
	},
}
View Source
var VdgText32Video = &VideoSettings{0xCC, [8]byte{0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0, 0}}
View Source
var View_Menu = &Menu{
	Name: "View",
	Items: []*Menu{
		&Menu{
			Name:   "Info",
			Action: &ViewInfoAction{},
		},
		&Menu{
			Name:   "Text View",
			Action: &ViewTextAction{},
		},
		&Menu{
			Name:   "Hex View",
			Action: &ViewHexAction{},
		},
	},
}

Functions

func Add

func Add(num int, parent int, name string, tc *Card)

func AlterTask0Map37To2000ReturnSaved

func AlterTask0Map37To2000ReturnSaved(ses *Session, payload []byte) byte

func AsciiToInjectBytes

func AsciiToInjectBytes(s string) []byte

func AttemptToLoadModule

func AttemptToLoadModule(filename string)

func BeginMux

func BeginMux(ses *Session, p uint, pay []byte)

func Bold

func Bold(s string) string

func BoldInt

func BoldInt(x int) string

func CanAccess

func CanAccess(principals []string, path string, toWrite bool) bool

func CanAccess1

func CanAccess1(prin string, path string, toWrite bool) bool

func Catch

func Catch(label string, fn func()) (err string)

func CheckSum16Ram

func CheckSum16Ram(conn net.Conn, addr uint, n uint) uint

func Chop

func Chop(t T.TextScreen, line string) (lines []string)

func ContinueLongLines

func ContinueLongLines(t T.TextScreen, lines []string) (result []string)

func CopyFile

func CopyFile(src, dest string) error

func CopyTcp

func CopyTcp(onFinish chan bool, r, w net.Conn, what string)

func CreateHomeIfNeeded

func CreateHomeIfNeeded(ses *Session) (string, string, string)

func DescribeVideoModes

func DescribeVideoModes(page0 []byte) (str string, byt []byte)

func DoLemMan

func DoLemMan(conn net.Conn, in []byte, pd uint) []byte

func DrawBoxed

func DrawBoxed(t T.TextScreen, x, y uint, lines []string, invertHeadChar bool)

func DrawFullScreenLines

func DrawFullScreenLines(t T.TextScreen, lines []string, title string)

func DuplicateFileToTemp

func DuplicateFileToTemp(filename string, startup string) *os.File

func EchoCommand

func EchoCommand(o *Proc) string

func EmptyDecbInitializedDiskImage

func EmptyDecbInitializedDiskImage() []byte

func EndMux

func EndMux(ses *Session, p uint, pay []byte)

func ErrorAlert

func ErrorAlert(t T.TextScreen, lines []string)

func ErrorAlertChop

func ErrorAlertChop(t T.TextScreen, line string)

func ExtractName

func ExtractName(bb []byte, i uint, filename string) string

func Flip13

func Flip13(a string) string

tr A-Za-z ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba

func Flip13AfterFlipMark

func Flip13AfterFlipMark(a string) string

func Flip13Filepath

func Flip13Filepath(a string) string

func GetBCommand

func GetBCommand(o *Proc) string

func GetBlockDevice

func GetBlockDevice(ses *Session) *os.File

func GetHellos

func GetHellos(conn net.Conn) map[uint][]byte

func GetSerial

func GetSerial() int

func GetTCommand

func GetTCommand(o *Proc) string

func GimeText40x24_OnPage37_ReturnNumRows

func GimeText40x24_OnPage37_ReturnNumRows(ses *Session, payload []byte, extraVerticalGap byte) int

extraVerticalGap may be 0, 1, 2, or 3. Returns number of full rows visibile, up to 24.

func HdbDosHijack

func HdbDosHijack(ses *Session, payload []byte)

Entry from waiter.go for a Hijack.

func HdbDosSector

func HdbDosSector(ses *Session, payload []byte)

Entry from waiter.go for a Sector.

func HelpCommand

func HelpCommand(o *Proc) string

func HitachiMode

func HitachiMode(com *coms.Comm, native bool)

func InitDemos

func InitDemos()

func Inject

func Inject(ses *Session, sideload []byte, dest uint, exec bool, payload []byte)

func L0Init

func L0Init()

func LMChgDir

func LMChgDir(pd uint, regs *LMRegs) (status byte)

func LMClose

func LMClose(pd uint, regs *LMRegs) (status byte)

func LMDelete

func LMDelete(pd uint, regs *LMRegs, name string) (status byte)

func LMGetStt

func LMGetStt(pd uint, regs *LMRegs) (payload []byte, status byte)

func LMOpen

func LMOpen(pd uint, regs *LMRegs, mode byte, name string, create bool) (status byte)

func LMRead

func LMRead(pd uint, regs *LMRegs, linely bool) (payload []byte, status byte)

func LMSeek

func LMSeek(pd uint, regs *LMRegs) (status byte)

func LMWrite

func LMWrite(pd uint, regs *LMRegs, pay_in []byte, linely bool) (status byte)

func LemManCommandName

func LemManCommandName(b byte) string

func LemmaError

func LemmaError(format string, args ...any) byte

func Level0Control

func Level0Control(conn net.Conn, ses *Session)

func Listen

func Listen()

func MidMux

func MidMux(ses *Session, p uint, pay []byte)

func NewDriveTempName

func NewDriveTempName(drive uint) string

func NextInode

func NextInode() int

func NonduplicatingDuplicateFileToTemp

func NonduplicatingDuplicateFileToTemp(filename string) *os.File

func OnText40At2000Run

func OnText40At2000Run(ses *Session, payload []byte, runMe func())

func OnTextVDGAt0400Run

func OnTextVDGAt0400Run(ses *Session, payload []byte, runMe func())

func Peek

func Peek(conn net.Conn, addr uint, n uint) []byte

func Peek2Ram

func Peek2Ram(conn net.Conn, addr uint, n uint) []byte

func PeekPage0

func PeekPage0(ses *Session) []byte

func PeekRam

func PeekRam(conn net.Conn, addr uint, n uint) []byte

func PokeRam

func PokeRam(conn net.Conn, addr uint, data []byte)

func PutTCommand

func PutTCommand(o *Proc) string

func ReadFive

func ReadFive(conn net.Conn) (cmd byte, n uint, p uint)

func ReadFiveLoop

func ReadFiveLoop(conn net.Conn, ses *Session)

func ReadN

func ReadN(conn net.Conn, n uint) []byte

func Reboot

func Reboot(com *coms.Comm)

func RecolorMenuBar

func RecolorMenuBar(t T.TextScreen, group *Menu, chosen *Menu)

func ReconnectPort

func ReconnectPort(ses *Session, port int)

func RegsString

func RegsString(b []byte) string

func Rot13

func Rot13(a string) string

tr A-Za-z N-ZA-Mn-za-m

func RunCards

func RunCards(ses *Session) (notice string)

func RunWeb

func RunWeb()

func ScanKeyboard

func ScanKeyboard(conn net.Conn) (keybits [8]byte)

func SeekSectorReturnLSN

func SeekSectorReturnLSN(block *os.File, n uint, p uint) int64

func SendInitialInjections

func SendInitialInjections(ses *Session)

func Serve

func Serve(conn net.Conn)

func SetVideoMode

func SetVideoMode(ses *Session, hrmode, hrwidth, pmode byte)

func ShortTimestamp

func ShortTimestamp() string

func SpeedMode

func SpeedMode(com *coms.Comm, value byte)

func SplitTextAsLines

func SplitTextAsLines(text []byte) (lines []string)

func TestCharRow40

func TestCharRow40(nthRow byte) []byte

func TextChooserShell

func TextChooserShell(com *coms.Comm, ds *DriveSession, t T.TextScreen)

called by hdbdos HdbDosHijack

func TimeVector

func TimeVector(t time.Time) []byte

func Timestamp

func Timestamp() string

func TruePath

func TruePath(pizgaPath string) string

func UnHijack

func UnHijack(com *coms.Comm)

func UndoAlterTask0

func UndoAlterTask0(ses *Session, saved byte)

func Up

func Up(x byte) byte

func UploadProgram

func UploadProgram(conn net.Conn, filename string)

func UpperCleanName

func UpperCleanName(s []byte, maxLen int) string

func VerticalEchoCommand

func VerticalEchoCommand(o *Proc) string

func VideoModes

func VideoModes(page0 []byte) (hrmode, hrwidth, pmode byte)

func ViewBoxedLines

func ViewBoxedLines(t T.TextScreen, lines []string, color byte)

func ViewBoxedText

func ViewBoxedText(t T.TextScreen, text []byte, color byte)

func ViewFullScreenLines

func ViewFullScreenLines(t T.TextScreen, lines []string, color byte)

func ViewFullScreenText

func ViewFullScreenText(t T.TextScreen, text []byte, color byte)

func WaitForBreak

func WaitForBreak(t T.TextScreen)

WaitForBreak also allows SPACE.

func WriteFive

func WriteFive(conn net.Conn, cmd byte, n uint, p uint)

Types

type Alert

type Alert struct {
	Summary string
	Text    string
	ID      int
	Created time.Time
	Expires time.Time
}

type BaseModel

type BaseModel struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(path string, why string) *BaseModel

func (*BaseModel) Decoration

func (mod *BaseModel) Decoration(ds *DriveSession) string

func (*BaseModel) Hot

func (mod *BaseModel) Hot() bool

func (*BaseModel) KidAtFocus

func (mod *BaseModel) KidAtFocus(focus uint) Model

KidAtFocus understands 0->parent; 1->this; 2.. are kids.

func (*BaseModel) Kids

func (mod *BaseModel) Kids() []Model

func (*BaseModel) Name

func (mod *BaseModel) Name() string

func (mod *BaseModel) Order() int { return mod.order }

func (*BaseModel) Parent

func (mod *BaseModel) Parent() Model

func (*BaseModel) Path

func (mod *BaseModel) Path() string

func (*BaseModel) ReKids

func (mod *BaseModel) ReKids() []Model

func (*BaseModel) ShowMenus

func (mod *BaseModel) ShowMenus() *Menu

func (*BaseModel) Size

func (mod *BaseModel) Size() int64

func (*BaseModel) String

func (mod *BaseModel) String() string

func (*BaseModel) UnixPath

func (mod *BaseModel) UnixPath() string

type Card

type Card struct {
	Num  int
	Name string
	Moms []int
	Kids map[int]*Card

	Text     string
	Template *template.Template

	ReconnectPort int
	Launch        string
	Block0        string
	Block1        string
}

type CommandFunc

type CommandFunc func(*Proc) string

type DriveImage

type DriveImage struct {
	Path              string
	Image             []byte
	Dirty             bool
	CreationTimestamp string
}

func (*DriveImage) GoString

func (di *DriveImage) GoString() string

func (*DriveImage) String

func (di *DriveImage) String() string

type DriveSession

type DriveSession struct {
	// contains filtered or unexported fields
}

func NewDriveSession

func NewDriveSession(ses *Session, com *coms.Comm, home, retain, trash string) *DriveSession

func (*DriveSession) CreateEmptyDriveImageAtIfNeeded

func (ds *DriveSession) CreateEmptyDriveImageAtIfNeeded(nth byte) *DriveImage

func (*DriveSession) HdbDosCleanup

func (ds *DriveSession) HdbDosCleanup()

func (*DriveSession) HdbDosCleanupOneDrive

func (ds *DriveSession) HdbDosCleanupOneDrive(driveNum byte)

func (*DriveSession) IsModelMounted

func (ds *DriveSession) IsModelMounted(c Model) (drive byte, ok bool)

func (*DriveSession) SetDrive

func (ds *DriveSession) SetDrive(nth byte, c Model)

func (*DriveSession) String

func (ds *DriveSession) String() string

type EditAction

type EditAction struct {
	What byte
}

func (*EditAction) Do

func (o *EditAction) Do(nav *Navigator, mod Model, path string)

func (*EditAction) String

func (o *EditAction) String(nav *Navigator, mod Model, path string) string

func (*EditAction) Undo

func (o *EditAction) Undo(nav *Navigator, mod Model, path string)

type GotoBookmarkAction

type GotoBookmarkAction struct {
	N byte
}

func (*GotoBookmarkAction) Do

func (o *GotoBookmarkAction) Do(nav *Navigator, mod Model, path string)

func (*GotoBookmarkAction) String

func (o *GotoBookmarkAction) String(nav *Navigator, mod Model, path string) string

func (*GotoBookmarkAction) Undo

func (o *GotoBookmarkAction) Undo(nav *Navigator, mod Model, path string)

type HdbDosSession

type HdbDosSession struct {
	Ses      *Session
	NumReads int64 // When 1, send injections.

	DriveSession *DriveSession
}

type HelpAction

type HelpAction struct {
}

func (*HelpAction) Do

func (o *HelpAction) Do(nav *Navigator, mod Model, path string)

func (*HelpAction) String

func (o *HelpAction) String(nav *Navigator, mod Model, path string) string

func (*HelpAction) Undo

func (o *HelpAction) Undo(nav *Navigator, mod Model, path string)

type IScreen

type IScreen interface {
	Clear()
	PutChar(ch byte)
	PutStr(s string)
	Flush()
}

type L0File

type L0File struct {
	// contains filtered or unexported fields
}

type L0Module

type L0Module struct {
	// contains filtered or unexported fields
}

func FindModule

func FindModule(name string) (*L0Module, error)

func (L0Module) Attr

func (m L0Module) Attr() byte

func (L0Module) DataSize

func (m L0Module) DataSize() uint

func (L0Module) Exec

func (m L0Module) Exec() uint

func (L0Module) Kind

func (m L0Module) Kind() byte

func (L0Module) Lang

func (m L0Module) Lang() byte

func (L0Module) Rev

func (m L0Module) Rev() byte

type L0Proc

type L0Proc struct {
	// contains filtered or unexported fields
}

func Launch

func Launch(conn net.Conn, module string, params string, parent *L0Proc) (*L0Proc, error)

type LMPath

type LMPath struct {
	PathName   string
	Mode       byte
	IsDir      bool
	Offset     int64
	Size       int64
	DirEntries []os.DirEntry
	DirData    []byte
	// contains filtered or unexported fields
}

type LMRegs

type LMRegs struct {
	// contains filtered or unexported fields
}

func NewLMRegs

func NewLMRegs(in []byte) *LMRegs

func (LMRegs) WriteBytes

func (r LMRegs) WriteBytes(to *bytes.Buffer)

type LemmaHandler

type LemmaHandler struct {
	NavRoot  string
	Handlers map[string]http.Handler
}

func (*LemmaHandler) ServeHTTP

func (lh *LemmaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LineBuf

type LineBuf struct {
	Ses *Session
}

func (*LineBuf) GetLine

func (lb *LineBuf) GetLine() string
type Menu struct {
	Name   string // first char is shortcut
	Items  []*Menu
	Action MenuAction
}
func (m *Menu) Lines() (lines []string)
func (m *Menu) Shortcut() byte
type MenuAction interface {
	Do(nav *Navigator, mod Model, path string)
	Undo(nav *Navigator, mod Model, path string)
	String(nav *Navigator, mod Model, path string) string
}

func MakeGotoBookmark

func MakeGotoBookmark(n byte) MenuAction

func MakeMounter

func MakeMounter(n byte) MenuAction

func MakeSetBookmark

func MakeSetBookmark(n byte) MenuAction
type MenuActionHistory struct {
	History []*MenuAction
}

type ModeAction

type ModeAction struct {
	What  byte
	Value byte
}

func (*ModeAction) Do

func (o *ModeAction) Do(nav *Navigator, mod Model, path string)

func (*ModeAction) String

func (o *ModeAction) String(nav *Navigator, mod Model, path string) string

func (*ModeAction) Undo

func (o *ModeAction) Undo(nav *Navigator, mod Model, path string)

type Model

type Model interface {
	//Order() int
	Path() string
	Name() string
	Kids() []Model
	ReKids() []Model
	Parent() Model
	Decoration(ds *DriveSession) string
	KidAtFocus(focus uint) Model
	ShowMenus() *Menu
	Hot() bool // turn ENTER or -> into Action.
	Size() int64
}

type MountAction

type MountAction struct {
	N byte
}

func (*MountAction) Do

func (o *MountAction) Do(nav *Navigator, mod Model, path string)

func (*MountAction) String

func (o *MountAction) String(nav *Navigator, mod Model, path string) string

func (*MountAction) Undo

func (o *MountAction) Undo(nav *Navigator, mod Model, path string)
type Navigator struct {
	Bookmarks [10]string
	GotoPath  string

	CutPath     string
	HoldingPath string
	// contains filtered or unexported fields
}
func (nav *Navigator) ClearScreen()
func (nav *Navigator) Confirm(s string) bool
func (nav *Navigator) DoAction(chosen *Menu, c Model, focus uint, boxX, boxY uint)
func (t *Navigator) Loop()
func (nav *Navigator) NavStep(c Model) Model
func (nav *Navigator) Render(mod Model, focus uint)
func (nav *Navigator) TryMenu(menu *Menu, c Model, focus uint, ch byte)

Returns true if the input char ch is consumed. If returns false, you can look elsewhere for a handler.

type NumStr

type NumStr struct {
	Num int
	Str string
}

type NumStrSlice

type NumStrSlice []NumStr

func (NumStrSlice) Len

func (o NumStrSlice) Len() int

func (NumStrSlice) Less

func (o NumStrSlice) Less(i, j int) bool

func (NumStrSlice) Swap

func (o NumStrSlice) Swap(i, j int)

type Proc

type Proc struct {
	Command string
	Argv    []string
	Ses     *Session
	Channel uint

	InPacket chan TaggedBytes
}

func (*Proc) CocoClose

func (o *Proc) CocoClose()

func (*Proc) CocoCreate

func (o *Proc) CocoCreate(filename string)

func (*Proc) CocoError

func (o *Proc) CocoError(message string)

func (*Proc) CocoOpen

func (o *Proc) CocoOpen(filename string)

func (*Proc) Exit3

func (o *Proc) Exit3(verdict string)

func (*Proc) LowGetOne

func (o *Proc) LowGetOne(expected byte) []byte

func (*Proc) LowPutOne

func (o *Proc) LowPutOne(q coms.Quint, args ...any)

func (*Proc) PrintfStderr

func (o *Proc) PrintfStderr(format string, args ...any)

func (*Proc) Read

func (o *Proc) Read(buf []byte)

func (*Proc) ReadLine

func (o *Proc) ReadLine() string

func (*Proc) RunCommandFunc

func (o *Proc) RunCommandFunc(fn CommandFunc)

func (*Proc) WriteBytes

func (o *Proc) WriteBytes(buf []byte)

func (*Proc) WriteLine

func (o *Proc) WriteLine(line string)

type Regs6809

type Regs6809 struct {
	CC byte
	D  word
	DP byte
	X  word
	Y  word
	U  word
	PC word // S starts here for RTI.
	S  word // Not consumed by RTI.
	Z  word // Extra padding for 16 bytes (used for temp PC).
}

type Session

type Session struct {
	ID        int
	Conn      net.Conn
	IScreen   IScreen
	LineBuf   *LineBuf
	Hostname  string
	RomID     []byte
	AxiomVars []byte
	Hellos    map[uint][]byte

	Block0 *os.File
	Block1 *os.File

	Procs map[uint]*Proc // mux.go

	HdbDos *HdbDosSession

	Cleanups []func()

	InitGimeRegs  []byte
	BasicGimeRegs []byte

	T T.TextScreen
}

func NewSession

func NewSession(conn net.Conn, hostname string) *Session

func (*Session) ReplyOnChannel

func (ses *Session) ReplyOnChannel(cmd byte, p uint, pay []byte)

func (*Session) String

func (ses *Session) String() string

type SetBookmarkAction

type SetBookmarkAction struct {
	N byte
}

func (*SetBookmarkAction) Do

func (o *SetBookmarkAction) Do(nav *Navigator, mod Model, path string)

func (*SetBookmarkAction) String

func (o *SetBookmarkAction) String(nav *Navigator, mod Model, path string) string

func (*SetBookmarkAction) Undo

func (o *SetBookmarkAction) Undo(nav *Navigator, mod Model, path string)

type SlashHandler

type SlashHandler struct {
}

func (*SlashHandler) ServeHTTP

func (sh *SlashHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TaggedBytes

type TaggedBytes struct {
	Tag   byte
	Bytes []byte
}

type TreeNode

type TreeNode struct {
	Serial  int
	Version int
	Flags   []byte
	Host    string
	Mac     [5]byte
	Secret  []byte

	Parent *TreeNode
	Kids   map[string]*TreeNode

	User   string
	Groups []string
	Where  *TreeNode // which host authenticated User & Group namespace

	FanMax    int
	ZeroNet   int
	ZeroSlots int
}

type UnmountAllAction

type UnmountAllAction struct {
}

func (*UnmountAllAction) Do

func (o *UnmountAllAction) Do(nav *Navigator, mod Model, path string)

func (*UnmountAllAction) String

func (o *UnmountAllAction) String(nav *Navigator, mod Model, path string) string

func (*UnmountAllAction) Undo

func (o *UnmountAllAction) Undo(nav *Navigator, mod Model, path string)

type VideoSettings

type VideoSettings struct {
	Major byte
	Minor [8]byte
}

func (*VideoSettings) Flush

func (vs *VideoSettings) Flush(ses *Session)

type ViewBookmarksAction

type ViewBookmarksAction struct {
}

func (*ViewBookmarksAction) Do

func (o *ViewBookmarksAction) Do(nav *Navigator, mod Model, path string)

func (*ViewBookmarksAction) String

func (o *ViewBookmarksAction) String(nav *Navigator, mod Model, path string) string

func (*ViewBookmarksAction) Undo

func (o *ViewBookmarksAction) Undo(nav *Navigator, mod Model, path string)

type ViewHexAction

type ViewHexAction struct {
}

func (*ViewHexAction) Do

func (o *ViewHexAction) Do(nav *Navigator, mod Model, path string)

func (*ViewHexAction) String

func (o *ViewHexAction) String(nav *Navigator, mod Model, path string) string

func (*ViewHexAction) Undo

func (o *ViewHexAction) Undo(nav *Navigator, mod Model, path string)

type ViewInfoAction

type ViewInfoAction struct {
}

func (*ViewInfoAction) Do

func (o *ViewInfoAction) Do(nav *Navigator, mod Model, path string)

func (*ViewInfoAction) String

func (o *ViewInfoAction) String(nav *Navigator, mod Model, path string) string

func (*ViewInfoAction) Undo

func (o *ViewInfoAction) Undo(nav *Navigator, mod Model, path string)

type ViewMountsAction

type ViewMountsAction struct {
}

func (*ViewMountsAction) Do

func (o *ViewMountsAction) Do(nav *Navigator, mod Model, path string)

func (*ViewMountsAction) String

func (o *ViewMountsAction) String(nav *Navigator, mod Model, path string) string

func (*ViewMountsAction) Undo

func (o *ViewMountsAction) Undo(nav *Navigator, mod Model, path string)

type ViewTextAction

type ViewTextAction struct {
}

func (*ViewTextAction) Do

func (o *ViewTextAction) Do(nav *Navigator, mod Model, path string)

func (*ViewTextAction) String

func (o *ViewTextAction) String(nav *Navigator, mod Model, path string) string

func (*ViewTextAction) Undo

func (o *ViewTextAction) Undo(nav *Navigator, mod Model, path string)

type XTextScreen

type XTextScreen struct {
	B         []byte // screen RAM not yet sent.
	W, H      int    // screen dimensions
	P         int    // cursor
	Addr      int
	Majuscule bool // Use 0..63
	Ses       *Session
}

TODO: convert to new Screen. TODO: requires dealing with LineBuf::GetLine this one depends on CMD_PUTCHAR.

func NewTextScreen

func NewTextScreen(ses *Session, w, h int, addr int) *XTextScreen

func (*XTextScreen) Clear

func (t *XTextScreen) Clear()

func (*XTextScreen) Flush

func (t *XTextScreen) Flush()

func (*XTextScreen) PutChar

func (t *XTextScreen) PutChar(ch byte)

func (*XTextScreen) PutStr

func (ax *XTextScreen) PutStr(s string)

Directories

Path Synopsis
cli
Package skiplist implement skip list data structure.
Package skiplist implement skip list data structure.
strdy (pronounced "sturdy") is a database for holding a string-to-string map.
strdy (pronounced "sturdy") is a database for holding a string-to-string map.
This file was generated by scrape_os9_symbols
This file was generated by scrape_os9_symbols

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL