QDOS-GCC How to run the binaries?

Anything QL Software or Programming Related.
Fabrizio
ROM Dongle
Posts: 17
Joined: Thu Apr 19, 2018 11:09 am

QDOS-GCC How to run the binaries?

Post 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)
Last edited by Fabrizio on Sun Jan 27, 2019 9:02 pm, edited 1 time in total.


User avatar
NormanDunbar
Forum Moderator
Posts: 2273
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Post 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.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
NormanDunbar
Forum Moderator
Posts: 2273
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Post 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.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: QDOS-GCC How to run the binaries?

Post 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


User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QDOS-GCC How to run the binaries?

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Peter
QL Wafer Drive
Posts: 1987
Joined: Sat Jan 22, 2011 8:47 am

Re: QDOS-GCC How to run the binaries?

Post 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


User avatar
XorA
Site Admin
Posts: 1365
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: QDOS-GCC How to run the binaries?

Post 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.


User avatar
NormanDunbar
Forum Moderator
Posts: 2273
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Post 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.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
Peter
QL Wafer Drive
Posts: 1987
Joined: Sat Jan 22, 2011 8:47 am

Re: QDOS-GCC How to run the binaries?

Post 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


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QDOS-GCC How to run the binaries?

Post 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


Post Reply