**tmux Support for Linux**
The `run` script with `cos_117.cfg` spawns xterms for consoles, which works well on desktops but not on VPS/servers without X forwarding or for users preferring SSH/shell/mosh.
To resolve, this commit adds tmux support via:
+ run_tmux - Script that manages a cray simulator session.
+ cos_117_tmux.cfg - Modified config that spawns tmux windows instead of xterms.
Benefits:
- Organizes cray simulator and consoles as tmux windows in a tmux session.
- Allows attaching, detaching, and exiting without stopping the simulator.
- Console windows can be scripted to pass input / output for development.
Usage:
```
run_tmux start
run_tmux attach
or execute `run_tmux` and select from menu.
```
Full Usage:
```
Usage: run_tmux {start|stop|restart|kill|attach|status}
start - Start the Cray simulator session
stop - Stop the Cray simulator session
restart - Restart the Cray simulator session
kill - Kill the Cray simulator session (unsafe)
attach - Attach to the Cray simulator session
status - List running Cray simulator and consoles
Use keys 'Ctrl b <0 to ...>' to move to specific windows
Use keys 'Ctrl b n' to move to the next window
Use keys 'Ctrl b p' to move to the previous window
Use keys 'Ctrl b d' to detach from the simulator session.
```
Tests:
- The script was checked in shellcheck with minimal issues detected.
- Tested on Ubuntu 22.04.3 LTS (aarch64)
- Tested on Arch Linux (x86_64)
459 lines
12 KiB
INI
459 lines
12 KiB
INI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;
|
|
; Configuration for a single-processor X-MP
|
|
; Matches HW config for machine SN#302
|
|
;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
CpuMemorySize 0x400000 ; We have 8MWords (64-bits each) of memory
|
|
BufferMemorySize 0x400000 ; We have 8MWrods of buffer memory as well
|
|
|
|
StartupCpuIdx 0 ; This will set up the first CPU to come out of reset (on instructions from the IOP)
|
|
StartupIopIdx 0 ; The first one (the MIOP) is the one to leave reset first
|
|
|
|
ClusterCount 3 ; Single-processor machines have 3 clusters - that is the number of inter-processor communication register sets
|
|
|
|
MemoryDumpFile dump/mem.dmp ; If we get terminated, dump mainframe memory to this file
|
|
BufferMemoryDumpFile dump/buffer.dmp ; If we get terminated, dump buffer memory to this file
|
|
|
|
MultiThreaded no
|
|
MachineType XMP1
|
|
|
|
WindowWidth 120
|
|
WindowHeight 40
|
|
|
|
DefaultLogLevel None
|
|
|
|
EnableTimeStamp yes
|
|
|
|
|
|
LogFileName dump/cray_sim.log
|
|
|
|
OsType COS
|
|
|
|
LogUnusedChannels no
|
|
|
|
BreakPoints {
|
|
}
|
|
|
|
EventPoints {
|
|
}
|
|
|
|
WatchPoints {
|
|
}
|
|
|
|
CpuCount 1
|
|
Cpus {
|
|
Default {
|
|
; HistoryBuffer 1000000
|
|
; DefaultLogLevel All
|
|
; InstructionBurstSize 100
|
|
; TimerIncrement 1000
|
|
; MemoryPokes {
|
|
; 0x00207B:p0 0006000 ; Change JSP to J to skip mainframe memory test
|
|
; }
|
|
ThrowOnUnknown no
|
|
ThrowOnUnimplemented no
|
|
}
|
|
}
|
|
|
|
IopClusters {
|
|
IopDCluster {
|
|
BufferMemoryPokes {
|
|
0x42B7 0x0200 ; Patch up IOP memory test routine to exit immediately
|
|
0x4476 0x0000 ; Patch up ovrelay loading code not to clear end of memory: it's 0 already in the simulator
|
|
0x43DA 0x0000 ; Patch up buffer memory test to exit quickly
|
|
0x3939 0x0028 ; Set CK0 device address to 050 - Hayes clock (should be 070 for Chronolog clocks)
|
|
; Make sure we always wait for completion on IOP-to-IOP transfers
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; 0x09BC 0x7e00
|
|
; 0x0a36 0x0000
|
|
; 0x0a59 0x0000
|
|
; 0x0a80 0x7710
|
|
}
|
|
|
|
BufferImageFiles {
|
|
0x0000 target/cos_117/iop_kern.bin ; The first IOP boots from buffer memory. Pre-load the boot image.
|
|
}
|
|
|
|
Iops {
|
|
0 {
|
|
MemoryDumpFile dump/iop0.dmp
|
|
; DefaultLogLevel None
|
|
Type MIOP
|
|
ChannelCount 42
|
|
InstructionBurstSize 100
|
|
TimerLimit 79999
|
|
Channels {
|
|
ERA {
|
|
ChannelIdx 016
|
|
}
|
|
Expander {
|
|
ChannelIdx 017
|
|
DeviceCount 64
|
|
Devices {
|
|
Tape {
|
|
ChannelIdx 022
|
|
Interrupt 5
|
|
Tape boot_tape.tap
|
|
Pokes {
|
|
boot_tape.tap {
|
|
0 {
|
|
0x04610 { Size 2 Value 0x1001 BigEndien yes } ; override long delay in INDD29 to speed bootup
|
|
; 0x1E2C0 { Size 2 Value 0x0010 BigEndien yes } ; override large loop in XDK to quickly terminate
|
|
; 0x256fd { Size 2 Value 0x0000 BigEndien yes } ; override call to MFINIT in START0
|
|
; 0x25783 { Size 2 Value 0x0000 BigEndien yes } ; override call to YIELD in START0
|
|
;0x4aefb { Size 1 Value 0x01 } ; override call to long delay in START0
|
|
0x3D24B { Size 1 Value 0x28 } ; Make XCLOCK restore the proper device address upon exit
|
|
0x3d6a3 { Size 1 Value 0x28 } ; Make XCLOCK use channel 51 for responses
|
|
0x3d7c3 { Size 1 Value 0x28 } ; Make XCLOCK use channel 51 for responses
|
|
0x3d399 { Size 1 Value 0x28 } ; Make XCLOCK use channel 51 for responses
|
|
0x3d49b { Size 1 Value 0x28 } ; Make XCLOCK use channel 51 for responses
|
|
; 0x138F5 { Size 2 Value 0x1010 BigEndien yes } ; patch up timeout in BMXCON
|
|
; Make calls for buffer transfer in START3 WAIT for return to work around synchrnization problems between IOPs in a multi-thread simulation
|
|
;0x4b797 { Size 1 Value 0x00 }
|
|
; 0x25BCB { Size 2 Value 0x1000 } ; A = 0
|
|
; 0x25BCF { Size 2 Value 0x1800 } ; A = ...
|
|
; 0x25BD0 { Size 2 Value 0x1D18 } ; 0x1D18
|
|
; 0x25BD1 { Size 2 Value 0x7C09 } ; R = OR[9]
|
|
; 0x25BD2 { Size 2 Value 0x2119 } ; A = OR[281]
|
|
; 0x25BD3 { Size 2 Value 0x8607 } ; P = P + 7, A # 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
AmpexDM980Disk {
|
|
; Must be an Ampex DM980 from this: http://bitsavers.trailing-edge.com/pdf/dilog/30006-1_DQ202A_Sep81.pdf - though as far as format goes, it seems identical to the CDC SMD9762
|
|
; It's a 80MB drive, but formatted as a 64MB one (leaving the last sector on each track empty)
|
|
;DefaultLogLevel All
|
|
ChannelIdx 060
|
|
Interrupt 6
|
|
ImageFileName exp_disk.img
|
|
Heads 5
|
|
Sectors 35
|
|
Tracks 823
|
|
SectorSize 512
|
|
}
|
|
Printer {
|
|
ChannelIdx 017
|
|
Interrupt 3
|
|
Name PR0
|
|
PrintFileName pr0.txt
|
|
}
|
|
Clock {
|
|
;DefaultLogLevel All
|
|
PrimaryChannelIdx 050
|
|
Interrupt 1
|
|
Name CK0
|
|
ResponseTimeout 500
|
|
YearLimit yes
|
|
}
|
|
}
|
|
;UseDummyDevices yes
|
|
}
|
|
CI {
|
|
; DefaultLogLevel All
|
|
IopChannelIdx 020
|
|
CrayChannelIdx 9
|
|
}
|
|
CO {
|
|
; DefaultLogLevel All
|
|
IopChannelIdx 021
|
|
CrayChannelIdx 8
|
|
}
|
|
CONC {
|
|
InputChannelIdx 024
|
|
OutputChannelIdx 025
|
|
PollDelay 100
|
|
}
|
|
Console {
|
|
TIChannelIdx 040
|
|
TOChannelIdx 041
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
Console {
|
|
TIChannelIdx 042
|
|
TOChannelIdx 043
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
Console {
|
|
TIChannelIdx 044
|
|
TOChannelIdx 045
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
Console {
|
|
TIChannelIdx 046
|
|
TOChannelIdx 047
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
}
|
|
BreakPoints {
|
|
; 0x210F { Type Trace Message "FATAL handler called {stack}" }
|
|
; 0x326A { Type LogOn }
|
|
;; 0x3ba6 { Type LogOn }
|
|
; 0x1697 { Type LogOn } ; Breakpoint in error case of HSPW
|
|
; 0x169D { Type Terminate }
|
|
;; 0x167C { Type LogOn } ; Breakpoint in the call that fails
|
|
; 0x4C58 { Type Trace Message "0x4C58 called {stack}" }
|
|
; 0x167C { Type Trace Message "0x167C called {stack}" }
|
|
; 0x1716 { Type Trace Message "0x1716 called {stack}" }
|
|
; 0x47EB { Type Trace Message "passing through 0x47EB {stack}" }
|
|
}
|
|
EventPoints {
|
|
; "CPU0 Coming out of reset" { Type LogOn TriggerCnt 2 }
|
|
}
|
|
}
|
|
1 {
|
|
MemoryDumpFile dump/iop1.dmp
|
|
Type BIOP
|
|
ChannelCount 42
|
|
InstructionBurstSize 100
|
|
TimerLimit 79999
|
|
Channels {
|
|
HIA {
|
|
ChannelIdx 014
|
|
}
|
|
HOA {
|
|
ChannelIdx 015
|
|
}
|
|
DD29 {
|
|
ChannelIdx 020
|
|
ImageFileName disk/biop_dk20.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 021
|
|
ImageFileName disk/biop_dk21.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 022
|
|
ImageFileName disk/biop_dk22.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 024
|
|
ImageFileName disk/biop_dk24.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 025
|
|
ImageFileName disk/biop_dk25.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 026
|
|
ImageFileName disk/biop_dk26.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 030
|
|
ImageFileName disk/biop_dk30.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 031
|
|
ImageFileName disk/biop_dk31.img
|
|
}
|
|
DD29 {
|
|
ChannelIdx 032
|
|
ImageFileName disk/biop_dk32.img
|
|
}
|
|
Console {
|
|
TIChannelIdx 042
|
|
TOChannelIdx 043
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
}
|
|
BreakPoints {
|
|
}
|
|
}
|
|
2 {
|
|
Exists no
|
|
MemoryDumpFile dump/iop2.dmp
|
|
Type DIOP
|
|
ChannelCount 42
|
|
InstructionBurstSize 100
|
|
TimerLimit 79999
|
|
Channels {
|
|
Console {
|
|
TIChannelIdx 042
|
|
TOChannelIdx 043
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
}
|
|
BreakPoints {}
|
|
}
|
|
3 {
|
|
MemoryDumpFile dump/iop3.dmp
|
|
Type XIOP
|
|
ChannelCount 42
|
|
InstructionBurstSize 100
|
|
TimerLimit 79999
|
|
Channels {
|
|
Bmx {
|
|
ChannelIdx 020
|
|
DelayLimit 10
|
|
Devices {
|
|
Tape {
|
|
DeviceName BmxTape0
|
|
DeviceAddress 0x0
|
|
Tape tape/bmt_00.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape1
|
|
DeviceAddress 0x1
|
|
Tape tape/bmt_01.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape2
|
|
DeviceAddress 0x2
|
|
Tape tape/bmt_02.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape3
|
|
DeviceAddress 0x3
|
|
Tape tape/bmt_03.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape4
|
|
DeviceAddress 0x4
|
|
Tape tape/bmt_04.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape5
|
|
DeviceAddress 0x5
|
|
Tape tape/bmt_05.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape6
|
|
DeviceAddress 0x6
|
|
Tape tape/bmt_06.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape7
|
|
DeviceAddress 0x7
|
|
Tape tape/bmt_07.tap
|
|
}
|
|
}
|
|
}
|
|
Bmx {
|
|
ChannelIdx 021
|
|
DelayLimit 10
|
|
Devices {
|
|
Tape {
|
|
DeviceName BmxTape8
|
|
DeviceAddress 0x8
|
|
Tape tape/bmt_08.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape9
|
|
DeviceAddress 0x9
|
|
Tape tape/bmt_09.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape10
|
|
DeviceAddress 0xa
|
|
Tape tape/bmt_10.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape11
|
|
DeviceAddress 0xb
|
|
Tape tape/bmt_11.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape12
|
|
DeviceAddress 0xc
|
|
Tape tape/bmt_12.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape13
|
|
DeviceAddress 0xd
|
|
Tape tape/bmt_13.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape14
|
|
DeviceAddress 0xe
|
|
Tape tape/bmt_14.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape15
|
|
DeviceAddress 0xf
|
|
Tape tape/bmt_15.tap
|
|
}
|
|
}
|
|
}
|
|
Bmx {
|
|
ChannelIdx 022
|
|
DelayLimit 10
|
|
Devices {
|
|
Tape {
|
|
DeviceName BmxTape16
|
|
DeviceAddress 0x8
|
|
Tape tape/bmt_16.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape17
|
|
DeviceAddress 0xc0
|
|
Tape tape/bmt_17.tap
|
|
}
|
|
}
|
|
}
|
|
Bmx {
|
|
ChannelIdx 023
|
|
DelayLimit 10
|
|
Devices {
|
|
Tape {
|
|
DeviceName BmxTape18
|
|
DeviceAddress 0x8
|
|
Tape tape/bmt_18.tap
|
|
}
|
|
Tape {
|
|
DeviceName BmxTape19
|
|
DeviceAddress 0xc0
|
|
Tape tape/bmt_19.tap
|
|
}
|
|
}
|
|
}
|
|
Console {
|
|
TIChannelIdx 042
|
|
TOChannelIdx 043
|
|
NewTerminalCommand "tmux new-session -d -s cray_{port} -n cray_{port} '{cmd}'&"
|
|
ConsoleCommandLinux "telnet {host} {port}"
|
|
ConsoleCommandWindows "putty.exe -load Unicos -telnet -P {port} {host}"
|
|
MapBackspace yes
|
|
BackspaceChar 127
|
|
EatLf no
|
|
}
|
|
}
|
|
BreakPoints {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|