Shop OBEX P1 Docs P2 Docs Learn Events
Load/Execute binaries via serial? — Parallax Forums

Load/Execute binaries via serial?

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2009-11-25 14:10 in Propeller 1
Has anyone done a solution to load/execute binaries through serial?

something along the lines of what Femtobasic does except from a
connected PC or Prop via Propplug/serial?

A serial modification of FSRW might make a nice drop-in for folks without SD attached.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages @ Warranty Void.

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-24 16:41
    OBC: Can You explain a little more please? Are you wanting a pc program to look like an SD card file system via USB/serial access?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-11-24 16:44
    That's the direction I'm thinking.. Something along the lines of a FSRW that communicates with the PC over the Propplug. I'm also looking into a VMUSIC type solution as well.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • ericballericball Posts: 774
    edited 2009-11-24 17:26
    Oldbitcollector said...
    A serial modification of FSRW might make a nice drop-in for folks without SD attached.
    Hmm... replace the block routines with serial I/O.· Conceptually not that difficult.· ReadBlock sends the "Read block #", then does a serial getbyte.· The trick then is to create the disk interface on the other end.

    Something like the old Atari SIO protocol would work:
    http://ftp.pigwa.net/stuff/collections/nir_dary_cds/Tech Info/The SIO protocol description/sio.html said...
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The SIO protocol description

    Written by Draco, 18.IX.1996. Last update 7.XI.1996.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    What is the SIO?The SIO stands for the "Serial Input/Output". It is a data transfer protocol used by the Atari 8-bit machines to communicate with a printer, disk drive, modem etc. via the SIO connector. These transfers are controlled by the POKEY chip.
    Is this something like RS-232?Basically, yes. It is possible to connect the SIO port to a RS-232 port, the only one you should change is the voltage: the SIO uses TTL-signals. Serial transfer parameters usually are as follows:
    • 1 start bit
    • 1 stop bit
    • 8 data bits
    • no parity control
    • 19200 bits per second
    The last parameter may vary, as for example so called "cassette recorders" (who can remember such data storage?) use 600 baud; also some disk drives may operate at 38400, 52000, 67000, 96000 or 125000 baud.
    SIO commandsThe command block contains 4 (four) bytes:
    • CDEVIC - device ID, e.g. $31 for the D1:, $32 for the D2: etc.
    • CCMND - command
    • CAUX1
    • CAUX2 - sector number (low/high)
    Most commonly used commands (DCMND values) for disk drives are as follows:
    • $50 (P) - put a sector (128 or 256 data bytes to the drive)
    • $52 (R) - read a sector (128 or 256 data bytes from the disk drive)
    • $53 (S) - read status (4 data bytes from the drive)
    • $57 (W) - write sector (the same as P command, but with verify)
    • $21 (!) - format disk (128 data bytes from the drive)
    • $22 (") - format disk in the medium density (128 data bytes from the drive)
    • $4E (N) - read configuration (12 data bytes from the drive)
    • $4F (O) - set configuration (12 data bytes to the drive)
    Communication
    • first, the computer sets the COMMAND line at the SIO connector
    • then sends the command block (4 bytes + checksum)
    • then waits for a response (1 byte without a checksum):
      • $41 (A) = Acknowledge, the command is valid and will be executed
      • $4E (N) = Negative, the command is invalid.
    • if the device responds "N", the transfer is aborted.
    • otherwise ("A") the data block is transferred with the checksum.
    • now the computer waits for a final acknowledge (1 B without a checksum):
      • $43 (C) = Complete, operation completed successfully.
      • $45 (E) = an Error has occurred.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum


    Post Edited (ericball) : 11/24/2009 5:43:45 PM GMT
  • ericballericball Posts: 774
    edited 2009-11-24 17:52
    More SIO details at http://web.archive.org/http://www2.asw.cz/~kubecj/asio.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-11-24 21:26
    Eric,

    Good information! Thanks!

    I was considering what it might take to do a Propeller based Zmodem protocol as
    it would "auto-start" the transfer from a compatible terminal. This might eliminate
    the need to recreate the wheel, that is unless there is already an Atari SIO server
    written for the PC?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • RossHRossH Posts: 5,519
    edited 2009-11-24 22:15
    @OBC,

    Check out the Generic_SD_Loader and Generic_SIO_Loader programs that are provided as Catalina utilities. The SD loader can either load programs from SD card into the local CPU and execute it, or send it using a serial protocol to another CPU running the SIO loader (which then executes it).

    They work for both normal SPIN/PASM programs and Catalina programs (hence the "generic" bit). I intend to write a PC program that will do the same over a PropPlug (the Generic_SIO_Loader program will already accept that) but I haven't had time yet.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-11-24 22:35
    RossH

    Thanks I'll give that a look...

    I was under the impression that Atari was the originator of the SIO protocol in their 8bit machines?
    I'm getting the impression that they don't have the corner on the market there? [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-24 22:43
    Dr_Acula has done xmodem for the ZiCog - in Z80. That could be a start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-11-24 22:49
    I wrote an Xmodem translation for the Prop, but I'm interested in something along the lines of Zmodem's autostart.

    Already reviewing the specification... [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • RossHRossH Posts: 5,519
    edited 2009-11-24 22:54
    @OBC,

    Sorry, I may have misled you. I just meant SIO as shorthand for "Serial I/O" - the actual serial protocol I use is quite trivial, and is not the Atari "SIO" - although I wish I had seen the Atari one a few days ago, since I've just extended my own SIO protocol to handle keyboard, mouse, screen and SD Card access transparently from one Prop to another when used in a multi-prop system (such as Morpheus or the TriBladeProp). This will be included in the next release of Catalina, to be released shortly ("shortly" as measured in units of geological time).

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-25 01:17
    OBC:
    Does Zmodem take a command to request a file by name ? If so, then I can see where you are going with this. Suggest you ask Drac. He has many versions of X/Y/Z modem.

    Or are you after a pc program (windoze/unix/mac) that will function like an SD card with calls from a prop cog simulating it is connected to an SD card but in reality it is a pc via serial/USB?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • AribaAriba Posts: 2,690
    edited 2009-11-25 13:41
    Oldbitcollector said...
    Has anyone done a solution to load/execute binaries through serial? ...
    OBC

    PropTerminal can do that. You can send a request to PropTerminal which includes the filename. PropTerminal then uploads the binary into RAM or EEPROM depending of the extension. You can also request a text file which is then sent in 16 Byte packets, and you can save a text file on the PC harddisk.

    But it can not emulate FSRW and can also not provide a directory of the files available to download.
    Emulating FSRW would be very slow and it would be not possible to play Wave files and such things.

    Andy
  • ericballericball Posts: 774
    edited 2009-11-25 14:10
    I wouldn't recommend using the ATARI SIO protocol verbatim, but I think the general idea could be used.
    1. Prop sends command block to PC.
    byte 0 - device ID
    byte 1 - command
    byte 2-5 - long parameter 1 (i.e. block address)
    byte 6-9 - long parameter 2 (i.e. # of bytes)
    byte 10 - checksum (sum of bytes 0-10 == $00)
    

    2. PC provides 1 byte response to command (MSB set=error, transfer aborted)
    3. Prop or PC performs data transfer with checksum/CRC
    4. PC or Prop provides 1 bytes response to data transfer (MSB set=error, transfer aborted)



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
Sign In or Register to comment.