Page 1 of 2

QDOS-GCC How to run the binaries?

Posted: Sat Jan 26, 2019 4:03 pm
by Fabrizio
Hi everyone,

I am trying to use XTC68 (and not QDOS-GCC as I wrote initially).
I have managed to build the version at: https://github.com/stronnag/xtc68

This version has no crt.o, no headers and no libs and no instructions on how to install them other than a link to http://www.dilwyn.me.uk/c/index.html
No instructions on how to use the compiler, either :-( I would like to know which options are available.
In the linked pages I can find crt.o and the libs. I have managed to manually put them at the right locations and rename them to their expected names.
The repository has a Perl script that maybe does the installation of libs and headers but I am not able to understand how to use it.
Anyway, I have managed to compile a "Hello World" example.

Now the most serious problem for me is to figure out how to run the obtained binaries:
- Do I need to convert these binaries to some specific tape/disk images? With which tools?
- Which emulator(s) should I use and how do I load and run the binary?

Fabrizio

P.S.: The ultimate goal is to make a QL version of my universal retro-game (https://github.com/Fabrizio-Caruso/CROSS-CHASE)

Re: QDOS-GCC How to run the binaries?

Posted: Sat Jan 26, 2019 10:12 pm
by NormanDunbar
Evening Fabrizio, there is a thread here viewtopic.php?f=3&t=2605 you might find helpful. Especially my second post with a link to the libraries on Dilwyn's site. There are details of a patch you might need too, if you get as68 errors.

The compiler is C68 for windows or, in my case, Linux, so the C68 docs are what you need for compiling etc.

The generated binaries are almost ready to execute however, they cannot be executed on Windows/Linux because they are QL files. On Linux, use the 'file' command on the binary to see exactly what they are.

You need to copy the binaries to a QL, make them executable and set the data space.

The binaries have an xtcc record at the very end which holds the dataspace value required. But how to make them executables with the correct dataspace? You need my Assembly language eMagazine, Issue 6 and my xtcc utility, code at https://github.com/NormanDunbar/QLAssem ... 6/CODE.zip and the pdf magazine at https://github.com/NormanDunbar/QLAssem ... ge_006.pdf.

The utility converts the file from whatever was cross compiled on the PC to a QL executable with the required dataspace. You can now EX the file on the PC in an emulator, or on a QL.

Have fun.

Cheers,
Norm.

Re: QDOS-GCC How to run the binaries?

Posted: Sat Jan 26, 2019 10:29 pm
by NormanDunbar
PS. Ignore the Perl script. If there are no instructions, it's unlikely the code could be read and understood, even by the authour! Perl is a 'WORN' language. Write Once Read Never! :D

Cheers,
Norm.

Re: QDOS-GCC How to run the binaries?

Posted: Sun Jan 27, 2019 9:21 am
by stephen_usher
NormanDunbar wrote:PS. Ignore the Perl script. If there are no instructions, it's unlikely the code could be read and understood, even by the authour! Perl is a 'WORN' language. Write Once Read Never! :D
Bah! That depends upon the programmer.

Some write Perl which looks like line noise, others as a clear, structured and self-documenting code. I can't comment upon this item as I've not seen it. :)

+++NO CARRIER

Re: QDOS-GCC How to run the binaries?

Posted: Sun Jan 27, 2019 9:21 am
by tofro
For the records: This is not QDOS-GCC, but C68 as a cross-compiler.

QDOS-GCC is a completely different thing to build.

Tobias

Re: QDOS-GCC How to run the binaries?

Posted: Sun Jan 27, 2019 9:52 am
by Peter
NormanDunbar wrote:The binaries have an xtcc record at the very end which holds the dataspace value required. But how to make them executables with the correct dataspace? You need my Assembly language eMagazine, Issue 6 and my xtcc utility, code at https://github.com/NormanDunbar/QLAssem ... 6/CODE.zip and the pdf magazine at https://github.com/NormanDunbar/QLAssem ... ge_006.pdf.
I don't think a conversion program is needed. The standard commandline tool for moving PC files to QL media, qxltool, already takes care of that. Example for a QLWA container:

qxltool -w -c "wr <PC crosscompiled exetubale> <QL executable>" <Containerfile>

Also, if my rusted memory is right, QDOS unzip also recognizes the xtcc record. Then, suprisingly, just zipping on PC side and unzipping on QL side also does the job.

Peter

Re: QDOS-GCC How to run the binaries?

Posted: Sun Jan 27, 2019 4:57 pm
by XorA
Peter wrote:
Also, if my rusted memory is right, QDOS unzip also recognizes the xtcc record. Then, suprisingly, just zipping on PC side and unzipping on QL side also does the job.

Peter
yes you need -O1 or -O2 on pc side as an option. i forget which.

Re: QDOS-GCC How to run the binaries?

Posted: Sun Jan 27, 2019 10:17 pm
by NormanDunbar
Qxltools: I' ve never used, so I couldn't comment on what features it has, or has not, got.

I was unaware also that QL unzip knew about xtcc headers/trailers. Good to know. But is a special option is required on the compression side, I doubt it us used too often - but what do I know?

Thanks.

Cheers,
Norm.

Re: QDOS-GCC How to run the binaries?

Posted: Mon Jan 28, 2019 8:25 am
by Peter
NormanDunbar wrote:I was unaware also that QL unzip knew about xtcc headers/trailers. Good to know. But is a special option is required on the compression side, I doubt it us used too often - but what do I know?
Hi Norm, I don't think compression requires a special option on PC side, if it is a XTC68 or QDOS-GCC crosscompiled excutable.
I think that the xtcc marking is the internal way QDOS zip/unzip stores the data space, so that makes sense.

Peter

Re: QDOS-GCC How to run the binaries?

Posted: Mon Jan 28, 2019 3:13 pm
by mk79
Peter wrote:I think that the xtcc marking is the internal way QDOS zip/unzip stores the data space, so that makes sense.
No, the XTcc business is only added to the code when the QDOS ZIP source is compiled on another platform (effectively replacing the QDOS specific header functions). The header information is stored in the "extra" field in the ZIP data structure that was defined for exactly this purpose (platform specific header data).
InfoZIP readme wrote: Compile with Linux/gcc and get the standard Linux version. Now, here's
the cool bit; compile with Linux/gcc and "-DQLZIP", and get a standard
Linux Zip/UnZip with SMS/QDOS (header) extensions.

so, on Linux:

zip -Q stuff.zip qtpi zip unzip

the -Q tells Zip to look for XTc68/Lux68 cross-compiler data size
blocks and produce a zipfile with SMS/QDOS headers in it (for exec
type programs). This works for exec files produced by the XTc68/Lux68
cross compilers and ANY SMS/QDOS files copied to a Unix or MS-DOS disk
from an SMS/QDOS floppy using 'qltools v2.2' (or later).
Marcel