Is there a way to exit from C without triggering a CP/M warm boot?
see https://github.com/Laci1953/RC2014-CPM/tree/main/ReturnToCCP
, for an example of how to build, using the HiTech C compiler, a .COM file that returns directly to CCP, without a CP/M warm boot.
LINKlink> -PTEXT=100H,DATA,BSS -C100H -OMYDUMPX.COM MYCRTCPM.OBJ DUMPX.OBJ LIBC.LIB
Hi,
see https://github.com/Laci1953/RC2014-CPM/tree/main/ReturnToCCP
, for an example of how to build, using the HiTech C compiler, a .COM file that returns directly to CCP, without a CP/M warm boot.
Ladislau
By the way, see the "original" HiTech's crtcpm.as here: https://github.com/Laci1953/RC2014-CPM/blob/main/ReturnToCCP/crtcpm.original.as
, in order to see how simple is the modification I used...
Hi Douglas,
yes, you are right, I could not find a simple way to calculate the CCP base address (or the CCP size) , so I assumed that we are working with the "original" CCP, which is 806H bytes long...
For other, "custom" CCP's, the mycrtcpm.as source code must be changed accordingly.
Ladislau
Hi Douglas,Just to let you know -- CCP for CP/NET 1.2 is about 4 pages longer than CP/M 2.2
yes, you are right, I could not find a simple way to calculate the CCP base address (or the CCP size) , so I assumed that we are working with the "original" CCP, which is 806H bytes long...
For other, "custom" CCP's, the mycrtcpm.as source code must be changed accordingly.
Ladislau
On Sat, 22 Jul 2023, Luca Masini wrote:
Is there a way to exit from C without triggering a CP/M warm boot?
That's literally what exiting any program does in CP/M.
I mean, you could try jumping back into the CCP, but that's going deep into the bowels of CP/M and I think won't work at all with 3...
c -v -o test.ctest
test
type test.txt
era test.txttest
submit maketest
mytest
type test.txt
Speaking of which, can anyone remind me what would happen were this
'no warm boot' scheme run under CP/M-3 ? IIRC CCP3 is a transient
which loads at 100h and whose source is banked memory. Then there
are the CP/M-3 RSX. Is top of TPA still determined from the page
number located at address 0007h ?
after some careful investigations, it turns out that, after all, _exit was called correctly,
but after doing its job, it jumped to 0 in its original HiTech library implementation, that's why CP/M re-booted...
I published a new, corrected version.
What was the problem: it could happen that in a C program, the author forgets to close a file that was opened for write.
Because of this, at the end of crtcpm, _exit was used.
See the whole story here: https://github.com/Laci1953/HiTech-C-compiler-enhanced,
plus here: https://github.com/Laci1953/Z80AS
On Sunday, July 23, 2023 at 11:27:25 PM UTC-5, dxforth wrote:check for CP/M 3 and change its behavior, since none of it is necessary. Similarly, it could check for CP/NET and use a different CCP size (although there is more probability that the CCP might be an expected size, since it was so easy to build your own).
Speaking of which, can anyone remind me what would happen were this
'no warm boot' scheme run under CP/M-3 ? IIRC CCP3 is a transient
which loads at 100h and whose source is banked memory. Then there
are the CP/M-3 RSX. Is top of TPA still determined from the page
number located at address 0007h ?
On CP/M 3, this CRT would waste some space but should still work. Most/many CP/M 3 implementations would cache the CCP in an alternate bank of RAM and so warm boot would be very fast and this enhancement is not needed. The CRT could be modified to
Note that the standard CCP.SPR from DRI was actually only 2 pages larger than the CP/M 2.2 CCP (0A00H vs. 0800H), but since it is an SPR file it contains extra pages that are not actually part of the running image (header and relocation data) and it "looks" bigger. So in the case of CCP.SPR you need to examine the header in order to determine what the size is when running in memory - the file size will be misleading.
The option to bypass warm boots exists in programs compiled with DX-Forth for CP/M.
OTOH it's not particularly useful as it assumes a 2K CCP.
This thread got me thinking I should at least make the number of pages reserved user-selectable.
Hi dxforth,
The option to bypass warm boots exists in programs compiled with DX-Forth for CP/M.
OTOH it's not particularly useful as it assumes a 2K CCP.
This thread got me thinking I should at least make the number of pages reserved user-selectable.
I knew that DX-Forth did not call Warm-Boot on termination.
The implementation of CLS.COM that I did in DX-Forth was the following
: main page ;
\ Create cls.com and exit
turnkey main cls
bye
To generate a turnkey CLS.COM I used the following CP/M command line:
forth - include cls.f
What I didn't know was this behavior is optional.
How can we generate a turnkey executable with DX-Forth that calls Warm-Boot on exit?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 196:01:50 |
Calls: | 9,707 |
Calls today: | 2 |
Files: | 13,740 |
Messages: | 6,180,543 |