Dear All,
I have built a serial cable recently.
I have Linux COM2 port at one end, QL SER2 on the other.
No TK2, only 128K, JS ROM so far.
This enables communication at 2400 bauds at Linux end
$ stty -F /dev/ttyS1 2400 cs8 clocal cstopb raw crtscts
This sets baud rate on the QL
BAUD 2400
I can load or save SUPERBASIC programs over SER2.
LOAD SER2 or LOAD SER2HR
SAVE SER2 or SAVE SER2HR
On Linux I have to type e.g.
$ cp MYPROG_BAS /dev/ttyS1 .......... sending to the QL
$ cp /dev/ttyS1 MYPROG_BAS .......... receiving from the QL
Seems to work alright.
HOWEVER
HOW CAN I EXECUTE A BINARY?????
E.G. I have a QED editor binary
I have constructed a file header, 64 bytes, hexdump follows
00000000 00 00 1E DC 00 01 00 00 06 00 00 00 00 00 00 03 ................
00000010 51 45 44 00 00 00 00 00 00 00 00 00 00 00 00 00 QED.............
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
I concatenate the header and binery and send it down the line
$ cat QED.HDR QED > /dev/ttyS1
On the QL I type,
EXEC SER2HR
But I am getting...... bad parameter
Please can anyone HELP?
Many thanks
TCAT
EXEC binary over SER2
-
- RWAP Master
- Posts: 2893
- Joined: Sun Nov 28, 2010 4:51 pm
- Location: Stone, United Kingdom
- Contact:
Re: EXEC binary over SER2
The header looks correct, but the QL exec command does not expect to read the header from the file itself - it is stored in the device directory entry for the file.
You would need a program on the QL end to read the file header and then use that to construct a SEXEC command to store the file locally on the QL....
You would need a program on the QL end to read the file header and then use that to construct a SEXEC command to store the file locally on the QL....
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
Re: EXEC binary over SER2
Assuming the QL would really send the header preceding the binary on a serial line (which I really think is the case) Keep in mind the manual says:
So, if you "exec ser2_", I guess the QL will expect this $FF byte and slice it off. No wonder your program is garbled
You could try preceding your header with $FF as well.
It would probably be far easier to send the file from a QL emulator on the PC side - You wouldn't have to cope at least with those details
BTW: Most "exec" programs can simply be run using LBYTES and CALL - They will just crash when you quit them. Maybe you start from there?
Regards,
Tobias
(Note how this also somewhat implies that not all 64 Bytes of the header go on the line)When a header is sent over a pure serial device, then the 14 bytes of the header are preceded by a byte $FF
So, if you "exec ser2_", I guess the QL will expect this $FF byte and slice it off. No wonder your program is garbled

It would probably be far easier to send the file from a QL emulator on the PC side - You wouldn't have to cope at least with those details

BTW: Most "exec" programs can simply be run using LBYTES and CALL - They will just crash when you quit them. Maybe you start from there?
Regards,
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: EXEC binary over SER2
All,
I've gone through the literature again. To me it seems that when sending an executable file over a serial line, the QL wil send/expect $FF plus the first 14 bytes of the 64-byte header information (that is, everything before the file name) followed by the file content.
When the manual says "the buffer supplied for the heade must at least be 14 bytes long" - That also implies that the $FF in front of the header is already sliced off by the OS.
It might make sense to insert a short pause between the header and the actual executable, as the QL will need a bit of time to allocate memory and create a job in the transient memory area after it has seen the header.
It might also make sense to simply do a dummy "SEXEC ser2_,20000,100,1234" on the QL and analyse what's actually being received from that on the PC in order to be able to verify this.
Regards,
Tobias
I've gone through the literature again. To me it seems that when sending an executable file over a serial line, the QL wil send/expect $FF plus the first 14 bytes of the 64-byte header information (that is, everything before the file name) followed by the file content.
When the manual says "the buffer supplied for the heade must at least be 14 bytes long" - That also implies that the $FF in front of the header is already sliced off by the OS.
It might make sense to insert a short pause between the header and the actual executable, as the QL will need a bit of time to allocate memory and create a job in the transient memory area after it has seen the header.
It might also make sense to simply do a dummy "SEXEC ser2_,20000,100,1234" on the QL and analyse what's actually being received from that on the PC in order to be able to verify this.
Regards,
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: EXEC binary over SER2
All,
Just to let you know, I tried following...
$ cat FF.B QED.HDR QED > /dev/ttyS1
Where,
FF.B is a file containing a single byte of the $ff value
QED.HDR is trunctaed header to 14 bytes
QED actual binary
IT WORKS!
I was not able to set higher rate than 2400 bauds so far.
BTW where in the QL manuals is it said about $FF and 14 header file?
Many thanks
TCAT
Just to let you know, I tried following...
$ cat FF.B QED.HDR QED > /dev/ttyS1
Where,
FF.B is a file containing a single byte of the $ff value
QED.HDR is trunctaed header to 14 bytes
QED actual binary
IT WORKS!
I was not able to set higher rate than 2400 bauds so far.
BTW where in the QL manuals is it said about $FF and 14 header file?
Many thanks
TCAT
Re: EXEC binary over SER2
Nice to hear.tcat wrote: IT WORKS!
That is quite normal. The QL's serial ports aren't known to be very reliable on high(er) baud rates. You might want to invest in a Hermes or SuperHermes to improve that (significantly)tcat wrote: I was not able to set higher rate than 2400 bauds so far.
I would have tested myself, probably, but none of my QL and alikes is rigged for serial comms nowadays.
BTW the information comes from the "QL Technical Guide", the "Developer's Handbook" for the QL, Pages on FS.HEADS and FS.HEADR system calls. Available from several places, WoS has an OCR'ed one, I think. (I've got one in stained and yellowed paper, purchased new for 79DM in Munich back in 1988. Yes, QLing has never been cheap

Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
-
- RWAP Master
- Posts: 2893
- Joined: Sun Nov 28, 2010 4:51 pm
- Location: Stone, United Kingdom
- Contact:
Re: EXEC binary over SER2
Dilwyn,
Any chance you could update the page on file headers on your website:
http://www.dilwyn.me.uk/docs/formats/filehedr.txt
It would be useful to update this document with the information for headers went sent over serial ports
Any chance you could update the page on file headers on your website:
http://www.dilwyn.me.uk/docs/formats/filehedr.txt
It would be useful to update this document with the information for headers went sent over serial ports
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
Re: EXEC binary over SER2
Done.RWAP wrote:Dilwyn,
Any chance you could update the page on file headers on your website:
http://www.dilwyn.me.uk/docs/formats/filehedr.txt
It would be useful to update this document with the information for headers went sent over serial ports
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
-
- RWAP Master
- Posts: 2893
- Joined: Sun Nov 28, 2010 4:51 pm
- Location: Stone, United Kingdom
- Contact:
Re: EXEC binary over SER2
Is it?? Not here!dilwyn wrote:Done.RWAP wrote:Dilwyn,
Any chance you could update the page on file headers on your website:
http://www.dilwyn.me.uk/docs/formats/filehedr.txt
It would be useful to update this document with the information for headers went sent over serial ports
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm