DIRECTORY IO USING [STREAM], PupTypes USING [PupAddress, PupType, PupSocketID], Rope USING [ROPE]; TeleLoad: CEDAR DEFINITIONS = BEGIN MaxByte: NAT = 200; BlockIndex: TYPE = [0..MaxByte); CoreAddress: TYPE = LONG CARDINAL; BootTypeNumber: TYPE = LONG CARDINAL; MachineTypeNumber: TYPE = LONG CARDINAL; Byte: TYPE = [0..400B); DataBlock: TYPE = PACKED ARRAY [0..0) OF Byte; TLObject: TYPE = MONITORED RECORD [ host: Rope.ROPE _ NIL, address: PupTypes.PupAddress, cacheCB: CoreBlock _ NIL, cacheSize: NAT _ 0, addressSpace: AddressSpace _ main, dirty: BOOLEAN _ FALSE, log: IO.STREAM ]; Handle: TYPE = REF TLObject; teleSwatSocket: PupTypes.PupSocketID = [0, 60B]; locMaxByte: PUBLIC NAT; coreStoreRequest: PupTypes.PupType = LOOPHOLE[300B]; coreFetchRequest: PupTypes.PupType = LOOPHOLE[302B]; goRequest: PupTypes.PupType = LOOPHOLE[304B]; stateFetchRequest: PupTypes.PupType = LOOPHOLE[306B]; singleStepRequest: PupTypes.PupType = LOOPHOLE[312B]; goFromBreakRequest: PupTypes.PupType = LOOPHOLE[314B]; debugRequest: PupTypes.PupType = LOOPHOLE[310B]; eventBooted: PupTypes.PupType = LOOPHOLE[311B]; slaveStoreRequest: PupTypes.PupType = LOOPHOLE[316B]; slaveFetchRequest: PupTypes.PupType = LOOPHOLE[320B]; callRequest: PupTypes.PupType = LOOPHOLE[322B]; Advice: TYPE = MACHINE DEPENDENT RECORD [ setHost: BOOLEAN, setAdvice: BOOLEAN, data: [0..37777B] ]; CorePktObject: TYPE = MACHINE DEPENDENT RECORD [ advice: Advice, address: CoreAddress, count: CARDINAL, data: DataBlock ]; CorePkt: TYPE = LONG POINTER TO CorePktObject; CallPktObject: TYPE = MACHINE DEPENDENT RECORD [ proc: CARDINAL, nargs: CARDINAL, returnArg: CARDINAL, args: ARRAY [0..5) OF CARDINAL ]; CallPkt: TYPE = LONG POINTER TO CallPktObject; Registers8086: TYPE = MACHINE DEPENDENT { AX(0), BX(1), CX(2), DX(3), SP(4), BP(5), SI(6), DI(7), CS(8), DS(9), SS(10), ES(11), IP(12), FL(13) }; State8086Object: TYPE = MACHINE DEPENDENT RECORD [ Regs: ARRAY Registers8086 OF CARDINAL ]; State8086: TYPE = LONG POINTER TO State8086Object; CoreBlockObject: TYPE = RECORD [ advice: Advice, address: CoreAddress, data: PACKED SEQUENCE count: NAT OF Byte ]; CoreBlock: TYPE = REF CoreBlockObject; NameToAddress: PROC [name: Rope.ROPE] RETURNS [address: PupTypes.PupAddress, ok: BOOL]; AddressToName: PROC [address: PupTypes.PupAddress] RETURNS [nameRope, addressRope: Rope.ROPE]; Start: PROC [host: Rope.ROPE, log: IO.STREAM] RETURNS [h: Handle]; Stop: PROC [h: Handle]; TeleLoadProc: TYPE = PROC [h: Handle, cb: CoreBlock, tries: NAT _ 5] RETURNS [ok: BOOL, attempts: NAT]; Store: TeleLoadProc; Fetch: TeleLoadProc; Go: TeleLoadProc; FetchState: TeleLoadProc; SingleStep: TeleLoadProc; GoFromBreak: TeleLoadProc; GoToDebugger: TeleLoadProc; SlaveStore: TeleLoadProc; SlaveFetch: TeleLoadProc; Call: TeleLoadProc; EventRecordObject: TYPE = MACHINE DEPENDENT RECORD [ regs: State8086Object, reason: CARDINAL, clockLow: CARDINAL, clockHigh: CARDINAL, bootSwitches: CARDINAL, advice: CARDINAL, monRelays: CARDINAL, tlNet: CARDINAL, tlHost: CARDINAL, tlImHost: CARDINAL, localNet: CARDINAL ]; EventRecord: TYPE = LONG POINTER TO EventRecordObject; EventProc: TYPE = PROC[who: PupTypes.PupAddress, cb: EventRecordObject, clientData: REF ANY]; StartEventServer: PROC [proc: EventProc, clientData: REF ANY _ NIL]; StopEventServer: PROC; Failed: ERROR; AddressSpace: TYPE = {main, slave}; GetCoreBlock: PROC[h: Handle, addr: CoreAddress, count: CARDINAL, addressSpace: AddressSpace _ main] RETURNS [CoreBlock]; Read: PROC [h: Handle, addr: CoreAddress, addressSpace: AddressSpace _ main] RETURNS [CARDINAL]; ReadWord: PROC [h: Handle, addr: CoreAddress, addressSpace: AddressSpace _ main] RETURNS [CARDINAL]; Write: PROC [h: Handle, addr: CoreAddress, value: CARDINAL, addressSpace: AddressSpace _ main]; WriteWord: PROC [h: Handle, addr: CoreAddress, value: CARDINAL, addressSpace: AddressSpace _ main]; FlushWrites: PROC [h: Handle]; ResetCache: PROC [h: Handle]; SetCacheSize: PROC [h: Handle, bytes: NAT]; Swab: PROC [a: CARDINAL] RETURNS [b: CARDINAL]; SwabState: PROC [state: State8086Object] RETURNS [State8086Object]; SwabEvent: PROC [state: EventRecordObject] RETURNS [EventRecordObject]; StopHimProbing: PROC [h: Handle, setPointers: BOOL _ FALSE]; GetEventData: PROC [h: Handle, setPointers: BOOL] RETURNS [event: EventRecordObject, ok: BOOL]; StartKing: PROC; StopKing: PROC; END. December 30, 1981 1:42 PM, Stewart, created 3-Jan-82 20:52:45, Stewart, Added 8086 state last edited by Stewart, 4-Jan-82 20:21:34 December 22, 1982 2:55 pm, Stewart April 25, 1983 11:25 am, LCS, changes to Event, add locMaxByte April 29, 1983 12:04 pm, LCS, new event, slave space May 1, 1983 3:18 pm, LCS, added GetEventData and StopHimProbing ²TeleLoad.mesa Last Edited by: Stewart, May 28, 1983 5:48 pm note: a LONG CARDINAL has the more significant word at the higher memory address. locMaxByte is a public global variable which says how large a coreblock Larks are willing to handle. Core fetch and store requests are identical except that the store request includes data. Both reply with the new contents of memory. The pupType of the reply is that of the request plus one. The state fetch and store requests fetch and return the remote processor "state" whatever that may be. The count field must be the right value and the address field is a small integer indicating which block of state is involved, if there is more than one. goRequest causes normal execution to resume using the given state. singleStepRequest executes one instruction using the given state then returns to the debugger. goFromBreakRequest single steps once, installs a breakpoint, then continues For the 8088, the size of the state block is 28, it consists solely of the registers per State8086Object. The running program is requested to go to the debugger. Whenever the debugger is entered, a packet of type eventBooted is transmitted. The eventBooted packet carries the machine state plus the boot reason. Read and write in slave processor's address space. Call a procedure with given arguments. The following records are contained in the data part of a Pup The fetch and store requests use this record. This is the structure found in the data part of a CorePktObject for a procedure call. 8086 state The store requests and acknowledges use this record. count may be odd, but the data array is padded to an even number of bytes. Procedures eventBooted packets . . . proc will be called with a CoreBlock containing an EventRecordObject. This part of the package uses TeleSwatSocket on the local machine. Communications Procedures This signal is raised on communiction failure from the routines below. The following procedures deal with the handle.cacheCB Invalidate the cache, so that new data will be fetched. If you are altering the memory image of a running program, it is wise to use a very small cache size. This procedure also does a FlushWrites before setting the size. A zero cache size sets the size to locMaxByte. utilities Send a single packet to stop the given machine from probing. IF grab, then set his debugging pointers to us. Read the event region of the remote machine. Worldwide failility, needed for anything to work ÊÛ˜Jšœ ™ Jšœ-™-J˜šÏk ˜ Jšœœœ˜Jšœ œ$˜2Jšœœœ˜J˜—šœ œ œ˜Jš˜J˜Jšœ.™.Jšœ"™"Jšœ œ˜Jšœ œ˜ Jšœ œœœ˜"Jšœœœœ˜%Jšœœœœ˜(Jšœœ ˜Jš œ œœœœ˜.J˜šœ œ œœ˜#Jšœ œœ˜J˜Jšœœ˜Jšœ œ˜J˜"Jšœœœ˜Jšœœ˜J˜J˜—Jšœœœ ˜J˜J˜0J™Jšœd™dJšœ œœ˜J˜Jšœ¾™¾J˜Jšœ%œ˜4Jšœ%œ˜4J˜Jšœÿ™ÿJ˜JšœB™BJšœ^™^JšœK™KJ˜Jšœi™iJ˜Jšœœ˜-Jšœ&œ˜5Jšœ&œ˜5Jšœ'œ˜6J˜JšœÍ™ÍJ˜Jšœ!œ˜0Jšœ œ˜/J˜Jšœ2™2Jšœ&œ˜5Jšœ&œ˜5J˜Jšœ&™&Jšœ œ˜/J˜Jšœ=™=J˜š œœœ œœ˜)Jšœ œ˜Jšœ œ˜J˜J˜J˜—Jšœ-™-š œœœ œœ˜0J˜J˜Jšœœ˜J˜J˜—J˜Jš œ œœœœ˜.J˜JšœU™Uš œœœ œœ˜0Jšœœ˜Jšœœ˜Jšœ œ˜Jšœœœ˜J˜—J˜Jš œ œœœœ˜.J˜Jšœ ™ šœœœ œ˜)Jšœœœœœœœ˜0Jšœœœœœœœ˜3J˜J˜—š œœœ œœ˜2Jšœœœ˜%J˜J˜—Jš œ œœœœ˜2J˜Jšœ4™4šœœœ˜ J˜J˜Jš œœœœœ˜(J˜J˜—Jšœ œœ˜&J˜JšœJ™JJ˜Jšœ ™ J˜Jš Ïn œœ œœ$œ˜WJšž œœ œœ˜^Jš žœœ œœœœ ˜BJšžœœ ˜J˜šž œœœ#œ˜DJšœœ œ˜"J˜—J˜J˜J˜J˜J˜J˜J˜J˜J˜J˜J˜Jšœ™š œœœ œœ˜4J˜Jšœœ˜Jšœ œ˜Jšœ œ˜Jšœœ˜Jšœœ˜Jšœ œ˜Jšœœ˜Jšœœ˜Jšœ œ˜Jšœ ˜J˜J˜—Jš œ œœœœ˜6J˜Jšœ‰™‰Jš ž œœœ>œœ˜]Jš žœœœœœ˜DJšžœœ˜J™J™J˜J™FJšœœ˜J˜Jšœœ˜#J˜šž œœ&œ$˜dJšœ ˜—J˜J™5JšžœœCœœ˜`J˜JšžœœCœœ˜dJ˜Jšžœœ'œ%˜_J˜Jšž œœ'œ%˜cJ˜Jšž œœ ˜J˜J™7Jšž œœ ˜J˜J™ÖJšž œœœ˜+J˜J™ Jš žœœœœœ˜/J˜Jšž œœœ˜CJ˜Jšž œœœ˜GJ˜Jšœm™mJšžœœœœ˜Jšœœ˜4Jšœœ'˜?—…—†$