Using C68 for 128 KB QL

Anything QL Software or Programming Related.
Post Reply
User avatar
Peter
Font of All Knowledge
Posts: 2013
Joined: Sat Jan 22, 2011 8:47 am

Using C68 for 128 KB QL

Post by Peter »

Hi,

does anyone know why a C68 or QDOS-GCC generated program just returns doing nothing on a 128 KB QL?
Even a primitive "Hello world" program. Or even a program completely without console and only $64 dataspace that just POKES to the screen for test.
I also tried -codemodel=small and -datamodel=small without using the C library, which should avoid runtime relocation. Also didn't help.
Couldn't find something in the documentation saying a 128 KB QL was not a legitimate target.

All the best
Peter


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

Re: Using C68 for 128 KB QL

Post by tofro »

Does a "crespr"-linked file run?


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Peter
Font of All Knowledge
Posts: 2013
Joined: Sat Jan 22, 2011 8:47 am

Re: Using C68 for 128 KB QL

Post by Peter »

tofro wrote: Sat Dec 30, 2023 3:24 pm Does a "crespr"-linked file run?
Yes, but I don't want the program to be resident.


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Using C68 for 128 KB QL

Post by Derek_Stewart »

Hi

If you look in the C68 manual:
HARDWARE REQUIREMENTS

The one drawback of the C68 Compilation System is that it will not run on an unexpanded QL. The minimum requirements are 256Kb of memory and at least one 720Kb floppy disk drive. Additional memory and/or disk drives are highly desirable.


Regards,

Derek
User avatar
Peter
Font of All Knowledge
Posts: 2013
Joined: Sat Jan 22, 2011 8:47 am

Re: Using C68 for 128 KB QL

Post by Peter »

Derek, I don't run the compilation system on an unexpanded QL.
Just trying to run a minimal C68 or QDOS-GCC compiled executable.

But I might have found the issue:
For reasons beyond me, the empty code is 10 KB.
On top of that, C68 defaults to 4 KB stack + 4 KB minimum heap incrementing in steps of 4 KB + 20 KB.
Total at least 38 KB. That seems too much with TK2 and a 8 MB SD card image.

(I noticed mysterious dependencies on TK2 with my original application, that's why it is loaded.)


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

Re: Using C68 for 128 KB QL

Post by tofro »

My reason for asking whether a crespr version works was to find out where the executable fails - if a crespr version works, that means the program does not fail somewhere in the libraries, but rather in the crt startup code. It's likely then that the code that is exiting is somewhere in "crtjob.x", the main part that differs when you build a resident vs. a job executable.

If you start the offending job with EXEC_W instead of EXEC, do you get any meaningful error message?


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Using C68 for 128 KB QL

Post by Derek_Stewart »

Peter wrote: Sat Dec 30, 2023 5:01 pm Derek, I don't run the compilation system on an unexpanded QL.
Just trying to run a minimal C68 or QDOS-GCC compiled executable.

But I might have found the issue:
For reasons beyond me, the empty code is 10 KB.
On top of that, C68 defaults to 4 KB stack + 4 KB minimum heap incrementing in steps of 4 KB + 20 KB.
Total at least 38 KB. That seems too much with TK2 and a 8 MB SD card image.

(I noticed mysterious dependencies on TK2 with my original application, that's why it is loaded.)
My apologies for misunderstaning your question.

A 128K QL has only 96K of ram left, without Toolkit 2.

The 8 MB SD Card, needs ram for the drive map, there will not be much ram left for the user programme.


Regards,

Derek
User avatar
Peter
Font of All Knowledge
Posts: 2013
Joined: Sat Jan 22, 2011 8:47 am

Re: Using C68 for 128 KB QL

Post by Peter »

tofro wrote: Sat Dec 30, 2023 5:05 pm If you start the offending job with EXEC_W instead of EXEC, do you get any meaningful error message?
No. But one can set _stack, _mneed, _memincr and _memqdos global variables to control memory allocation.
Adjusting these allowed my program to run - now even with text window.
Unfortunately it runs significantly slower than with memory expansion, probably due to the slow internal RAM.


Post Reply