I had a tricky bug to hunt down recently associated with high priority
processes interrupting low priority processes, but thanks to some help
from Mike Brüstle (www.transputer.net) I managed to fix it.
I'm now happy with the behaviour of the PC version of Julian Highfield
Transputer emulator (jserver), so I've published the executable on a
google site for any one who wants to have a play!
I've only had time to put the Occam toolset (D7205) support on the
website. I will add C (D7214) and source code when time permits.
http://sites.google.com/site/transputeremulator/
Gavin
> I've only had time to put the Occam toolset (D7205) support on the
> website. I will add C (D7214) and source code when time permits.
Your .COM approach with the hardcoded path isn't very usefull.
I prefere a different approach. I prepare my environment with the
following commands:
set DST=e:\inmos\d7214c
set ISERVER=%DST%\iserver\jserver.exe
ASSOC .btl=Transputer.Bootable.File
FTYPE Transputer.Bootable.File=%ISERVER% /SB %1 %*
set PATHEXT=^%PATHEXT^%;.BTL
set PATH=^%PATH^%;%DST%\itools;%DST%\iserver
set DST=
So I can simple call:
icc
ilink
...
This will not work for idebug and idump. These two programms requires
different options. See driver.c (IIRC).
-Mike
PS: You may consider to use a version resource (.exe->RM->Property-
>Version) and a icon. Looks more professional ;-)
I can supply you with a short sample, if you like.
PSPS: What about AMD64/IA64 Versions?
Booting root transputer...ok
Hello world...
C:\>Jserver.exe /SB hello.btl
Error - jserver - unable to access a transputer because
No response from transputer.
Is it your intention to make the options case sensitive?
What value should I set for IBOARDSIZE or do you read this value und
consider it?
The Minix bootstrap says #00200800 which is a rather exceptional value
for a software implementation.
C:\minix>jserver /sb boot.btl
Booting root transputer...ok
Secondary bootstrap entered.
Free mem starts at 800007bc
Sizing memory finished.
Found 00200800 bytes.
Loading boot monitor...
... so far and no further. Jserver.exe stuck with 100% cpu
consumption.
JSERVER.EXE /sb E:\D7214C\itools\icc.btl
Booting root transputer...ok
icc : INMOS toolset C compiler
INMOS C compiler Version 2.01.10 (built at 01:08:56 Jun 25 1991)
(c) Copyright INMOS Limited 1989
Usage: icc filename { /option }
Options:
C check only D define symbol
EC no ANSI-disallowed cast errors EP no #else/#endif errors
EZ no zero-sized array errors FH software quality policing
FM warn about unused #define FS make right-shifts
arithmetic
FV warn about unused variables G enable debug information
I output information J specify include directory
KS enable stack checks O specify output file
P specify map file PP run preprocessor only
S produce assembly language TA TA processor class
TB TB processor class U undefine symbol
WA no assignment warnings WD no deprecated function
warnings
WF no implicit function warnings WN no implicit narrowing
warnings
WT no poor code warnings WV no void function warnings
L load only XM execute many times XO execute
once
Also full processor name allowed
Default options may be placed in the environment variable ICCARG
JSERVER.EXE /sb E:\D7214C\itools\icc.btl hello.c /TA
Booting root transputer...ok
Fatal-icc- Invalid command line option (ta
)
JSERVER.EXE /sb E:\D7214C\itools\icc.btl hello.c /ta
Booting root transputer...ok
Fatal-icc- Invalid command line option (ta
)
set ICCARG=/TA
JSERVER.EXE /sb E:\D7214C\itools\icc.btl hello.c
Booting root transputer...ok
If I compare the icc output (hello.tco) from a real transputer and one
from jserver there is a small difference.
EMU:
00000000 01 00 02 0C │ FD 03 80 1F │ 00 FD 42 E0 │ 07 00 04
00 ....².Ç..²Ba....
00000010 1B 0D 03 69 │ 63 63 08 68 │ 65 6C 6C 6F │ 2E 63 0A
0B ...icc.hello.c..
00000020 14 10 02 11 │ 6D 6F 64 75 │ 6C 65 25 74 │ 61 62 6C
65 ....module%table
REAL:
00000000 01 00 02 0C │ FD 03 80 1F │ 00 FD 42 E0 │ 07 00 04
00 ....².Ç..²Ba....
00000010 1B 0C 03 69 │ 63 63 07 68 │ 65 6C 6C 6F │ 2E 63 0B
14 ...icc.hello.c..
00000020 10 02 11 6D │ 6F 64 75 6C │ 65 25 74 61 │ 62 6C 65
25 ...module%table%
I think there is a line feed (0x0A) in your command arguments. This is
also the reason why icc don't like "/ta" (because its "/ta\0a").
-Mike
Firstly, a big thank you for your keenness to have a play and check
out the PC based jserver utility which I made available earlier last
week.
> Your .COM approach with the hardcoded path isn't very useful.
> I prefer a different approach. I prepare my environment with the
> following commands:
Thanks for the alternative method. Personally, I don’t like having
overly complex environment variable setups. However, I can see that
your solution does give more flexibility for none standard
installations.
I agree that my method is somewhat ‘hardcoded’ (as you put it!) but it
is very simple to set-up and use. I am planning to put the source .bat
files and a bat2exe utility on my website (http://sites.google.com/
site/transputeremulator/) so that individuals can regenerate the
various .com files, for their specific PC set-up and where the Inmos
toolsets reside.
> C:\>Jserver.exe /SB hello.btl
> Is it your intention to make the options case sensitive?
Yes. I will make the command line options insensitive on the next
release (i.e. v2.0). This is a hang over from Julian’s original
software.
> What value should I set for IBOARDSIZE or do you read this value und
> consider it?
The current T414 emulator has 2Mbytes of memory (an IMSB004 equivalent
card). Therefore, use the following environment variable:
set IBOARDSIZE=#200000
Regarding your query about the possible line feed (0x0A) problem in
command arguments when using the ICC, I will have a look at this.
Whilst I have created the setup files to use D7214 (which I plan to
make available on my website shortly), I have only performed limited
testing with the Inmos ANSI C set-up. I have concentrated more time
writing test cases for the Occam toolset. I will try and have a look
at this issue shortly.
Gavin
> Thanks for the alternative method. Personally, I don’t like having
> overly complex environment variable setups.
That's the reason why some of my working environments have something
like an env.cmd. It allows me to copy the development tree to a
different location or machine. No installation, no global environment
setup.
I also think that it is possible to use the D7205A and D7214C into a
single combined environment. In my case some btl's from 14C are
slightly newer than that from 05A. Also the two libraries linkboot.lib
and sysproc.lib.
My "env.cmd" for this unified environment.
@echo off
@if not "%ECHO%"=="" echo %ECHO%
@if not "%OS%"=="Windows_NT" goto DOSEXIT
:MAIN
set D72UNI=%~dp0
set D72UNI=%D72UNI:~0,-1%
set ISEARCH=%D72UNI%\LIBS\
set ISERVER=%D72UNI%\iserver\JSERVER.EXE
set ITERM=%D72UNI%\iterms\NTANSI.ITM
set IBOARDSIZE=#200000
set TRANSPUTER=\\?\usb#vid_16c0^&pid_09ce#000000#{663e8c73-0cb4-4471-
a1bf-fab26c31d384}\0
set IDEBUGSIZE=#200000
set PATH=%D72UNI%\iserver;%D72UNI%\itools;%PATH%
set PATHEXT=%PATHEXT%;.BTL
if /I {%1} EQU {init} (
assoc .btl=Transputer.Bootable.File
ftype Transputer.Bootable.File="%ISERVER%" /sb %%1 %%*
)
::cd /d %D72UNI%
title INMOS D7205A ^& D7214C (Unified)
goto :EOF
:DOSEXIT
echo This script requires Windows NT
In a shell I simple call "env.cmd" (or "env.cmd init" if I switch from
iserver to jserver in line 9)
> bat2exe utility
This requires VDM support and the creation of a second process for
every utility.
> The current T414 emulator has 2Mbytes of memory (an IMSB004 equivalent
> card). Therefore, use the following environment variable:
> set IBOARDSIZE=#200000
I think it will be advantageous to read the IBOARDSIZE and use this
value in the emulator. Yesterday I've tried to test the rayshader with
jserver.exe but 2MB are to insufficient.
idebug doesn't show the usage screen with jserver.exe. Not further
analysed yet.
-Mike
The directory listing of my unified environment (excluding sample
directories):
Volume in drive E is Data
Volume Serial Number is DEAD-FACE
Directory of E:\D72UNI
06/22/2009 17:32 <DIR> .
06/22/2009 17:32 <DIR> ..
06/22/2009 17:32 716 env.cmd
06/22/2009 16:34 <DIR> iserver
09/23/2008 20:13 <DIR> iterms
06/22/2009 16:59 <DIR> itools
06/22/2009 16:56 <DIR> libs
1 File(s) 716 bytes
Directory of E:\D72UNI\iserver
06/22/2009 16:34 <DIR> .
06/22/2009 16:34 <DIR> ..
09/22/2008 20:29 24,576 iserver.dll
09/21/2008 09:33 9,728 iserver.exe
06/17/2009 15:08 93,493 jserver.exe
11/02/2006 02:17 75,776 nmake.exe
4 File(s) 203,573 bytes
Directory of E:\D72UNI\iterms
09/23/2008 20:13 <DIR> .
09/23/2008 20:13 <DIR> ..
02/28/1991 13:58 4,365 ANSI.ITM
02/28/1991 13:58 2,588 BANSI.SYS
02/28/1991 14:02 41,973 FTUTOR.OCC
02/28/1991 13:58 4,506 NECANSI.ITM
04/18/2005 23:13 3,696 NTANSI.ITM
02/28/1991 13:58 3,698 PCANSI.ITM
02/28/1991 13:58 3,696 PCBANSI.ITM
02/28/1991 13:58 137 README.TXT
8 File(s) 64,659 bytes
Directory of E:\D72UNI\itools
06/22/2009 16:59 <DIR> .
06/22/2009 16:59 <DIR> ..
02/28/1991 14:02 64,683 f.btl
06/25/1991 11:41 301,327 icc.btl
06/25/1991 11:41 125,109 icconf.btl
06/25/1991 11:41 90,014 icollect.btl
06/25/1991 11:41 41,462 icvemit.btl
06/25/1991 11:41 61,311 icvlink.btl
06/25/1991 11:41 334,114 idebug.btl
06/25/1991 11:41 4,792 idump.btl
06/25/1991 11:41 74,495 iemit.btl
06/25/1991 11:41 50,819 ieprom.btl
06/25/1991 11:41 46,321 ilibr.btl
06/25/1991 11:41 87,500 ilink.btl
06/25/1991 11:41 81,453 ilist.btl
06/25/1991 11:41 54,202 imakef.btl
06/25/1991 11:41 112,360 isim.btl
06/25/1991 11:41 9,669 iskip.btl
02/28/1991 13:58 321,201 oc.btl
02/28/1991 13:58 412,123 occonf.btl
18 File(s) 2,272,955 bytes
Directory of E:\D72UNI\libs
06/22/2009 16:56 <DIR> .
06/22/2009 16:56 <DIR> ..
06/25/1991 11:41 491 ASSERT.H
06/25/1991 11:41 2,015 BOARDS.INC
02/28/1991 13:58 17,515 CALLC.LIB
03/19/2005 15:08 56,422 CENTRY.LIB
06/25/1991 11:41 3,148 CHANNEL.H
06/25/1991 11:41 3,171 CONNDX11.H
02/28/1991 13:58 214,274 CONVERT.LIB
02/28/1991 13:58 32,815 CRC.LIB
06/25/1991 11:41 1,706 CTYPE.H
02/28/1991 13:58 136,990 DBLMATH.LIB
02/28/1991 13:58 18,260 DEBUG.LIB
06/25/1991 11:41 2,193 DOS.H
06/25/1991 11:41 1,095 ERRNO.H
06/25/1991 11:41 1,342 FLOAT.H
06/25/1991 11:41 1,134 HOST.H
02/28/1991 13:58 6,930 HOSTIO.INC
02/28/1991 13:58 1,008,864 HOSTIO.LIB
02/28/1991 13:58 57 HOSTIO.LIU
06/25/1991 11:41 1,774 IOCNTRL.H
03/19/2005 15:08 1,144,117 LIBC.LIB
03/19/2005 15:08 856,087 LIBCRED.LIB
06/25/1991 11:41 944 LIMITS.H
02/28/1991 13:58 314 LINKADDR.INC
06/25/1991 11:41 4,198 LINKBOOT.LIB
06/25/1991 11:41 1,019 LOCALE.H
06/25/1991 11:41 1,184 MATH.H
06/25/1991 11:41 1,055 MATHF.H
02/28/1991 13:58 2,427 MATHVALS.INC
06/25/1991 11:41 1,017 MISC.H
02/28/1991 13:58 1,314 MSDOS.INC
02/28/1991 13:58 34,842 MSDOS.LIB
02/28/1991 13:58 270,046 OCCAM2.LIB
02/28/1991 13:58 73 OCCAM2.LNK
02/28/1991 13:58 69,433 OCCAM8.LIB
02/28/1991 13:58 73 OCCAM8.LNK
02/28/1991 13:58 220,605 OCCAMA.LIB
02/28/1991 13:58 73 OCCAMA.LNK
02/28/1991 13:59 20,844 OCCAMUTL.LIB
02/28/1991 13:59 6,918 OCCONFIO.LIB
06/25/1991 11:41 3,659 PROCESS.H
02/28/1991 13:59 14,072 ROMBOOT.LIB
06/25/1991 11:41 806 SEMAPHOR.H
06/25/1991 11:41 2,070 SETCONF.INC
06/25/1991 11:41 574 SETJMP.H
06/25/1991 11:41 1,876 SIGNAL.H
02/28/1991 13:59 149,430 SNGLMATH.LIB
06/25/1991 11:41 181 STARTRD.LNK
06/25/1991 11:41 175 STARTUP.LNK
06/25/1991 11:41 1,840 STDARG.H
06/25/1991 11:41 748 STDDEF.H
06/25/1991 11:41 5,620 STDIO.H
06/25/1991 11:41 2,700 STDIORED.H
06/25/1991 11:41 2,630 STDLIB.H
02/28/1991 13:58 740 STREAMIO.INC
02/28/1991 13:59 461,429 STREAMIO.LIB
02/28/1991 13:58 71 STREAMIO.LIU
06/25/1991 11:41 1,983 STRING.H
02/28/1991 13:59 83,901 STRING.LIB
02/28/1991 13:58 57 STRING.LIU
06/25/1991 11:41 208 SUBCHAN.H
06/25/1991 11:41 1,336 SUBSEM.H
06/25/1991 11:41 30,252 SYSPROC.LIB
02/28/1991 13:59 109,776 TBMATHS.LIB
02/28/1991 13:58 519 TICKS.INC
06/25/1991 11:41 1,773 TIME.H
06/25/1991 11:41 2,759 TRAMS.INC
02/28/1991 13:59 8,085 VIRTUAL.LIB
02/28/1991 13:59 12,530 XLINK.LIB
68 File(s) 5,048,579 bytes
Total Files Listed:
99 File(s) 7,590,482 bytes
14 Dir(s) 95,900,827,648 bytes free
Have you made a "speed adjustment" in update_time()?
Maybe your timers runs to speedy. Julian assumes 100ns per instruction
(10MIPS) or in other words - he increments the hi-timer every 10
instructions.
-Mike
BTW: It's a real crux to implement a efficient timer simulation with a
microsecond resolution which scales from a slow system to a high end
system!
I have not made any changes to the update_time() function.
I agree that adjusting for PC performance is a bit tricky. Whilst I
could add some form of PC performance test at the start to provide a
correction figure (i.e. a delay) to ensure the emulator works at a
constant rate (i.e. 10MIPS performance), I’m happy with the current
emulation method.
Whilst the emulator timing is potentially none real time (depends on
speed of PC used), it does correctly emulate the relative difference
in high and low priority timers (i.e. 1 to 64).
Secondly, it runs faster on more powerful PC’s, which is great when
you are running something complex or time consuming, such as Mandel
Blot image generation program.
Gavin