Page 2 of 3

Re: Pascal Crosscompiler Advice

Posted: Sun Apr 18, 2021 7:14 am
by NormanDunbar
Chain-Q wrote:If any of the above doesn't work how I described, that's a bug, please report and it will be fixed.
It's all fine, thanks. Derek needed to upgrade QPC to version 5.x to execute files created with the -WQqhdr option.

Cheers,
Norm.

Re: Pascal Crosscompiler Advice

Posted: Sun Apr 18, 2021 7:16 am
by NormanDunbar
mk79 wrote:At last! Somebody who actually listens to me :-D
I did promise to try it out! ;) Works perfectly. Thanks for the hint.

Cheers,
Norm.

Re: Pascal Crosscompiler Advice

Posted: Sun Apr 18, 2021 10:10 am
by Derek_Stewart
Hi,

I think everything is working, I can execute a QDOS cross-compiled Pascal programme in all emulators: Qemulator, QPC2 v5, SMSQmulator using the SFA device.

I think I need to read the documentation again, especially the Free Pascal documentation.

Without the saving of the corss-compiled programme with one of the above emulators, is there an extension that can be added to Minerva so that real QL hardware could access the compiled programme from a non-QL environment?

Re: Pascal Crosscompiler Advice

Posted: Sun Apr 18, 2021 2:05 pm
by Peter
Not 100% sure what you mean, but if you refer to executable transfer without emulator, you could use qxltools and QLWA image on SD card. Or, in case of the Q68, ethernet and TFTP. Both support the XTcc flag.

Re: Pascal Crosscompiler Advice

Posted: Sun Apr 18, 2021 9:38 pm
by mk79
Chain-Q wrote:2., there's -WQxtcc instead, which results in an XTcc style trailer (and the QHDR omitted), which means the cross compiled executable runs in QPC2 and SMSQmulator, and allows easy transfer to real hardware, without any further Q-emuLator magic or post processing (Fix me?).
Fix: :-) XTcc format was introduced by the XTC68 compiler. It is not supported natively by any emulator. The most common way to use it was a specially compiled version of the InfoZIP zip utility, which could recognise the trailer and generate a QL-style ZIP file with it. Nowadays there are probably a few more utilities that use it, after all it's very easy to consume. A few lines of BASIC are enough.

For QPC after long deliberation I have decided to support the header style introduced by QemuLator (and also adapted by SMSQmulator, though in a somewhat weird way). XTcc is not an option for this as it's too limiting and hurts performance even more.

All the best, Marcel

Re: Pascal Crosscompiler Advice

Posted: Mon Apr 19, 2021 9:28 am
by Derek_Stewart
Hi,

I forgot about the new QL networking facilities and was thinking of transfer of compiled programmes to a QL via a floppy disk. Clearly out of date and uneducated thinking.

I am sorry for being guilty of not reading all the documentation, I see the Q68 has the XTcc trailer support, so transfer to the Q68 over the ethernet will be no problems.

If the crosscompiled programme is required to be send to a QL running QDOS or Minerva, the easiest solution is to network the QL via QLUB to QPC2 v5, where QPC2 v5 as a network file server and adds the correct QDOS executable file header.

I suppose there would have to be a filter in QPC2 v5 to add the QODS header, or does QPC2 v5 add the header when the QL connects to the QLUB Network share?

Re: Pascal Crosscompiler Advice

Posted: Mon Apr 19, 2021 10:05 am
by mk79
Derek_Stewart wrote:I suppose there would have to be a filter in QPC2 v5 to add the QODS header, or does QPC2 v5 add the header when the QL connects to the QLUB Network share?
Not sure what you mean here. For SMSQ/E the header ist just "there" like on any normal QL device. And if the network layer handles the header, too (once QLUB is TK2 compatible this will be the case, but not yet I think) then it will just work.

Re: Pascal Crosscompiler Advice

Posted: Tue Apr 20, 2021 3:45 pm
by martyn_hill
Hi Derek (and Marcel)!

Just for reference, even in its current state, the QLUB adapter plus the SBasic file-transfer implementation (SendFileMQ) happily manages QDOS file-headers such as would be needed to successfully transfer from QPC (or other emulator) to a native QL with any Task headers kept intact. This assumes that the source file is already on a QDOS medium or otherwise provided by, for example, QPC's new header management on non QDOS medium.

The same will of course apply equally once the work is complete on the TK2-compatible NET/FSERVE device driver (steadily progressing...)

Re: Pascal Crosscompiler Advice

Posted: Tue Apr 20, 2021 4:17 pm
by Peter
If an emulator ist used anyway, the crosscompiled executables can also be transferred via SERNET, keeping the header.

Re: Pascal Crosscompiler Advice

Posted: Tue Apr 20, 2021 4:30 pm
by Peter
Derek_Stewart wrote:I see the Q68 has the XTcc trailer support, so transfer to the Q68 over the ethernet will be no problems.
To precise, the recent TFTP programs have this XTcc trailer support: http://www.wlenerz.com/qlstuff/tftp.zip
Technically those programs are not Q68 specific, it is just the first native hardware where the required UDP driver support was released.

(Which reminds me that I forget to provide an ethernet card to someone wanting to extend this to the Q40/Q60.)