The protocol is pretty simple. You start things by sending simple ASCII strings.
Here is what to do step-by-step:
- Tell the PSX that you want to upload a binary file by sending "bwr",$0d.
- Now wait for the PSX to return the string "bwr",$0d,$0a,"binary",$0d. When you get this the PSX is ready to receive data.
- Now you must tell the PSX the load address and size of your data. This is done by sending the following structure:
- byte: $01
- int32: Address (Note that this must be in big-endian format!)
- int32: Size (The size must be the total size in bytes of the file to send. Note that this must also be in big-endian format)
- Now you must wait some milliseconds before proceeding (experiment). If you don't wait long enough you'll probably get some sync errors from the PSX.
- Then it's time to send the actual data. Data is transfered in 2K packets using this structure:
- byte: $02
- byte: 2048 bytes of data
- byte: Checksum (This is calculated simply by adding all of your data bytes together)
- Now wait for the PSX to return the character 'Y'. When you get this it means that the packet was received without problems. If you don't receive anything then something went wrong!
- Go to 4 until you have transfered all your data.
- Now send $0d. The PSX will answer with a long string starting with "end binary" and ending with ">>". Wait for this.
- That's it!
You might want to check out a hex dump of what you will receive during an upload.
You can download the source for my Amiga upload-tool if you want. It will also show you how to interpret the PSX executables and you'll get some functions that parses the SIOCONS batch-files. It's a very early version so you will probably find weird debugging code here and there.
Document maintained by Jon Rocatis