[comp.sys.transputer] reset problems

andyr@inmos.com (Andy Rabagliati) (03/09/90)

This is a piece of OCCAM code that may help Klaus and others
in their reset problems. It is really a job for network loaders -

I find it useful when using the INMOS toolset products.

It puts a Transputer into the state just before boot - the
user will not be able to tell if the Transputer has REALLY
been reset or whether it is faking it ...

It will however only boot down bootchan - you could put an
ALT here if you wish but I find it more convenient the way it is.

This means that if you wish to subsequently load a transputer
with bootable code reset need not be asserted.

Cheers,  Andy Rabagliati   -   INMOS Central Applications US.

--{{{  stop
VAL bootchan IS ? :
-- THIS CODE MUST BE ABOVE MINT + 256 to work
--{{{  HARD chan DECLs
[4]CHAN OF ANY INPUT :
PLACE INPUT AT 4 :
--}}}
SEQ
  --{{{  reset channels
  SEQ i = 1 FOR 3
    VAL thischan IS (i+bootchan)\4 :
    CHAN OF ANY inchan  IS INPUT[thischan] :
    CHAN OF ANY outchan IS OUTPUT[thischan] :
    SEQ
      GUY
        LDLP inchan
        RESETCH
        LDLP outchan
        RESETCH
  --}}}
  INT memstart :
  BYTE len :
  [4]BYTE bootstart :
  SEQ
    --{{{  find memstart as we might be on T414 or T800 so look
    GUY
      MINT
      LDNLP 18  -- memstart ?
      STL memstart
      LDL memstart
      LDLP bootstart
      LDC 4
      MOVE
    -- PLACE WHAT IS KNOWN TO BE START OF BOOT CODE HERE
    VAL [4]BYTE STARTBOOT IS [$22(BYTE), $BA(BYTE), $90(BYTE), $60(BYTE)] :
    -- This works for toolset code (currently - otherwise look)
    -- VAL [4]BYTE STARTBOOT IS [$25(BYTE), $0A(BYTE), $21(BYTE), $F5(BYTE)] :
    -- THIS WORKS FOR CHECK code
    IF
      IF i = 0 FOR 4
        STARTBOOT[i]<>bootstart[i]
          SEQ
            GUY
              LDL memstart
              LDNLP 10
              STL memstart
      TRUE
        SKIP
    --}}}
    --{{{  boot
    COMMAND ? len
    GUY
      LDL memstart
      LDLP COMMAND
      LDL len
      IN
      LDLP COMMAND     -- boot link
      LDL len
      ADC 3           -- round up to word
      LDC 1
      BCNT
      NOT
      ADC 1
      AND
      LDL memstart
      ADD             -- Wptr
      LDL memstart    -- for GCALL
      REV
      GAJW
      REV             -- memstart
      GCALL
    --}}}
--}}}