devices

package
v0.0.0-...-b5de531 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusT

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

BusT holds the system bus and all its associated devices

func (*BusT) AddDevice

func (bus *BusT) AddDevice(devMap DeviceMapT, devNum int, att bool)

AddDevice adds a new device to the system bus

func (*BusT) BusInit

func (bus *BusT) BusInit()

BusInit must be called before attaching any devices

func (*BusT) ClearInterrupt

func (bus *BusT) ClearInterrupt(devNum int)

ClearInterrupt clears the IRQ for the given device

func (*BusT) DataIn

func (bus *BusT) DataIn(devNum int, abc byte, flag byte) (datum dg.WordT)

DataIn forwards a Data In command to the given device

func (*BusT) DataOut

func (bus *BusT) DataOut(devNum int, datum dg.WordT, abc byte, flag byte)

DataOut forwards a Data Out command to the given device

func (*BusT) GetBusy

func (bus *BusT) GetBusy(devNum int) bool

GetBusy returns a device's BUSY flag

func (*BusT) GetDone

func (bus *BusT) GetDone(devNum int) bool

GetDone returns a device's DONE flag

func (*BusT) GetHighestPriorityInt

func (bus *BusT) GetHighestPriorityInt() (devNum int)

GetHighestPriorityInt returns the device number of the highest priority device that has an outstanding interrupt

func (*BusT) GetIRQ

func (bus *BusT) GetIRQ() bool

GetIRQ is a getter for IRQ

func (*BusT) GetPrintableDevList

func (bus *BusT) GetPrintableDevList() string

GetPrintableDevList is used by the console SHOW DEV command to display device statuses

func (*BusT) IsAttached

func (bus *BusT) IsAttached(devNum int) bool

IsAttached returns the attached state of the given device

func (*BusT) IsBootable

func (bus *BusT) IsBootable(devNum int) bool

IsBootable returns true if the device can be booted from It is is not a guarantee that it WILL boot!

func (*BusT) IsDevMasked

func (bus *BusT) IsDevMasked(devNum int) (masked bool)

IsDevMasked is a getter to see if the device is masked out from sending IRQs

func (*BusT) IsIODevice

func (bus *BusT) IsIODevice(devNum int) bool

IsIODevice returns true if this is an IO device

func (*BusT) ResetAllIODevices

func (bus *BusT) ResetAllIODevices()

ResetAllIODevices calls the Reset func for each I/O device

func (*BusT) ResetDevice

func (bus *BusT) ResetDevice(devNum int)

ResetDevice forwards a Reset to the given device

func (*BusT) SendInterrupt

func (bus *BusT) SendInterrupt(devNum int)

SendInterrupt triggers an IRQ for the given device

func (*BusT) SetAttached

func (bus *BusT) SetAttached(devNum int, imgName string)

SetAttached sets the MV/Em Attached flag for a device indicating the virtual device is attached to a host image file

func (*BusT) SetBusy

func (bus *BusT) SetBusy(devNum int, f bool)

SetBusy sets/clears the given device's BUSY flag

func (*BusT) SetDataInFunc

func (bus *BusT) SetDataInFunc(devNum int, fn DataInFunc)

SetDataInFunc sets the Data In callback fror the given device

func (*BusT) SetDataOutFunc

func (bus *BusT) SetDataOutFunc(devNum int, fn DataOutFunc)

SetDataOutFunc sets the Data Out callback fror the given device

func (*BusT) SetDetached

func (bus *BusT) SetDetached(devNum int)

SetDetached clears the MV/Em Attached flag for a device

func (*BusT) SetDone

func (bus *BusT) SetDone(devNum int, f bool)

SetDone sets/clears the given device#s DONE flag

func (*BusT) SetIRQ

func (bus *BusT) SetIRQ(i bool)

SetIRQ is a getter for IRQ

func (*BusT) SetIrqMask

func (bus *BusT) SetIrqMask(newMask dg.WordT)

SetIrqMask is a setter for the (whole) IRQ mask

func (*BusT) SetResetFunc

func (bus *BusT) SetResetFunc(devNum int, resetFn ResetFunc)

SetResetFunc sets the device reset callback for the given device

type DataInFunc

type DataInFunc func(abc byte, flag byte) (datum dg.WordT)

DataInFunc stores a DIx func pointer

type DataOutFunc

type DataOutFunc func(datum dg.WordT, abc byte, flag byte)

DataOutFunc stores a DOx func pointer

type DeviceDesc

type DeviceDesc struct {
	DgMnemonic string
	PMB        uint // Priority Mask Bit number
	IsIO       bool
	IsBootable bool
}

DeviceDesc holds basic config info for a device, a VM will have a map of these to describe its known devices

type DeviceMapT

type DeviceMapT map[int]DeviceDesc

DeviceMapT describes the Device Map used by each VM

type Disk4231aStatT

type Disk4231aStatT struct {
	ImageAttached bool
	Cylinder      dg.WordT
	Head, Sector  uint8
	Reads, Writes uint64
}

Disk4231aStatT holds the data reported to the status collector

type Disk4231aT

type Disk4231aT struct {
	ImageAttached bool
	// contains filtered or unexported fields
}

Disk4231aT holds the current state of the Type-6231A Moving-Head Disk

func (*Disk4231aT) Disk4231aAttach

func (disk *Disk4231aT) Disk4231aAttach(dNum int, imgName string) bool

Disk4231aAttach attempts to attach an extant 4231a disk image to the running emulator

func (*Disk4231aT) Disk4231aCreateBlank

func (disk *Disk4231aT) Disk4231aCreateBlank(imgName string) bool

Disk4231aCreateBlank creates an empty disk file of the correct size for the disk4231a emulator to use

func (*Disk4231aT) Disk4231aInit

func (disk *Disk4231aT) Disk4231aInit(dev int, bus *BusT, statsChann chan Disk4231aStatT, logID int, logging bool)

Disk4231aInit must be called to initialise the emulated disk4231a controller

func (*Disk4231aT) Disk4231aLoadDKBT

func (disk *Disk4231aT) Disk4231aLoadDKBT()

Disk4231aLoadDKBT - This func mimics a ROM routine to boot from disk. Rather than copying a ROM routine (!) we simply mimic its basic actions... Load 1st block from disk into location 0

type Disk6061StatT

type Disk6061StatT struct {
	ImageAttached bool
	Cylinder      dg.WordT
	Head, Sector  uint8
	Reads, Writes uint64
}

Disk6061StatT holds the data reported to the status collector

type Disk6061T

type Disk6061T struct {
	ImageAttached bool
	// contains filtered or unexported fields
}

Disk6061T holds the current state of a Type 6061 Moving-Head Disk

func (*Disk6061T) Disk6061Attach

func (disk *Disk6061T) Disk6061Attach(dNum int, imgName string) bool

Disk6061Attach attempts to attach an extant 6061 disk image to the running emulator

func (*Disk6061T) Disk6061CreateBlank

func (disk *Disk6061T) Disk6061CreateBlank(imgName string) bool

Disk6061CreateBlank creates an empty disk file of the correct size for the disk6061 emulator to use

func (*Disk6061T) Disk6061Init

func (disk *Disk6061T) Disk6061Init(dev int, bus *BusT, statsChann chan Disk6061StatT, logID int, logging bool)

Disk6061Init must be called to initialise the emulated disk6061 controller

func (*Disk6061T) Disk6061LoadDKBT

func (disk *Disk6061T) Disk6061LoadDKBT()

Disk6061LoadDKBT - This func mimics a system ROM routine to boot from disk. Rather than copying a ROM routine (!) we simply mimic its basic actions... Load 1st block from disk into location 0

func (*Disk6061T) Disk6061SetLogging

func (disk *Disk6061T) Disk6061SetLogging(log bool)

Disk6061SetLogging sets the disk's internal; debug logging flag as specified N.B. The disk runs slower with this set.

type Disk6239DataT

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

Disk6239DataT holds the current state of a Type 6239 Disk

func (*Disk6239DataT) Disk6239Attach

func (disk *Disk6239DataT) Disk6239Attach(dNum int, imgName string) bool

Disk6239Attach attempts to attach an extant MV/Em disk image to the running emulator

func (*Disk6239DataT) Disk6239CreateBlank

func (disk *Disk6239DataT) Disk6239CreateBlank(imgName string) bool

Disk6239CreateBlank - Create an empty disk file of the correct size for the disk6239 emulator to use

func (*Disk6239DataT) Disk6239Init

func (disk *Disk6239DataT) Disk6239Init(dev int, bus *BusT, statsChann chan Disk6239StatT, logID int, logging bool)

Disk6239Init is called once by the main routine to initialise this disk6239 emulator

func (*Disk6239DataT) Disk6239LoadDKBT

func (disk *Disk6239DataT) Disk6239LoadDKBT()

Disk6239LoadDKBT fakes a system ROM routine to boot from this disk.

func (*Disk6239DataT) Disk6239SetLogging

func (disk *Disk6239DataT) Disk6239SetLogging(debug bool)

Disk6239SetLogging sets the internal debugging/logging flag according to the passed value N.B. The disk will run slower when this is set.

type Disk6239StatT

type Disk6239StatT struct {
	ImageAttached                      bool
	StatusRegA, StatusRegB, StatusRegC dg.WordT
	//	cylinder, head, sector             dg_word
	SectorNo      dg.DwordT
	Reads, Writes uint64
}

Disk6239StatT holds the near real-time status for this device

type MagTape6026T

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

MagTape6026T contains the current state of a type 6026 Magnetic Tape Drive

func (*MagTape6026T) MtAttach

func (tape *MagTape6026T) MtAttach(tNum int, imgName string) bool

MtAttach attaches a SimH tape image file to the emulated tape drive

func (*MagTape6026T) MtDetach

func (tape *MagTape6026T) MtDetach(tNum int) bool

MtDetach disassociates a tape file image from the drive

func (*MagTape6026T) MtInit

func (tape *MagTape6026T) MtInit(dev int, bus *BusT, statsChan chan MtStatT, logID int, debugLogging bool) bool

MtInit sets the initial state of the (unmounted) tape drive(s)

func (*MagTape6026T) MtLoadTBoot

func (tape *MagTape6026T) MtLoadTBoot()

MtLoadTBoot - This function fakes the ROM/SCP boot-from-tape routine. Rather than copying a ROM and executing that, we simply mimic its basic actions.. Load file 0 from tape (1 x 2k block) Put the loaded code at physical location 0 ...

func (*MagTape6026T) MtReset

func (tape *MagTape6026T) MtReset()

MtReset Resets the mt to known state (any tapes are rewound)

func (*MagTape6026T) MtScanImage

func (tape *MagTape6026T) MtScanImage(tNum int) string

MtScanImage scans an attached SimH tape image to ensure it makes sense (This is just a pass-through to the equivalent function in simhtape)

type MtStatT

type MtStatT struct {
	// Internals
	ImageAttached [maxTapes]bool
	FileName      [maxTapes]string
	// DG device state
	MemAddrReg             dg.PhysAddrT
	CurrentCmd             int
	StatusReg1, StatusReg2 dg.WordT
}

MtStatT holds data for the status collector

type ResetFunc

type ResetFunc func()

ResetFunc stores an I/O reset func pointer

type TtiT

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

TtiT describes the current state of the TTI device

func (*TtiT) Init

func (tti *TtiT) Init(dev int, bus *BusT)

Init performs iniial setup of the TTI device

func (*TtiT) InsertChar

func (tti *TtiT) InsertChar(c byte)

InsertChar places one byte in the TTI buffer for handling by the CPU

type TtoT

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

TtoT describes the current state of the TTO device

func (*TtoT) Init

func (tto *TtoT) Init(dev int, bus *BusT, c net.Conn)

Init performs iniial setup of the TTO device

func (*TtoT) PutChar

func (tto *TtoT) PutChar(c byte)

PutChar outputs a single byte to TTO

func (*TtoT) PutNLString

func (tto *TtoT) PutNLString(s string)

PutNLString outputs a NL followed by a string to TTO

func (*TtoT) PutString

func (tto *TtoT) PutString(s string)

PutString outputs a string to TTO (no NL appended)

func (*TtoT) PutStringNL

func (tto *TtoT) PutStringNL(s string)

PutStringNL outputs a string followed by a NL to TTO

func (*TtoT) Reset

func (tto *TtoT) Reset()

Reset simply clears the screen or throws a page

Jump to

Keyboard shortcuts

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