ROM loader

Anything QL Software or Programming Related.
Post Reply
Derek_Stewart
Font of All Knowledge
Posts: 4660
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

ROM loader

Post by Derek_Stewart »

Hi,

After reading this message: viewtopic.php?t=4895 with regards to loading PSION Applications like Quill, from ROM.

If a QL programme that has a Executable header, has the executable header changed to a ROM header, and the programme was less thann 16K, would the excutable programme still run from a ROM image?


Regards,

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

Re: ROM loader

Post by tofro »

Derek_Stewart wrote: Wed Jul 31, 2024 8:38 pm Hi,

After reading this message: viewtopic.php?t=4895 with regards to loading PSION Applications like Quill, from ROM.

If a QL programme that has a Executable header, has the executable header changed to a ROM header, and the programme was less thann 16K, would the excutable programme still run from a ROM image?
It would run, but not particularly well and not particularly long. In essence, it would do the same thing as LRESPRing an executable file.

All job start commands in QDOS (EW, EX, EXECUTE,..., the like) create a complete job before loading the executable. And an executable program expects that all these preparations have been done before it is called (room for stack and data space is allocated, a6 and a7 pointing to it, a job header is created that holds room for context saves,....) All of this is not done for code in ROM: It's simply CALLed.

That means, for such an executable, the stack should be somewhere on the system stack, a6 would be pointing somewhere, but certainly not into specifically allocated data space, and, most importantly: multitasking would be deactivated (because the "job" is running in, and occupying, the system context).

A ROM job can be done (the various printer spoolers and the network server are examples), but some preparation routine has to be written to run code in ROM as a job, more or less a copy of what EXEC does.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply