CLI - CP/M
This is a discussion on CLI - CP/M ; Hello CP/M fans,
Does anyone know how CP/M(-86) accesses a Command Line Interface in
Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
150, but that doesn't seem likely for CP/M(-86). Any ideas?
TIA!
Richard Brady...
-
CLI
Hello CP/M fans,
Does anyone know how CP/M(-86) accesses a Command Line Interface in
Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
150, but that doesn't seem likely for CP/M(-86). Any ideas?
TIA!
Richard Brady
-
Re: CLI
Richard Brady wrote:
: Does anyone know how CP/M(-86) accesses a Command Line Interface in
: Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
: 150, but that doesn't seem likely for CP/M(-86). Any ideas?
In CP/M 2.2 (and therefore, I believe, CP/M-86 1.x) SUBMIT.COM writes a
file called $$$.SUB containing each command to execute in reverse order. The
CCP checks for this file; if it's present, it loads the last record,
truncates the file so that record's no longer there, and uses what it read
as the next command.
In CP/M 3 (and presumably CP/M-86 3.x+) it's done using an RSX to redirect
keyboard input.
--
John Elliott
-
Re: CLI
John Elliott wrote:
> Richard Brady wrote:
> : Does anyone know how CP/M(-86) accesses a Command Line Interface in
> : Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
> : 150, but that doesn't seem likely for CP/M(-86). Any ideas?
>
> In CP/M 2.2 (and therefore, I believe, CP/M-86 1.x) SUBMIT.COM writes a
> file called $$$.SUB containing each command to execute in reverse order. The
> CCP checks for this file; if it's present, it loads the last record,
> truncates the file so that record's no longer there, and uses what it read
> as the next command.
>
> In CP/M 3 (and presumably CP/M-86 3.x+) it's done using an RSX to redirect
> keyboard input.
>
Thank you, John.
So the CCP actually polls for the existence of that particular file name
and selects it when it finds it. So if I wrote a file with that
filename, the CCP would execute the statements in it (in reverse order)?
Or does Submit tell the CCP to wake up when the file is finished? Or
maybe when Submit closes the file and exits?
That's pretty darn cool. But it does mean that there's no CLI into CP/M
except possibly via that file.
Thanks again.
Richard Brady
-
Re: CLI
Richard Brady wrote:
> John Elliott wrote:
>> Richard Brady wrote:
>>
>>> Does anyone know how CP/M(-86) accesses a Command Line Interface
>>> in Submit? Is it documented anywhere? I see that CCP/M uses
>>> BDOS call 150, but that doesn't seem likely for CP/M(-86). Any
>>> ideas?
>>
>> In CP/M 2.2 (and therefore, I believe, CP/M-86 1.x) SUBMIT.COM
>> writes a file called $$$.SUB containing each command to execute
>> in reverse order. The CCP checks for this file; if it's present,
>> it loads the last record, truncates the file so that record's no
>> longer there, and uses what it read as the next command.
>>
>> In CP/M 3 (and presumably CP/M-86 3.x+) it's done using an RSX to
>> redirect keyboard input.
>
> So the CCP actually polls for the existence of that particular
> file name and selects it when it finds it. So if I wrote a file
> with that filename, the CCP would execute the statements in it (in
> reverse order)? Or does Submit tell the CCP to wake up when the
> file is finished? Or maybe when Submit closes the file and exits?
> That's pretty darn cool. But it does mean that there's no CLI
> into CP/M except possibly via that file.
The entire CP/M 2.2 Submit mechanism is laid out in the emulation
performed in my DOSPLUS 2.5 (source and object available at
).
In particular the $$$.SUB file consists purely of 128 byte records,
which are loaded bodily into the input string, when present.
DOSPLUS adds some extras, such as insisting that the $$$.SUB file
is always found on the A disk, and allowing for convenient means to
abort a submitted job. I forget the details. They are encompassed
in the CCPLUS source and the JOB source (JOB replaces SUBMIT).
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
--
Posted via a free Usenet account from http://www.teranews.com
-
Re: CLI
Hello, Richard!
> > Richard Brady wrote:
> > : Does anyone know how CP/M(-86) accesses a Command Line Interface in
> > : Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
> > : 150, but that doesn't seem likely for CP/M(-86). Any ideas?
> So the CCP actually polls for the existence of that particular file name
> and selects it when it finds it. So if I wrote a file with that
> filename, the CCP would execute the statements in it (in reverse order)?
> Or does Submit tell the CCP to wake up when the file is finished? Or
> maybe when Submit closes the file and exits?
> That's pretty darn cool. But it does mean that there's no CLI into CP/M
> except possibly via that file.
I am afraid that the problem is your idea of what a "Command Line
Interface" is...
However, you precise: "in SUBMIT".
Then, under CP/M, there are 2 cases:
1) under BDOS 2 (the one used by CP/M 2.2 and CP/M-86)
2) under BDOS 3 (the one used by MPM II, CP/M Plus, CP/M-86 Plus and
probably Concurrent CP/M)
Under BDOS 2, SUBMIT was obliged to use XSUB to process submit files
containing another submit invokation.
Under BDOS 3, SUBMIT is a stand-alone RSX, which can be called 128
times (!) without problem. (In addition, you have the "Chain to
Program" BDOS system call.)
As for a "particular file name", they are all different whether you
are using
1) CP/M 2.2 ("$$$.SUB")
2) CP/M Plus ("PROFILE.SUB")
3) CP/M-86 Plus ("STARTUP.SUB")
4) Concurrent CP/M uses one-line submit files ("STARTUPx.SUB") which
can submit longer submit files.
Conclusion: Read The Formidable Manual...
(In addition, most source codes are now available, to resolve the
subtler points.)
Yours Sincerely,
Mr Emmanuel Roche
-
Re: CLI
CBFalconer wrote:
> Richard Brady wrote:
>> John Elliott wrote:
[snip]
> The entire CP/M 2.2 Submit mechanism is laid out in the emulation
> performed in my DOSPLUS 2.5 (source and object available at
> ).
>
> In particular the $$$.SUB file consists purely of 128 byte records,
> which are loaded bodily into the input string, when present.
> DOSPLUS adds some extras, such as insisting that the $$$.SUB file
> is always found on the A disk, and allowing for convenient means to
> abort a submitted job. I forget the details. They are encompassed
> in the CCPLUS source and the JOB source (JOB replaces SUBMIT).
>
Thank you Mr. Falconer. I shall take a look.
Regards,
Richard Brady
-
Re: CLI
roche182@laposte.net wrote:
> Hello, Richard!
Hello Mr. Roche!
>
[snip]
>
> I am afraid that the problem is your idea of what a "Command Line
> Interface" is...
>
> However, you precise: "in SUBMIT".
>
Somehow the CCP must be able to read and process internal and external
commands included in a sub file: a sort of back-door command line
interface into the CCP. So ANY program could execute any (standard)
CP/M(-86) programs just like SUBMIT (or XSUB).
> Then, under CP/M, there are 2 cases:
>
> 1) under BDOS 2 (the one used by CP/M 2.2 and CP/M-86)
>
> 2) under BDOS 3 (the one used by MPM II, CP/M Plus, CP/M-86 Plus and
> probably Concurrent CP/M)
>
> Under BDOS 2, SUBMIT was obliged to use XSUB to process submit files
> containing another submit invokation.
>
Which means I should look to the source for xsub. Thanks!
> Under BDOS 3, SUBMIT is a stand-alone RSX, which can be called 128
> times (!) without problem. (In addition, you have the "Chain to
> Program" BDOS system call.)
Chain to program might be the mechanism, but for "DIR", for example, the
submit file must ask the CCP to perform the task since that is not an
external program. For external programs like "STAT" or "PIP" I can see
how chain might work. I did not know that an RSX was used.
>
> As for a "particular file name", they are all different whether you
> are using
>
> 1) CP/M 2.2 ("$$$.SUB")
>
> 2) CP/M Plus ("PROFILE.SUB")
>
> 3) CP/M-86 Plus ("STARTUP.SUB")
This on startup, only, yes? Surely one can create submit files under
any name: to compile, for example.
>
> 4) Concurrent CP/M uses one-line submit files ("STARTUPx.SUB") which
> can submit longer submit files.
>
Once more, on startup of the virtual terminal, right?
> Conclusion: Read The Formidable Manual...
>
While I have that, the CP/M-86 ver 1.1 manual has information about how
to invoke the submit program, it has little in the way of internal
detail. I was surprised to discover, for example, that the last line of
the SUBMIT file had to have a CRLF at the end or submit ignored the
entire contents of the file (That fact is not in the manual!).
> (In addition, most source codes are now available, to resolve the
> subtler points.)
I have not found source code for SUBMIT, unhappily. I shall try XSUB
and Mr. Falconer's incredible gift, DOSPLUS 2.5, to try to determine
what happens.
>
> Yours Sincerely,
> Mr Emmanuel Roche
>
>
Thank you Mr. Roche, it's always good to hear from you.
Regards,
Richard Brady
-
Re: CLI
Richard Brady wrote:
: Somehow the CCP must be able to read and process internal and external
: commands included in a sub file: a sort of back-door command line
: interface into the CCP. So ANY program could execute any (standard)
: CP/M(-86) programs just like SUBMIT (or XSUB).
Yes. That's what $$$.SUB does.
XSUB is a bit different; it's for redirected keyboard input to programs
themselves. You don't need it just to execute a command.
The $$$.SUB mechanism is supported in CP/M-80 v3 (with $$$.SUB on the
temporary file drive), but not in PCP/M-86.
: Chain to program might be the mechanism, but for "DIR", for example, the
: submit file must ask the CCP to perform the task since that is not an
: external program. For external programs like "STAT" or "PIP" I can see
: how chain might work. I did not know that an RSX was used.
What the chain function (C=2Fh) does is put the passed command in a memory
buffer; the CCP then checks that buffer when it's launched, and executes that
command. The same mechanism is used for multiple commands separated by !
marks.
:> 2) CP/M Plus ("PROFILE.SUB")
:> 3) CP/M-86 Plus ("STARTUP.SUB")
: This on startup, only, yes? Surely one can create submit files under
: any name: to compile, for example.
Yes. PROFILE.SUB/STARTUP.SUB is only run on a cold boot. $$$.SUB, if
present, gets destructively run whenever the CCP gains control.
--
John Elliott
-
Re: CLI
Hello Richard,
Richard Brady schrieb:
>Does anyone know how CP/M(-86) accesses a Command Line Interface in
>Submit? Is it documented anywhere? I see that CCP/M uses BDOS call
>150, but that doesn't seem likely for CP/M(-86). Any ideas?
Not for CP/M-86.
Only for CP/M-80.
Try this Links.
http://www.retroarchive.org/cpm/cdro...5/SUPERSUB.ASM
http://www.retroarchive.org/cpm/cdro...5/SUPERSUB.COM
Rolf