Hi Brian, were you able to resolve what was causing the problem?
BTW, all the current files have been updated in Dropbox.
FROM W5200.fth in the zip file (and dropbox) this word (!WIZIO) does not complie? No WRESET, WPWRDN defined anywhere?
\ Init the SPI for the WIZnet chip
pub !WIZIO
!PCB
wizpins $00FFFFFF AND SPIPINS
&WNCS OUTSET \ Chip select is an output - active low
&WNCK OUTCLR \ Clock is an output - leave low
&WNDI OUTCLR \ MOSI is an output
ON WRESET OFF WPWRDN OFF WRESET
;
FROM W5200.fth in the zip file (and dropbox) this word (!WIZIO) does not complie? No WRESET, WPWRDN defined anywhere?
\ Init the SPI for the WIZnet chip
pub !WIZIO
!PCB
wizpins $00FFFFFF AND SPIPINS
&WNCS OUTSET \ Chip select is an output - active low
&WNCK OUTCLR \ Clock is an output - leave low
&WNDI OUTCLR \ MOSI is an output
ON WRESET OFF WPWRDN OFF WRESET
;
Ah yes, I mentioned somewhere that I use hardware header files which define the pins and also any special functions of which WRESET and WPWRDN are in my system as they are accessed over I2C. But what I will do is include some IFNDEFs in the source to make sure it compiles properly if these have not been defined. I will also put one of my header files in the Tachyon folder for reference. There is also the function !PCB which is hardware specific initialization which is just a dummy word unless a new one is defined.
EDIT: I had updated the W5200.fth code and I notice that I already have a header file in there, the CE1372.fth file.
If you access the web document versions you will find the formatting and diagrams etc in there help.
Ah yes, I mentioned somewhere that I use hardware header files which define the pins and also any special functions of which WRESET and WPWRDN are in my system as they are accessed over I2C. But what I will do is include some IFNDEFs in the source to make sure it compiles properly if these have not been defined. I will also put one of my header files in the Tachyon folder for reference. There is also the function !PCB which is hardware specific initialization which is just a dummy word unless a new one is defined.
EDIT: I had updated the W5200.fth code and I notice that I already have a header file in there, the CE1372.fth file.
If you access the web document versions you will find the formatting and diagrams etc in there help.
... so that you could type HELP .NUM for instance and it will display MJB plans mainly to have this info extracted in hardcopy form, whereas I like to have it at my fingertips.
I like 'at my fingertips' too but my screens are too small ;-)
well - new to Google-Docs I discovered the scripts (which is kind of JavaScript) - was happy -
and wondered if I could write a converter to strip the stuff of (e.g. the code itself) that I do not want in my overview document.
Well - it would have been only a few lines of code - if Google had not decided to implement only a subset of REGEXP in it's
JavaScript version - how stupid.
If I find a good solution I let you know.
MODULES LOADED:
3624: MULTIFAT.fth FAT32/16 MultiFile Layer V1.1 131111-0000
2ECD: SDCARD.fth SD CARD Toolkit - 131114.0000
18C0: EXTEND.fth Primary extensions to TACHYON kernel - 131124-0000
----------------------------------------------------------------
( W5200.fth ) ok
ok
FORGET W5200.fth Not found ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
ok
0000 ok
0217 addr -- ) E!
I'm assuming you have a new and clean system because the E! was introduced recently. I must report the load errors in a clearer fashion though. As a test I copied the web document and pasted that in without any problems.
[FONT=courier new]FORGET W5200.fth ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
ok
0000 ok
0470 ok egisters "gisters " ." ******* "07!!"
0471 ok
0472
00:00:19 End of source code, 0473 lines processed and 0000 errors found
Load time = 15,683ms
NAMES: $5293...7309 for 8310 (0945 bytes added)
CODE: $0000...46DF for 9833 (1652 bytes added)
CALLS: 0233 vectors free
RAM: 2996 bytes free
[/FONT]
EDIT: Just tried the Dropbox version and it works fine too although it only reports half the lines. I know the web document version seems to paste two LFs rather than a CRLF and previously I would ignore LFs altogether but now my system converts LFs to CRs if they are not part of a CRLF, hence the double line thing. BTW, don't use the zip files anymore, just the online versions, Dropbox seems to be working fine now.
I'm assuming you have a new and clean system because the E! was introduced recently. I must report the load errors in a clearer fashion though. As a test I copied the web document and pasted that in without any problems.
[FONT=courier new]FORGET W5200.fth ok
ok
TACHYON
Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
ok
0000 ok
0470 ok egisters "gisters " ." ******* "07!!"
0471 ok
0472
00:00:19 End of source code, 0473 lines processed and 0000 errors found
Load time = 15,683ms
NAMES: $5293...7309 for 8310 (0945 bytes added)
CODE: $0000...46DF for 9833 (1652 bytes added)
CALLS: 0233 vectors free
RAM: 2996 bytes free
[/FONT]
EDIT: Just tried the Dropbox version and it works fine too although it only reports half the lines. I know the web document version seems to paste two LFs rather than a CRLF and previously I would ignore LFs altogether but now my system converts LFs to CRs if they are not part of a CRLF, hence the double line thing. BTW, don't use the zip files anymore, just the online versions, Dropbox seems to be working fine now.
Arrg, the last zip that was posted didn't have E!, verions mismatch, all better, thx Peter
I am OK now. I spent a good part of the last 36 hours trying various combinations of baud rates, line delays, boards, compilers ... etc.
IN the end I not only got it loaded but it was done at 230400 baud w/21ms line delay ..... up from 115200 baud and 60 ms.
Peter ... have you some sample code for redirecting output of .NUM to write to SD?
Hi Brian,
There is an FSEND word that you can use to set the output to write sequentially into a file. Normally when a file is opened a write pointer is set to append to the file and FSEND takes the emit characters and does a simple append character by character. So bear in mind that the way I have decided to setup the file system may be at odds to traditional thinking, but it makes way more sense to me to treat the card like virtual memory and also to "preformat" the card with blanks files that are more than large enough that they never need to have extra clusters added or file size entries update continually. This takes away a lot of the problems associated with file systems and SD cards for embedded use vs PC HDDs or even camera SD file access. I will explain a bit more about this in the MULTIFAT document itself.
" MYFILE.TXT" FOPEN$ FSEND <do your voodoo> CON FCLOSE
Please note that the FSEND word is still a WIP and I will include a lot more features with it, at the moment there is only one FSEND pointer rather than one for each file and it resets to the start of the file when it's opened. I'm just looking at a way that I can avoid writing a file pointer to the card continually which is not a good thing for Flash. I do have my own methods for finding the end of a file which does not involve writing any pointer to Flash, would you be interested in a method I use?
BTW, the Dropbox links are not always the most up-to-date although I do try to update them often. If you go to the links page (via the Intro page) you will find a new entry called "suggested build" which has an entry for all the links to web document pages that I would use in a build. These are the same links
I mentioned in post #933.
There is an FSEND word that you can use to set the output to write sequentially into a file. Normally when a file is opened a write pointer is set to append to the file and FSEND takes the emit characters and does a simple append character by character. So bear in mind that the way I have decided to setup the file system may be at odds to traditional thinking, but it makes way more sense to me to treat the card like virtual memory and also to "preformat" the card with blanks files that are more than large enough that they never need to have extra clusters added or file size entries update continually. This takes away a lot of the problems associated with file systems and SD cards for embedded use vs PC HDDs or even camera SD file access. I will explain a bit more about this in the MULTIFAT document itself.
" MYFILE.TXT" FOPEN$ FSEND <do your voodoo> CON FCLOSE
Please note that the FSEND word is still a WIP and I will include a lot more features with it, at the moment there is only one FSEND pointer rather than one for each file and it resets to the start of the file when it's opened. I'm just looking at a way that I can avoid writing a file pointer to the card continually which is not a good thing for Flash. I do have my own methods for finding the end of a file which does not involve writing any pointer to Flash, would you be interested in a method I use?
BTW, the Dropbox links are not always the most up-to-date although I do try to update them often. If you go to the links page (via the Intro page) you will find a new entry called "suggested build" which has an entry for all the links to web document pages that I would use in a build. These are the same links
I mentioned in post #933.
Yes some documentation and a simple example (or did I miss this) would help right now. I've gotten this far but can see EXTEND.FTH on the FAT32 formated 2 GIG drive?
Been tinkering under the hood a bit and moved some stuff from the kernel into EXTEND as those definitions are not used by the kernel and better coded and maintained in EXTEND. The reason for this is that I am whittling the kernel down so it's easier to get around while most of the high-level definitions are in EXTEND.
A new RECLAIM command has been added which removes all "private" headers from the dictionary and reclaims that memory, that includes those created with "pri" and those with the tag PRIVATE
[FONT=courier new]LIKE IF WORDS
NFA PFA EXT ATRS NAME
-----------------------
5E9F 2FB4 YF6 .imm pub FORGET
631B 2264 XB8 .imm pub LIKE
6355 2149 YB4 .imm pub ANY
6363 2129 YB3 .imm pub MATCH
644E 1FB2 YA7 .imm pub STRING
67AF 1A88 Y4E .imm pub ==
67B5 1A7C Y4D .imm pub DS
[/FONT]
HELP comments will also find a place in the top 32K of a 64K EEPROM. To make that work for words defined in the kernel and earlier in EXTEND I am allowing the comments to be compiled inline with the headers. Yikes!, that'll take a lot of the hub RAM but only up to the point that the EEPROM words become active and the help comments can be shunted up to EEPROM with MAKEHELP where WORDS and HELP will draw comments from. If you are typing in interactive mode then I may include a hint mode which will list the stack comment with a ^? and further comments with further ^? (control ? = $1F)
At present there are about 14 PASM longs taken up by the instruction CMPSTR which is mostly only used during compile. I want to free up that space for some more useful tricks in PASM so this instruction will be moved to bytecode which is slower but when the load control word TACHYON is executed then CMPSTR will vector to PASM CMPSTR loaded as a RUNMOD instruction.
The other compile-time/runtime optimization I am looking at is the console receiver cog in that I want it as a multi-channel serial port when it's not dedicated to high-speed serial receive during source-code compile. That way I can have COM1 COM2 COM3 COM4 I/O redirection without necessarily requiring another cog, although that's optional.
Also let me know if there is any sample code you might need for such things like the file system etc. The best sample code is actually to have a solution to a real requirement, so let me know.
I'm totally new to Forth and Tachyon. I played a little and made a BINARYDUMP. How do I get this image programmed into EEPROM? I tried hex2bin, but it fails. Can I load the hex image with BST? Ah, btw. Win8.
I'm totally new to Forth and Tachyon. I played a little and made a BINARYDUMP. How do I get this image programmed into EEPROM? I tried hex2bin, but it fails. Can I load the hex image with BST? Ah, btw. Win8.
Hi Akkarin, I've copied my hex2bin.exe that I use into the Tachyon Dropbox folder so try that perhaps. After which you just rename it to .binary for the Prop tool. If it still has errors then it may have to do with your capture perhaps, are you copying from the screen buffer or straight to a file? Is there a particular reason you need a binary this early in your evaluation?
There's also another way of generating a binary now and that's via the SD card with SAVEROM if that's an option.
Hi Peter,
thanks for the hex2bin, but it doesn't run on 64-bit Windows.
I copied the Dump via C&P from PuTTy screen and then deleted empty lines with NotePad++. With empty lines I mean that PuTTy puts out CR LF every second line. So, every line ends with CR LF and every second line is empty, meaning only CR LF.
The reason I'd like to save the image is, that I want to try PropForth as well and don't want to lose my new words.
Currently I don't have an SD card hooked up.
Hi Peter,
thanks for the hex2bin, but it doesn't run on 64-bit Windows.
I copied the Dump via C&P from PuTTy screen and then deleted empty lines with NotePad++. With empty lines I mean that PuTTy puts out CR LF every second line. So, every line ends with CR LF and every second line is empty, meaning only CR LF.
The reason I'd like to save the image is, that I want to try PropForth as well and don't want to lose my new words.
Currently I don't have an SD card hooked up.
I recommend Teraterm (SourceForge version) for Windows, it's the best terminal emulator and you have full control over all the settings.
If you load the Tachyon kernel for the first time then it takes less than a minute to paste in EXTEND.fth plus any other words you have created, there is no real need for a binary save really unless you want to generate an image for production or field upgrades.
I walked back into the workshop after midnight and noticed some activity on my Tachyon network server. My server reports back to the console if it connects via FTP, TELNET or even HTTP which has not been implemented yet.
This is what I saw:
Now socket 0 happens to be the TELNET server and I haven't been using that but I do have port forwarding set so that the Prop gets any requests. So I decided to look at the receive buffer for that socket:
It seems some bot was trying to connect on port 23 using generic user and password details blindly, interesting. Maybe I will set it up so that it captures and logs connection information to the SD card. I'd like to see them hack a Prop running Tachyon Forth!!!
Yeah, those things are everywhere. Put a server up, and it often only takes minutes for the door knocking to start.
Another great fun is to accept the connection, then send them a few megabytes in response... Random numbers are a great choice. So they make the request, you answer it, take the username they give, and then just start spraying line noise their way instead of a password prompt. Often they go away for a while.
Yeah, those things are everywhere. Put a server up, and it often only takes minutes for the door knocking to start.
Another great fun is to accept the connection, then send them a few megabytes in response... Random numbers are a great choice. So they make the request, you answer it, take the username they give, and then just start spraying line noise their way instead of a password prompt. Often they go away for a while.
That prompted me to take a look at implementing HTTP then. Developing code for this is real easy as I can type in a new directive such as GET and it executes automatically when a browser tries to connect:
Here's a request packet that's been echoed to the console (Including the GET notification):
The GET is interpreted by the Forth console and executes this word I typed in which looks up the webpage HTTP001.HTM to serve up from the SD card, in this case a simple security dialog:
[FONT=courier new]pub GET
CON CR REVERSE ." GET REQUEST " PLAIN \ Let me know about a request
CR BEGIN LAN KEY CON DUP EMIT 0= UNTIL \ Just echo the request to the console for now
LAN " HTTP001.HTM" FOPEN$ IF FILE@ XADR PRINT$ THEN \ Access the webpage from the SD card and send it
;
IMMEDIATE
[/FONT]
If you noticed the WAN IP and port you are welcome to have a go, it's just a simple dialog at the moment but TELNET (console to Forth) and FTP (try FileZilla) are working on the normal ports although I have to fix FTP again after making some "improvements"
If I add file uploading to the FTP server then I can upload new webpages to the Prop rather than having to remove the card.
That prompted me to take a look at implementing HTTP then. Developing code for this is real easy as I can type in a new directive such as GET and it executes automatically when a browser tries to connect:
Here's a request packet that's been echoed to the console (Including the GET notification):
The GET is interpreted by the Forth console and executes this word I typed in which looks up the webpage HTTP001.HTM to serve up from the SD card, in this case a simple security dialog:
[FONT=courier new]pub GET
CON CR REVERSE ." GET REQUEST " PLAIN \ Let me know about a request
CR BEGIN LAN KEY CON DUP EMIT 0= UNTIL \ Just echo the request to the console for now
LAN " HTTP001.HTM" FOPEN$ IF FILE@ XADR PRINT$ THEN \ Access the webpage from the SD card and send it
;
IMMEDIATE
[/FONT]
If you noticed the WAN IP and port you are welcome to have a go, it's just a simple dialog at the moment but TELNET (console to Forth) and FTP (try FileZilla) are working on the normal ports although I have to fix FTP again after making some "improvements"
If I add file uploading to the FTP server then I can upload new webpages to the Prop rather than having to remove the card.
You can try it anytime, I'm just in the process of building some basic webpages and graphics but if you know the name of one of the files on the SD card then you can request that. So at the moment there is the log on page which is just a dummy test and there is also the 404 not found page.
URL: 58.174.90.227:81
Try:
58.174.90.227:81/EXTEND.FTH
etc
As soon as I test out a home page I will set that up as the default.
If you happen to telnet into the Prop instead you can talk to it in TF, remember that most action words are all capitals.
DIR
WORDS
W
cat W5200.FTH
<etc>
You can try it anytime, I'm just in the process of building some basic webpages and graphics but if you know the name of one of the files on the SD card then you can request that. So at the moment there is the log on page which is just a dummy test and there is also the 404 not found page.
URL: 58.174.90.227:81
Try:
58.174.90.227:81/EXTEND.FTH
etc
As soon as I test out a home page I will set that up as the default.
If you happen to telnet into the Prop instead you can talk to it in TF, remember that most action words are all capitals.
DIR
WORDS
W
cat W5200.FTH
<etc>
That prompted me to take a look at implementing HTTP the ...
If you noticed the WAN IP and port you are welcome to have a go, it's just a simple dialog at the moment but TELNET (console to Forth) and FTP (try FileZilla) are working on the normal ports although I have to fix FTP again after making some "improvements"
If I add file uploading to the FTP server then I can upload new webpages to the Prop rather than having to remove the card.
i HAD MY "GO" and itt was impressive .
achilles:~ brianbr$ telnet 58.174.90.227
Trying 58.174.90.227...
Connected to cpe-58-174-90-227.sicz1.cha.bigpond.net.au.
Escape character is '^]'.
WELCOME TO THE TACHYON WIZNET TELNET SESSION!
.LIST
PBJTECH-SDL
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0008.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0007.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0006.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0005.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0004.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0003.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0002.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0001.TXT
-rwxrwxrwx 1 502 500 1048576 Dec 3 2013 SYSLOG.TXT
-rwxrwxrwx 1 502 500 12343 Dec 3 2013 NETWORK.FTH
-rwxrwxrwx 1 502 500 11771 Dec 3 2013 W5200.FTH
-rwxrwxrwx 1 502 500 81674 Dec 3 2013 EXTEND.FTH
-rwxrwxrwx 1 502 500 16766 Dec 3 2013 SDCARD.FTH
-rwxrwxrwx 1 502 500 21466 Dec 3 2013 MULTIFAT.FTH
-rwxrwxrwx 1 502 500 3332 Nov 26 2013 CE1372.FTH
-rwxrwxrwx 1 502 500 279651 Nov 22 2013 TACHYON.LST
-rwxrwxrwx 1 502 500 32768 Nov 27 2013 ROM.BIN
-rwxrwxrwx 1 502 500 388 Dec 3 2013 HTTP001.TXT
-rwxrwxrwx 1 502 500 388 Dec 3 2013 HTTP001.HTM
-rwxrwxrwx 1 502 500 564 Dec 3 2013 HTTP404.HTM
-rwxrwxrwx 1 502 500 21603 Dec 3 2013 TACHYON.JPG
ok
ok
^]
telnet> q
Connection closed.
achilles:~ brianbr$
achilles:~ brianbr$ telnet 58.174.90.227
Trying 58.174.90.227...
Connected to cpe-58-174-90-227.sicz1.cha.bigpond.net.au.
Escape character is '^]'.
WELCOME TO THE TACHYON WIZNET TELNET SESSION!
.LIST
PBJTECH-SDL
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0008.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0007.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0006.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0005.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0004.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0003.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0002.TXT
-rwxrwxrwx 1 502 500 131072 Nov 4 2013 LOG0001.TXT
-rwxrwxrwx 1 502 500 1048576 Dec 3 2013 SYSLOG.TXT
-rwxrwxrwx 1 502 500 12343 Dec 3 2013 NETWORK.FTH
-rwxrwxrwx 1 502 500 11771 Dec 3 2013 W5200.FTH
-rwxrwxrwx 1 502 500 81674 Dec 3 2013 EXTEND.FTH
-rwxrwxrwx 1 502 500 16766 Dec 3 2013 SDCARD.FTH
-rwxrwxrwx 1 502 500 21466 Dec 3 2013 MULTIFAT.FTH
-rwxrwxrwx 1 502 500 3332 Nov 26 2013 CE1372.FTH
-rwxrwxrwx 1 502 500 279651 Nov 22 2013 TACHYON.LST
-rwxrwxrwx 1 502 500 32768 Nov 27 2013 ROM.BIN
-rwxrwxrwx 1 502 500 388 Dec 3 2013 HTTP001.TXT
-rwxrwxrwx 1 502 500 388 Dec 3 2013 HTTP001.HTM
-rwxrwxrwx 1 502 500 564 Dec 3 2013 HTTP404.HTM
-rwxrwxrwx 1 502 500 21603 Dec 3 2013 TACHYON.JPG
ok
ok
^]
telnet> q
Connection closed.
achilles:~ brianbr$
OBTW ... where is the FSEND Command ? Or is it still in the nursery?
OBTW ... where is the FSEND Command ? Or is it still in the nursery?
So you are on Telnet and if it's a text file you can just type the Linux command "cat" as in " cat EXTEND.FTH"
If you really want an FSEND command and you want to be verbose then type this (it should work):
pub FSEND
GETWORD FOPEN$ IF FILE@ FSIZE@ XTYPE ELSE ." What file!!!" CR CR THEN ;
IMMEDIATE
Then "FSEND EXTEND.FTH"
Your session report (I masked out part of the IP)
************ W5200 STATUS ************
LINK *UP*
CHIP VER 0003
SRC IP 192.168.016.150.
MASK 255.255.255.000.
GATEWAY 192.168.016.001.
MAC 00.08.03.52.40.72.
*** SOCKETS ***
0: MODE= TCP PORT#00023 51712 TXRW=B6AF.B6AF.RXRW=0000.001B.RXSZ=001B.IR=05 STAT=17 ESTABLISHED 071.169.***.***.
1: MODE= TCP PORT#00021 00000 TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00 STAT=14 LISTEN
3: MODE= TCP PORT#00081 58708 TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00 STAT=14 LISTEN
Very nicely done. I think it says all anybody needs to know about FORTH.
Thanks "spud", though it's funny working on it while users log in and out. Sometimes that's right when I've just pasted a new definition in while it's running and sometimes it does what it's supposed to too, not always. Right at the moment I'm checking out content headers so I can send binary such favicon.ico etc. There's a little bug somewhere that's inserting a couple of extra spaces before the transmission which I think is probably from the Forth console before it switches to quiet mode.
Ah yes, this miserable Forth is not good for anything, I should have listened to the Cperts
I recommend Teraterm (SourceForge version) for Windows, it's the best terminal emulator and you have full control over all the settings.
If you load the Tachyon kernel for the first time then it takes less than a minute to paste in EXTEND.fth plus any other words you have created, there is no real need for a binary save really unless you want to generate an image for production or field upgrades.
Hi Peter,
I guess the trick is to save my words in a txt file then :-)
I'll give teraterm a try, any recommendations for important settings?
I guess the trick is to save my words in a txt file then :-)
I'll give teraterm a try, any recommendations for important settings?
Yes, 230400 baud 8N1, no handshake, no character delay, and 20ms line delay. You can also grab my teraterm.ini file from Dropbox and place it in the teraterm directory.
If you use a text editor then please don't use the rubbish that comes with Windows. ConText is an older editor but very capable and I have a highlighter file for Forth (forth.chl) in Dropbox although the highlighter could probably be brought up-to-date, it's still useful.
I've just come back in to do some more work that I was in the middle of before so my apologies to anyone that tried to log on as it is a bit flakey while I am in the middle of some tests and changes. I am mainly just working on serving up content and making sure the server response headers are correct for HTTP. But that said you are welcome to try to log on to any of the services while bearing in mind that it might not work properly, or it might. There's nothing like performing surgery on an athlete while they are still doing all their Olympic warm-ups!
I've just come back in to do some more work that I was in the middle of before so my apologies to anyone that tried to log on as it is a bit flakey while I am in the middle of some tests and changes. I am mainly just working on serving up content and making sure the server response headers are correct for HTTP. But that said you are welcome to try to log on to any of the services while bearing in mind that it might not work properly, or it might. There's nothing like performing surgery on an athlete while they are still doing all their Olympic warm-ups!
STOP RIGHT NOW, I want that system taken offline, I want you to compile, link and download right now like the rest of us and then see if your small little fix or large change works, then you can put it back online until the next time you have to dis-appoint your clients. How dare you work on live systems, what are you some kind of production engineer with real clients doing real work?
Comments
FROM W5200.fth in the zip file (and dropbox) this word (!WIZIO) does not complie? No WRESET, WPWRDN defined anywhere?
Ah yes, I mentioned somewhere that I use hardware header files which define the pins and also any special functions of which WRESET and WPWRDN are in my system as they are accessed over I2C. But what I will do is include some IFNDEFs in the source to make sure it compiles properly if these have not been defined. I will also put one of my header files in the Tachyon folder for reference. There is also the function !PCB which is hardware specific initialization which is just a dummy word unless a new one is defined.
EDIT: I had updated the W5200.fth code and I notice that I already have a header file in there, the CE1372.fth file.
If you access the web document versions you will find the formatting and diagrams etc in there help.
Web document versions of the various modules are:
Tachyon V2.3
EXTEND.fth
CE1372.fth
SDCARD.fth
MULTIFAT.fth
W5200.fth
NETWORK.fth
That makes "error" sense.
Now it keeps hanging at line 217.
well - new to Google-Docs I discovered the scripts (which is kind of JavaScript) - was happy -
and wondered if I could write a converter to strip the stuff of (e.g. the code itself) that I do not want in my overview document.
Well - it would have been only a few lines of code - if Google had not decided to implement only a subset of REGEXP in it's
JavaScript version - how stupid.
If I find a good solution I let you know.
I'm assuming you have a new and clean system because the E! was introduced recently. I must report the load errors in a clearer fashion though. As a test I copied the web document and pasted that in without any problems.
EDIT: Just tried the Dropbox version and it works fine too although it only reports half the lines. I know the web document version seems to paste two LFs rather than a CRLF and previously I would ignore LFs altogether but now my system converts LFs to CRs if they are not part of a CRLF, hence the double line thing. BTW, don't use the zip files anymore, just the online versions, Dropbox seems to be working fine now.
Arrg, the last zip that was posted didn't have E!, verions mismatch, all better, thx Peter
IN the end I not only got it loaded but it was done at 230400 baud w/21ms line delay ..... up from 115200 baud and 60 ms.
Peter ... have you some sample code for redirecting output of .NUM to write to SD?
I am OK now. I spent a good part of the last 36 hours trying various combinations of baud rates, line delays, boards, compilers ... etc.
IN the end I not only got it loaded but it was done at 230400 baud w/21ms line delay ..... up from 115200 baud and 60 ms.
Peter ... have you some sample code for redirecting output of .NUM to write to SD?
I am OK now. I spent a good part of the last 36 hours trying various combinations of baud rates, line delays, boards, compilers ... etc.
IN the end I not only got it loaded but it was done at 230400 baud w/21ms line delay ..... up from 115200 baud and 60 ms.
Peter ... have you some sample code for redirecting output of .NUM to write to SD?
redirecting EMIT to the SD write routine should do the job, after the SD card is prepared, LOADMOD etc...
\ maybe you need to do s.th. in the end to clean up, close the file or whatever you do normally
\ - I have never used SD before - yet ...
maybe you can post a snipped you use to initialize, write and close ... thanks
Hi Brian,
There is an FSEND word that you can use to set the output to write sequentially into a file. Normally when a file is opened a write pointer is set to append to the file and FSEND takes the emit characters and does a simple append character by character. So bear in mind that the way I have decided to setup the file system may be at odds to traditional thinking, but it makes way more sense to me to treat the card like virtual memory and also to "preformat" the card with blanks files that are more than large enough that they never need to have extra clusters added or file size entries update continually. This takes away a lot of the problems associated with file systems and SD cards for embedded use vs PC HDDs or even camera SD file access. I will explain a bit more about this in the MULTIFAT document itself.
" MYFILE.TXT" FOPEN$ FSEND <do your voodoo> CON FCLOSE
Please note that the FSEND word is still a WIP and I will include a lot more features with it, at the moment there is only one FSEND pointer rather than one for each file and it resets to the start of the file when it's opened. I'm just looking at a way that I can avoid writing a file pointer to the card continually which is not a good thing for Flash. I do have my own methods for finding the end of a file which does not involve writing any pointer to Flash, would you be interested in a method I use?
BTW, the Dropbox links are not always the most up-to-date although I do try to update them often. If you go to the links page (via the Intro page) you will find a new entry called "suggested build" which has an entry for all the links to web document pages that I would use in a build. These are the same links
I mentioned in post #933.
Yes some documentation and a simple example (or did I miss this) would help right now. I've gotten this far but can see EXTEND.FTH on the FAT32 formated 2 GIG drive?
Well RTFM/Code helped alot, very nice Peter.
A new RECLAIM command has been added which removes all "private" headers from the dictionary and reclaims that memory, that includes those created with "pri" and those with the tag PRIVATE
WORDS has also been enhanced and can now filter results not just on a character or leading string but also on it's attribute field.
So besides: We can also:
HELP comments will also find a place in the top 32K of a 64K EEPROM. To make that work for words defined in the kernel and earlier in EXTEND I am allowing the comments to be compiled inline with the headers. Yikes!, that'll take a lot of the hub RAM but only up to the point that the EEPROM words become active and the help comments can be shunted up to EEPROM with MAKEHELP where WORDS and HELP will draw comments from. If you are typing in interactive mode then I may include a hint mode which will list the stack comment with a ^? and further comments with further ^? (control ? = $1F)
At present there are about 14 PASM longs taken up by the instruction CMPSTR which is mostly only used during compile. I want to free up that space for some more useful tricks in PASM so this instruction will be moved to bytecode which is slower but when the load control word TACHYON is executed then CMPSTR will vector to PASM CMPSTR loaded as a RUNMOD instruction.
The other compile-time/runtime optimization I am looking at is the console receiver cog in that I want it as a multi-channel serial port when it's not dedicated to high-speed serial receive during source-code compile. That way I can have COM1 COM2 COM3 COM4 I/O redirection without necessarily requiring another cog, although that's optional.
Also let me know if there is any sample code you might need for such things like the file system etc. The best sample code is actually to have a solution to a real requirement, so let me know.
I'm totally new to Forth and Tachyon. I played a little and made a BINARYDUMP. How do I get this image programmed into EEPROM? I tried hex2bin, but it fails. Can I load the hex image with BST? Ah, btw. Win8.
Hi Akkarin, I've copied my hex2bin.exe that I use into the Tachyon Dropbox folder so try that perhaps. After which you just rename it to .binary for the Prop tool. If it still has errors then it may have to do with your capture perhaps, are you copying from the screen buffer or straight to a file? Is there a particular reason you need a binary this early in your evaluation?
There's also another way of generating a binary now and that's via the SD card with SAVEROM if that's an option.
thanks for the hex2bin, but it doesn't run on 64-bit Windows.
I copied the Dump via C&P from PuTTy screen and then deleted empty lines with NotePad++. With empty lines I mean that PuTTy puts out CR LF every second line. So, every line ends with CR LF and every second line is empty, meaning only CR LF.
The reason I'd like to save the image is, that I want to try PropForth as well and don't want to lose my new words.
Currently I don't have an SD card hooked up.
I recommend Teraterm (SourceForge version) for Windows, it's the best terminal emulator and you have full control over all the settings.
If you load the Tachyon kernel for the first time then it takes less than a minute to paste in EXTEND.fth plus any other words you have created, there is no real need for a binary save really unless you want to generate an image for production or field upgrades.
This is what I saw: Now socket 0 happens to be the TELNET server and I haven't been using that but I do have port forwarding set so that the Prop gets any requests. So I decided to look at the receive buffer for that socket: It seems some bot was trying to connect on port 23 using generic user and password details blindly, interesting. Maybe I will set it up so that it captures and logs connection information to the SD card. I'd like to see them hack a Prop running Tachyon Forth!!!
Another great fun is to accept the connection, then send them a few megabytes in response... Random numbers are a great choice. So they make the request, you answer it, take the username they give, and then just start spraying line noise their way instead of a password prompt. Often they go away for a while.
That prompted me to take a look at implementing HTTP then. Developing code for this is real easy as I can type in a new directive such as GET and it executes automatically when a browser tries to connect:
Here's a request packet that's been echoed to the console (Including the GET notification):
The GET is interpreted by the Forth console and executes this word I typed in which looks up the webpage HTTP001.HTM to serve up from the SD card, in this case a simple security dialog:
If you noticed the WAN IP and port you are welcome to have a go, it's just a simple dialog at the moment but TELNET (console to Forth) and FTP (try FileZilla) are working on the normal ports although I have to fix FTP again after making some "improvements"
If I add file uploading to the FTP server then I can upload new webpages to the Prop rather than having to remove the card.
Can't wait to try this later: FORTH of all things
You can try it anytime, I'm just in the process of building some basic webpages and graphics but if you know the name of one of the files on the SD card then you can request that. So at the moment there is the log on page which is just a dummy test and there is also the 404 not found page.
URL: 58.174.90.227:81
Try:
58.174.90.227:81/EXTEND.FTH
etc
As soon as I test out a home page I will set that up as the default.
If you happen to telnet into the Prop instead you can talk to it in TF, remember that most action words are all capitals.
DIR
WORDS
W
cat W5200.FTH
<etc>
Really cool and fast FYI.
TACHYON
( EXTEND.fth )
pub EXTEND.fth ." Primary extensions to TACHYON kernel - 131124-0000 " ;
( link to the latest Tachyon kernel web document )
{
CONTENTS
Yes, and it's all running from the one cog, Forth, SD, Network, the lot! Wait until I delegate some cogs to handle that!
FYI, this is my console output when you connected:
i HAD MY "GO" and itt was impressive .
OBTW ... where is the FSEND Command ? Or is it still in the nursery?
So you are on Telnet and if it's a text file you can just type the Linux command "cat" as in " cat EXTEND.FTH"
If you really want an FSEND command and you want to be verbose then type this (it should work):
pub FSEND
GETWORD FOPEN$ IF FILE@ FSIZE@ XTYPE ELSE ." What file!!!" CR CR THEN ;
IMMEDIATE
Then "FSEND EXTEND.FTH"
Your session report (I masked out part of the IP)
************ W5200 STATUS ************
LINK *UP*
CHIP VER 0003
SRC IP 192.168.016.150.
MASK 255.255.255.000.
GATEWAY 192.168.016.001.
MAC 00.08.03.52.40.72.
*** SOCKETS ***
0: MODE= TCP PORT#00023 51712 TXRW=B6AF.B6AF.RXRW=0000.001B.RXSZ=001B.IR=05 STAT=17 ESTABLISHED 071.169.***.***.
1: MODE= TCP PORT#00021 00000 TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00 STAT=14 LISTEN
3: MODE= TCP PORT#00081 58708 TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00 STAT=14 LISTEN
CONNECT SOCKET #0 2013/12/03 11:33:25
CLOSING SOCKET #0 2013/12/03 11:33:53
Very nicely done. I think it says all anybody needs to know about FORTH.
Thanks "spud", though it's funny working on it while users log in and out. Sometimes that's right when I've just pasted a new definition in while it's running and sometimes it does what it's supposed to too, not always. Right at the moment I'm checking out content headers so I can send binary such favicon.ico etc. There's a little bug somewhere that's inserting a couple of extra spaces before the transmission which I think is probably from the Forth console before it switches to quiet mode.
Ah yes, this miserable Forth is not good for anything, I should have listened to the Cperts
Hi Peter,
I guess the trick is to save my words in a txt file then :-)
I'll give teraterm a try, any recommendations for important settings?
Yes, 230400 baud 8N1, no handshake, no character delay, and 20ms line delay. You can also grab my teraterm.ini file from Dropbox and place it in the teraterm directory.
If you use a text editor then please don't use the rubbish that comes with Windows. ConText is an older editor but very capable and I have a highlighter file for Forth (forth.chl) in Dropbox although the highlighter could probably be brought up-to-date, it's still useful.
STOP RIGHT NOW, I want that system taken offline, I want you to compile, link and download right now like the rest of us and then see if your small little fix or large change works, then you can put it back online until the next time you have to dis-appoint your clients. How dare you work on live systems, what are you some kind of production engineer with real clients doing real work?
Really nice Peter, really!