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?

Postby Fabrizio » Sat Jan 26, 2019 4:03 pm

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: 1089
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Postby NormanDunbar » Sat Jan 26, 2019 10:12 pm

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 - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
NormanDunbar
Forum Moderator
Posts: 1089
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Postby NormanDunbar » Sat Jan 26, 2019 10:29 pm

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 - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
stephen_usher
Trump Card
Posts: 243
Joined: Tue Mar 11, 2014 8:00 pm

Re: QDOS-GCC How to run the binaries?

Postby stephen_usher » Sun Jan 27, 2019 9:21 am

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
QL Wafer Drive
Posts: 1969
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QDOS-GCC How to run the binaries?

Postby tofro » Sun Jan 27, 2019 9:21 am

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: 1039
Joined: Sat Jan 22, 2011 8:47 am

Re: QDOS-GCC How to run the binaries?

Postby Peter » Sun Jan 27, 2019 9:52 am

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
Super Gold Card
Posts: 627
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: QDOS-GCC How to run the binaries?

Postby XorA » Sun Jan 27, 2019 4:57 pm

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: 1089
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QDOS-GCC How to run the binaries?

Postby NormanDunbar » Sun Jan 27, 2019 10:17 pm

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 - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
Peter
QL Wafer Drive
Posts: 1039
Joined: Sat Jan 22, 2011 8:47 am

Re: QDOS-GCC How to run the binaries?

Postby Peter » Mon Jan 28, 2019 8:25 am

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
Super Gold Card
Posts: 613
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QDOS-GCC How to run the binaries?

Postby mk79 » Mon Jan 28, 2019 3:13 pm

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



Who is online

Users browsing this forum: No registered users and 4 guests