Shop OBEX P1 Docs P2 Docs Learn Events
TACHYON O/S V3.0 JUNO - Furiously Fast Forth, FAT32+LAN+VGA+RS485+OBEX ROMS+FP+LMM+++ - Page 32 — Parallax Forums

TACHYON O/S V3.0 JUNO - Furiously Fast Forth, FAT32+LAN+VGA+RS485+OBEX ROMS+FP+LMM+++

12930323435109

Comments

  • D.PD.P Posts: 790
    edited 2013-11-27 01:40
    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
    ;
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-27 04:54
    D.P wrote: »
    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.

    Web document versions of the various modules are:
    Tachyon V2.3
    EXTEND.fth
    CE1372.fth
    SDCARD.fth
    MULTIFAT.fth
    W5200.fth
    NETWORK.fth
  • D.PD.P Posts: 790
    edited 2013-11-27 11:18
    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.
    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!     
    
  • MJBMJB Posts: 1,235
    edited 2013-11-27 13:26
    ... 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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-27 14:25
    D.P wrote: »
    That makes "error" sense.

    Now it keeps hanging at line 217.
    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.
  • D.PD.P Posts: 790
    edited 2013-11-27 21:20
    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
    !WIZIO  ok
    !WIZIP  ok
    WIZ? 
    ************ W5200 STATUS ************ 
    LINK DOWN
    CHIP VER  0003
    SRC IP    192.168.016.150.
    MASK      255.255.255.000.
    GATEWAY   192.168.016.001.
    MAC       00.08.83.68.0D.76.
    *** SOCKETS *** 
    0: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    1: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    2: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    3: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    4: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    5: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    6: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
    7: MODE= CLOSED PORT#0000 0000   TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00   STAT=00 CLOSED
     ok
    
    
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-27 22:26
    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?


    ----------------------------------------------------------------
    REBOOT 
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    NAMES:  $5633...7309 for 7382 (0744 bytes added)
    CODE:   $0000...402F for 9049 (2025 bytes added)
    CALLS:  0334 vectors free
    RAM:    5636 bytes free
    
    AUTORUN BOOT
    MODULES LOADED: 
    3846: MULTIFAT.fth        FAT32/16 MultiFile Layer V1.1 131111-0000 
    30D7: SDCARD.fth          SD CARD Toolkit - 131114.0000 
    2F21: EXT_BBR.fth         BBR I/O re-dir & Extensions   - 20130728.0000
    1900: EXTEND.fth          Primary extensions to TACHYON kernel - 131124-0000 
    
    ----------------------------------------------------------------
    


    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?


    ----------------------------------------------------------------
    REBOOT 
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    NAMES:  $5633...7309 for 7382 (0744 bytes added)
    CODE:   $0000...402F for 9049 (2025 bytes added)
    CALLS:  0334 vectors free
    RAM:    5636 bytes free
    
    AUTORUN BOOT
    MODULES LOADED: 
    3846: MULTIFAT.fth        FAT32/16 MultiFile Layer V1.1 131111-0000 
    30D7: SDCARD.fth          SD CARD Toolkit - 131114.0000 
    2F21: EXT_BBR.fth         BBR I/O re-dir & Extensions   - 20130728.0000
    1900: EXTEND.fth          Primary extensions to TACHYON kernel - 131124-0000 
    
    ----------------------------------------------------------------
    


    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?


    ----------------------------------------------------------------
    REBOOT 
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    NAMES:  $5633...7309 for 7382 (0744 bytes added)
    CODE:   $0000...402F for 9049 (2025 bytes added)
    CALLS:  0334 vectors free
    RAM:    5636 bytes free
    
    AUTORUN BOOT
    MODULES LOADED: 
    3846: MULTIFAT.fth        FAT32/16 MultiFile Layer V1.1 131111-0000 
    30D7: SDCARD.fth          SD CARD Toolkit - 131114.0000 
    2F21: EXT_BBR.fth         BBR I/O re-dir & Extensions   - 20130728.0000
    1900: EXTEND.fth          Primary extensions to TACHYON kernel - 131124-0000 
    
    ----------------------------------------------------------------
    
  • MJBMJB Posts: 1,235
    edited 2013-11-28 12:17
    Hi Brian,
    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...
     ' SD! uemit W! 
    \ then do normal .NUM or what ever output you desire
    0 uemit W!  \ or   uemit W~  will set it back
    CON   \ should set it back too
    
    

    \ 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
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-28 18:48
    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.
  • D.PD.P Posts: 790
    edited 2013-11-28 20:32
    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?
    SD 
    Card inserted 
    MFG                 03
    OEM                 SD
    PID                 SU08G
    REV                 80
    S/N                 9262.AD21
    DATE                2013/10
    CRC                 28
      CSD REGISTER      
    *SDHC CARD* 
    TACC                100ns
    NSAC                0bps
    TRANS               50MHz
    BLKLEN              512
    SIZE                7,579MB
    ________________________________
     ok
    ls      NO NAME    
    LOG0008 .TXT     ROM     .BIN     SYSLOG  .TXT     
    LOG0001 .TXT     LOG0002 .TXT     LOG0003 .TXT     LOG0004 .TXT     LOG0005 .TXk
    DIR     NO NAME    
    
    LOG0008 .TXT .....a 0000.4040    29/11/2013 00:11:00   131,072
    ROM     .BIN .....a 0000.4140    29/11/2013 00:12:54   32,768
    SYSLOG  .TXT .....a 0000.4180    29/11/2013 00:12:24   1,048,562
    LOG0001 .TXT .....a 0000.4980    29/11/2013 00:11:36   131,072
    LOG0002 .TXT .....a 0000.4A80    29/11/2013 00:11:32   131,072
    LOG0003 .TXT .....a 0000.4B80    29/11/2013 00:11:26   131,072
    LOG0004 .TXT .....a 0000.4C80    29/11/2013 00:11:22   131,072
    LOG0005 .TXT .....a 0000.4D80    29/11/2013 00:11:16   131,072
    LOG0006 .TXT .....a 0000.4E80    29/11/2013 00:11:12   131,072
    LOG0007 .TXT .....a 0000.4F80    29/11/2013 00:11:06   131,072 ok
    

    Well RTFM/Code helped alot, very nice Peter.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-01 23:20
    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]RECLAIM 
    Removing .VECTORS
    Removing .RUNTIME
    Removing .CLKFREQ
    <etc>
    Removing @ATR
    Removing LEMIT
    Reclaimed 382 bytes  ok
    [/FONT]
    

    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:
    [FONT=courier new]ANY * WORDS 
    NFA  PFA  EXT ATRS NAME 
    ----------------------- 
    6B53 003E     ..    code 2*
    6BE3 00F7     ..    code UM*
    6FDC 0000     ..    codx *
    73EE 185E     ..    codx *end*   ok
    
    MATCH PIN WORDS 
    NFA  PFA  EXT ATRS NAME 
    ----------------------- 
    62A5 24FD YBE ..    pub  PINS
    62AD 24CB XBE ..    pub  PINLOAD?
    6938 18FB Y1B ..    pub  PINS@
    694B 18F5 Y19 ..    pub  PINCLR
    6974 18E5 Y14 ..    pub  PIN!    ok
    [/FONT]
    
    We can also:
    [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.
  • AkkarinAkkarin Posts: 43
    edited 2013-12-02 02:18
    Hi,

    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.

    Hex Image.jpg
    hex2bin fail.PNG
    Tachyon Version.PNG
    1024 x 618 - 74K
    677 x 223 - 11K
    679 x 429 - 8K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 04:30
    Akkarin wrote: »
    Hi,

    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.

    Hex Image.jpg
    hex2bin fail.PNG
    Tachyon Version.PNG

    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.
  • AkkarinAkkarin Posts: 43
    edited 2013-12-02 06:06
    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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 06:49
    Akkarin wrote: »
    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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 07:03
    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:
    [FONT=courier new]CONNECT   SOCKET #0 2013/12/03 00:13:52
      CLOSING SOCKET #0 2013/12/03 00:13:53
    CONNECT   SOCKET #0 2013/12/03 00:23:00
    <etc>
    [/FONT]
    
    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:
    [FONT=courier new]$C000 $800 WDUMP 
    0000_C000:   72 6F 6F 74  0D 0A 61 64   6D 69 6E 0D  0A F6 BB EF   root..admin.....
    [/FONT]
    
    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!!!
  • potatoheadpotatohead Posts: 10,261
    edited 2013-12-02 07:57
    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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 09:46
    potatohead wrote: »
    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):
    [FONT=courier new][B]GET REQUEST[/B] 
    / HTTP/1.1
    Host: 58.174.90.227:81
    User-Agent: Mozilla/5.0 (Android; Mobile; rv:25.0) Gecko/25.0 Firefox/25.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    [/FONT]
    
    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.
  • D.PD.P Posts: 790
    edited 2013-12-02 16:57
    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):
    [FONT=courier new][B]GET REQUEST[/B] 
    / HTTP/1.1
    Host: 58.174.90.227:81
    User-Agent: Mozilla/5.0 (Android; Mobile; rv:25.0) Gecko/25.0 Firefox/25.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    [/FONT]
    
    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.

    Can't wait to try this later: FORTH of all things
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 17:09
    D.P wrote: »
    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>
  • D.PD.P Posts: 790
    edited 2013-12-02 17:15
    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
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 17:18
    D.P wrote: »
    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:
    [FONT=courier new]************ 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 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    1: MODE= TCP    PORT#00021 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    3: MODE= TCP    PORT#00081 58687  TXRW=37E9.37E9.RXRW=0000.013D.RXSZ=013D.IR=05  STAT=17 ESTABLISHED    000.000.000.000.
    
    CONNECT   SOCKET #3 2013/12/03 11:20:23
    GET REQUEST for /EXTEND.FTH
    HTTP/1.1
    Host: 58.174.90.227:81
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    DNT: 1
    Connection: keep-alive
    
    
      CLOSING SOCKET #3 2013/12/03 11:20:38
    ************ 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 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    1: MODE= TCP    PORT#00021 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    3: MODE= TCP    PORT#00081 58688  TXRW=65CE.65CE.RXRW=0000.0120.RXSZ=0120.IR=05  STAT=17 ESTABLISHED    000.000.000.000.
    
    CONNECT   SOCKET #3 2013/12/03 11:20:39
    GET REQUEST for /favicon.ico
    HTTP/1.1
    Host: 58.174.90.227:81
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0
    Accept: image/png,image/*;q=0.8,*/*;q=0.5
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    DNT: 1
    Connection: keep-alive
    
    
      CLOSING SOCKET #3 2013/12/03 11:20:39
    ************ 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 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    1: MODE= TCP    PORT#00021 00000  TXRW=0000.0000.RXRW=0000.0000.RXSZ=0000.IR=00  STAT=14 LISTEN 
    3: MODE= TCP    PORT#00081 58692  TXRW=8FFA.8FFA.RXRW=0000.0000.RXSZ=0000.IR=01  STAT=17 ESTABLISHED    000.000.000.000.
    
    CONNECT   SOCKET #3 2013/12/03 11:20:40
      CLOSING SOCKET #3 2013/12/03 11:20:45
    
    [/FONT]
    
  • Brian RileyBrian Riley Posts: 626
    edited 2013-12-02 17:24
    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?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 17:37
    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
  • potatoheadpotatohead Posts: 10,261
    edited 2013-12-02 20:49
    Excellent!

    Very nicely done. I think it says all anybody needs to know about FORTH. :)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 21:03
    potatohead wrote: »
    Excellent!

    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 :)
  • AkkarinAkkarin Posts: 43
    edited 2013-12-02 23:00
    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?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-02 23:13
    Akkarin wrote: »
    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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-12-03 04:08
    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!
  • D.PD.P Posts: 790
    edited 2013-12-03 09:42
    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?

    Really nice Peter, really!
Sign In or Register to comment.